mirror of
https://github.com/catchorg/Catch2.git
synced 2025-05-30 00:17:52 +00:00
Fixed #132
This commit is contained in:
parent
2f92db9898
commit
134e45b3ad
4 changed files with 39 additions and 24 deletions
|
@ -293,3 +293,24 @@ TEST_CASE( "./sameName", "Tests with the same name are not allowed" )
|
|||
|
||||
}
|
||||
*/
|
||||
|
||||
struct Boolable
|
||||
{
|
||||
explicit Boolable( bool value ) : m_value( value ) {}
|
||||
|
||||
operator Catch::SafeBool::type() const {
|
||||
return Catch::SafeBool::makeSafe( m_value );
|
||||
}
|
||||
|
||||
bool m_value;
|
||||
};
|
||||
|
||||
TEST_CASE( "./succeeding/SafeBool", "Objects that evaluated in boolean contexts can be checked")
|
||||
{
|
||||
Boolable True( true );
|
||||
Boolable False( false );
|
||||
|
||||
CHECK( True );
|
||||
CHECK( !False );
|
||||
CHECK_FALSE( False );
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue