mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 05:15:39 +02:00
Add STATIC_CHECK and STATIC_CHECK_FALSE (#2318)
This commit is contained in:
@@ -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("");
|
||||
}
|
||||
|
||||
|
@@ -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__)
|
||||
|
Reference in New Issue
Block a user