From bc183cd334848b52848dab7c148b8c234fd727a9 Mon Sep 17 00:00:00 2001 From: neargye Date: Wed, 7 Dec 2022 01:30:25 +0400 Subject: [PATCH] clean-up --- test/test.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) 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");