Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/tests/ExtraTests
diff options
context:
space:
mode:
authorMorwenn2021-11-15 00:28:27 +0100
committerGitHub2021-11-15 00:28:27 +0100
commitf41d76167431eeb0ae8e82703e5597769c0531b8 (patch)
treec8d12223841b561eee975fc5ba8a9043ca6fe6e7 /tests/ExtraTests
parentedc2f6e8a35b6261e83db9c685f44cb3a4c24d04 (diff)
downloadcatch3-f41d76167431eeb0ae8e82703e5597769c0531b8.tar.gz
Add STATIC_CHECK and STATIC_CHECK_FALSE (#2318)
Diffstat (limited to 'tests/ExtraTests')
-rw-r--r--tests/ExtraTests/X01-PrefixedMacros.cpp2
-rw-r--r--tests/ExtraTests/X02-DisabledMacros.cpp4
2 files changed, 6 insertions, 0 deletions
diff --git a/tests/ExtraTests/X01-PrefixedMacros.cpp b/tests/ExtraTests/X01-PrefixedMacros.cpp
index 43452d76..9110bbba 100644
--- a/tests/ExtraTests/X01-PrefixedMacros.cpp
+++ b/tests/ExtraTests/X01-PrefixedMacros.cpp
@@ -62,6 +62,8 @@ CATCH_TEST_CASE("PrefixedMacros") {
CATCH_STATIC_REQUIRE( std::is_void<void>::value );
CATCH_STATIC_REQUIRE_FALSE( std::is_void<int>::value );
+ CATCH_STATIC_CHECK( std::is_void<void>::value );
+ CATCH_STATIC_CHECK_FALSE( std::is_void<int>::value );
CATCH_FAIL("");
}
diff --git a/tests/ExtraTests/X02-DisabledMacros.cpp b/tests/ExtraTests/X02-DisabledMacros.cpp
index c2d997c9..5a756d70 100644
--- a/tests/ExtraTests/X02-DisabledMacros.cpp
+++ b/tests/ExtraTests/X02-DisabledMacros.cpp
@@ -32,6 +32,10 @@ foo f;
TEST_CASE( "Disabled Macros" ) {
std::cout << "This should not happen\n";
FAIL();
+
+ // Test that static assertions don't fire when macros are disabled
+ STATIC_CHECK( 0 == 1 );
+ STATIC_REQUIRE( !true );
}
#if defined(__clang__)