diff --git a/test/test.cpp b/test/test.cpp index 21223a8..d31d640 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -113,24 +113,11 @@ enum class OutOfRange { too_high = NAMEOF_ENUM_RANGE_MAX + 1 }; -struct TestRtti{ +struct TestRtti { struct Base { virtual ~Base() = default; }; struct Derived : Base {}; }; -#if defined(NAMEOF_MEMBER_SUPPORTED) && NAMEOF_MEMBER_SUPPORTED - -struct StructMemberInitializationUsingNameof{ - std::string teststringfield = std::string{nameof::nameof_member<&StructMemberInitializationUsingNameof::teststringfield>()}; -}; - -struct StructWithNonConstexprDestructor{ - ~StructWithNonConstexprDestructor(){} - int somefield; -}; - -#endif - SomeStruct struct_var; Long othervar; SomeStruct* ptr_s = &struct_var; @@ -923,6 +910,15 @@ TEST_CASE("NAMEOF_SHORT_TYPE_RTTI") { #if defined(NAMEOF_MEMBER_SUPPORTED) && NAMEOF_MEMBER_SUPPORTED +struct StructMemberInitializationUsingNameof { + std::string teststringfield = std::string{nameof::nameof_member<&StructMemberInitializationUsingNameof::teststringfield>()}; +}; + +struct StructWithNonConstexprDestructor { + ~StructWithNonConstexprDestructor() {} + int somefield; +}; + TEST_CASE("NAMEOF_MEMBER") { REQUIRE(NAMEOF_MEMBER(&SomeStruct::somefield) == "somefield"); REQUIRE(NAMEOF_MEMBER(&SomeStruct::SomeMethod1) == "SomeMethod1");