From 7f4fc39a0a24743fcc4568a5022abb316399e96f Mon Sep 17 00:00:00 2001 From: neargye Date: Tue, 1 Oct 2019 18:43:32 +0500 Subject: [PATCH] update test --- test/test.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/test/test.cpp b/test/test.cpp index fc9ca93..0cb2160 100644 --- a/test/test.cpp +++ b/test/test.cpp @@ -73,7 +73,7 @@ struct Long { enum class Color { RED = -12, GREEN = 7, BLUE = 15 }; -enum class Numbers : char { one = 10, two = 20, three = 30, many = 127 }; +enum class Numbers : int { one = 1, two, three, many = 127 }; enum Directions { Up = 85, Down = -42, Right = 120, Left = -120 }; @@ -89,14 +89,6 @@ struct enum_range { }; } -#if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER) -static_assert(nameof::is_nameof_enum_supported, "nameof::nameof_enum: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); -#endif - -#if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) -static_assert(nameof::is_nameof_type_supported, "nameof::nameof_type: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); -#endif - SomeStruct struct_var; Long othervar; SomeStruct * ptr_s = &struct_var; @@ -234,6 +226,9 @@ TEST_CASE("NAMEOF_RAW") { } #if defined(__clang__) || (defined(__GNUC__) && __GNUC__ >= 9) || defined(_MSC_VER) + +static_assert(nameof::is_nameof_enum_supported, "nameof::nameof_enum: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); + TEST_CASE("NAMEOF_ENUM") { constexpr Color cr = Color::RED; constexpr auto cr_name = NAMEOF_ENUM(cr); @@ -371,8 +366,13 @@ TEST_CASE("nameof_enum") { REQUIRE(nameof::nameof_enum(0)>().empty()); } } + #endif +#if defined(__clang__) || defined(__GNUC__) || defined(_MSC_VER) + +static_assert(nameof::is_nameof_type_supported, "nameof::nameof_type: Unsupported compiler (https://github.com/Neargye/nameof#compiler-compatibility)."); + TEST_CASE("NAMEOF_FULL_TYPE_EXPR") { constexpr auto type_name = NAMEOF_FULL_TYPE_EXPR(struct_var); #if defined(__clang__) @@ -690,3 +690,5 @@ TEST_CASE("nameof::nameof_type") { REQUIRE(nameof::nameof_type() == "Color"); #endif } + +#endif