mirror of
https://github.com/catchorg/Catch2.git
synced 2024-12-22 11:23:29 +01:00
Add variadic CAPTURE tests
This makes sure that CAPTURE works when called with variadic arguments,
and also works that way when disabled.
The underlying fix to #2316 is not applicable (CAPTURE is already
variadic when disabled).
This is a port of 5e94498ed0
to the
devel branch.
This commit is contained in:
parent
2ebc041903
commit
f9facc1881
@ -66,6 +66,7 @@ CATCH_TEST_CASE("PrefixedMacros") {
|
||||
CATCH_SECTION("some section") {
|
||||
int i = 1;
|
||||
CATCH_CAPTURE( i );
|
||||
CATCH_CAPTURE( i, i + 1 );
|
||||
CATCH_DYNAMIC_SECTION("Dynamic section: " << i) {
|
||||
CATCH_FAIL_CHECK( "failure" );
|
||||
}
|
||||
|
@ -52,6 +52,9 @@ TEST_CASE( "Disabled Macros" ) {
|
||||
STATIC_CHECK( 0 == 1 );
|
||||
STATIC_REQUIRE( !true );
|
||||
|
||||
CAPTURE( 1 );
|
||||
CAPTURE( 1, "captured" );
|
||||
|
||||
REQUIRE_THAT( 1,
|
||||
Catch::Matchers::Predicate( []( int ) { return false; } ) );
|
||||
BENCHMARK( "Disabled benchmark" ) { REQUIRE( 1 == 2 ); };
|
||||
|
Loading…
Reference in New Issue
Block a user