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:
John Beard
2022-03-05 12:50:48 +00:00
committed by Martin Hořeňovský
parent 2ebc041903
commit f9facc1881
2 changed files with 4 additions and 0 deletions

View File

@@ -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 ); };