123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159 |
-
-
- ///////////////////////////////////////////////////////////////////////////////
- // Another way to speed-up compilation is to omit local try-catch for REQUIRE*
- // macros.
- ///////////////////////////////////////////////////////////////////////////////
- do { \
- \
- CATCH_INTERNAL_IGNORE_BUT_WARN(__VA_ARGS__); \
- Catch::AssertionHandler catchAssertionHandler( macroName
- INTERNAL_CATCH_TRY { \
- CATCH_INTERNAL_START_WARNINGS_SUPPRESSION \
- CATCH_INTERNAL_SUPPRESS_PARENTHESES_WARNINGS \
- catchAssertionHandler.handleExpr( Catch::Decomposer() <= __VA_ARGS__ ); \
- CATCH_INTERNAL_STOP_WARNINGS_SUPPRESSION \
- } INTERNAL_CATCH_CATCH( catchAssertionHandler ) \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( (void)0, (false) && static_cast<bool>( !!(__VA_ARGS__) ) )
- ///////////////////////////////////////////////////////////////////////////////
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( Catch::getResultCapture().lastAssertionPassed() )
- ///////////////////////////////////////////////////////////////////////////////
- INTERNAL_CATCH_TEST( macroName, resultDisposition, __VA_ARGS__ ); \
- if( !Catch::getResultCapture().lastAssertionPassed() )
- ///////////////////////////////////////////////////////////////////////////////
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleExceptionNotThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
- ///////////////////////////////////////////////////////////////////////////////
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
- ///////////////////////////////////////////////////////////////////////////////
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(expr); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( exceptionType const& ) { \
- catchAssertionHandler.handleExceptionThrownAsExpected(); \
- } \
- catch( ... ) { \
- catchAssertionHandler.handleUnexpectedInflightException(); \
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
- ///////////////////////////////////////////////////////////////////////////////
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName
- catchAssertionHandler.handleMessage( messageType, ( Catch::MessageStream() << __VA_ARGS__ + ::Catch::StreamEndStop() ).m_stream.str() ); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
- ///////////////////////////////////////////////////////////////////////////////
- auto varName = Catch::Capturer( macroName, CATCH_INTERNAL_LINEINFO, Catch::ResultWas::Info,
- varName.captureValues( 0, __VA_ARGS__ )
- ///////////////////////////////////////////////////////////////////////////////
- Catch::ScopedMessage INTERNAL_CATCH_UNIQUE_NAME( scopedMessage )( Catch::MessageBuilder( macroName
- ///////////////////////////////////////////////////////////////////////////////
- Catch::getResultCapture().emplaceUnscopedMessage( Catch::MessageBuilder( macroName
- ///////////////////////////////////////////////////////////////////////////////
- // Although this is matcher-based, it can be used with just a string
- do { \
- Catch::AssertionHandler catchAssertionHandler( macroName
- if( catchAssertionHandler.allowThrows() ) \
- try { \
- static_cast<void>(__VA_ARGS__); \
- catchAssertionHandler.handleUnexpectedExceptionNotThrown(); \
- } \
- catch( ... ) { \
- Catch::handleExceptionMatchExpr( catchAssertionHandler, matcher,
- } \
- else \
- catchAssertionHandler.handleThrowingCallSkipped(); \
- INTERNAL_CATCH_REACT( catchAssertionHandler ) \
- } while( false )
|