mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-26 07:16:10 +01:00
Fixed some more warnings
This commit is contained in:
parent
04ecced419
commit
4b8e3fca32
@ -369,6 +369,11 @@ inline std::string toString<Approx>( const Approx& value )
|
||||
return oss.str();
|
||||
}
|
||||
|
||||
// This is just here to avoid compiler warnings with macro constants
|
||||
inline bool isTrue( bool value )
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
} // end namespace Catch
|
||||
|
||||
@ -376,12 +381,14 @@ inline std::string toString<Approx>( const Approx& value )
|
||||
if( Catch::ResultAction::Value action = Catch::ResultsCapture::acceptResult( result ) ) \
|
||||
{ \
|
||||
if( action == Catch::ResultAction::DebugFailed ) DebugBreak(); \
|
||||
if( stopOnFailure ) throw Catch::TestFailureException(); \
|
||||
if( Catch::isTrue( stopOnFailure ) ) throw Catch::TestFailureException(); \
|
||||
}
|
||||
|
||||
#define INTERNAL_CATCH_TEST( expr, isNot, stopOnFailure, macroName ) \
|
||||
{ \
|
||||
Catch::ResultsCapture::acceptExpression( Catch::ResultBuilder( #expr, isNot, __FILE__, __LINE__, macroName )->*expr ); \
|
||||
INTERNAL_CATCH_ACCEPT_RESULT( expr, stopOnFailure )
|
||||
INTERNAL_CATCH_ACCEPT_RESULT( expr, stopOnFailure ) \
|
||||
}
|
||||
|
||||
#define INTERNAL_CATCH_THROWS( expr, exceptionType, nothrow, stopOnFailure, macroName ) \
|
||||
Catch::ResultsCapture::acceptExpression( Catch::ResultBuilder( #expr, false, __FILE__, __LINE__, macroName ) ); \
|
||||
@ -403,11 +410,13 @@ catch( ... ) \
|
||||
}
|
||||
|
||||
#define INTERNAL_CATCH_MSG( reason, resultType, stopOnFailure, macroName ) \
|
||||
{ \
|
||||
std::ostringstream INTERNAL_CATCH_UNIQUE_NAME( strm ); \
|
||||
INTERNAL_CATCH_UNIQUE_NAME( strm ) << reason; \
|
||||
Catch::ResultsCapture::acceptExpression( Catch::MutableResultInfo( "", false, __FILE__, __LINE__, macroName ) ); \
|
||||
Catch::ResultsCapture::acceptMessage( INTERNAL_CATCH_UNIQUE_NAME( strm ).str() ); \
|
||||
INTERNAL_CATCH_ACCEPT_RESULT( resultType, stopOnFailure ) \
|
||||
}
|
||||
|
||||
#define INTERNAL_CATCH_SCOPED_INFO( log ) Catch::ScopedInfo INTERNAL_CATCH_UNIQUE_NAME( info ); INTERNAL_CATCH_UNIQUE_NAME( info ) << log
|
||||
|
||||
|
@ -80,7 +80,7 @@
|
||||
#endif
|
||||
|
||||
#ifndef DebugBreak
|
||||
#define DebugBreak()
|
||||
inline void DebugBreak(){}
|
||||
#endif
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user