From f7f75c8d2ad729fe136589ad3de1c5c2b7bbbe13 Mon Sep 17 00:00:00 2001 From: Alexander Karzhenkov Date: Fri, 21 Aug 2020 19:45:15 +0500 Subject: [PATCH] Exclude test with std::variant when it's unavailable --- test/src/unit-regression1.cpp | 4 ---- test/src/unit-regression2.cpp | 7 +++++-- 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/test/src/unit-regression1.cpp b/test/src/unit-regression1.cpp index 9dcc75b09..ff9ff6d8b 100644 --- a/test/src/unit-regression1.cpp +++ b/test/src/unit-regression1.cpp @@ -47,10 +47,6 @@ using nlohmann::json; #define JSON_HAS_CPP_17 #endif -#ifdef JSON_HAS_CPP_17 - #include -#endif - #include "fifo_map.hpp" ///////////////////////////////////////////////////////////////////// diff --git a/test/src/unit-regression2.cpp b/test/src/unit-regression2.cpp index ca50cdd41..c832f7d5a 100644 --- a/test/src/unit-regression2.cpp +++ b/test/src/unit-regression2.cpp @@ -48,7 +48,10 @@ using nlohmann::json; #endif #ifdef JSON_HAS_CPP_17 - #include + #if __has_include() + #define HAS_STD_VARIANT + #include + #endif #endif ///////////////////////////////////////////////////////////////////// @@ -247,7 +250,7 @@ TEST_CASE("regression tests 2") CHECK(diffs.size() == 1); // Note the change here, was 2 } -#ifdef JSON_HAS_CPP_17 +#ifdef HAS_STD_VARIANT SECTION("issue #1292 - Serializing std::variant causes stack overflow") { static_assert(