mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-31 08:57:58 +00:00
Added CHECKED_IF and CHECKED_ELSE
This commit is contained in:
parent
6abf702895
commit
a162e22fa3
9 changed files with 102 additions and 14 deletions
|
@ -121,3 +121,39 @@ TEST_CASE( "./failing/info", "sends information to INFO" )
|
|||
CAPTURE( i );
|
||||
REQUIRE( false );
|
||||
}
|
||||
|
||||
inline bool testCheckedIf( bool flag )
|
||||
{
|
||||
CHECKED_IF( flag )
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
TEST_CASE( "./succeeding/checkedif", "" )
|
||||
{
|
||||
REQUIRE( testCheckedIf( true ) );
|
||||
}
|
||||
|
||||
TEST_CASE( "./failing/checkedif", "" )
|
||||
{
|
||||
REQUIRE( testCheckedIf( false ) );
|
||||
}
|
||||
|
||||
inline bool testCheckedElse( bool flag )
|
||||
{
|
||||
CHECKED_ELSE( flag )
|
||||
return false;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
TEST_CASE( "./succeeding/checkedelse", "" )
|
||||
{
|
||||
REQUIRE( testCheckedElse( true ) );
|
||||
}
|
||||
|
||||
TEST_CASE( "./failing/checkedelse", "" )
|
||||
{
|
||||
REQUIRE( testCheckedElse( false ) );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue