Integrated INTERNAL_CATCH_THROWS_STR_MATCHES with new AssertionHandler

This commit is contained in:
Phil Nash
2017-08-09 00:44:30 +01:00
parent ef4fa56b71
commit 27fd8f80bd
9 changed files with 51 additions and 20 deletions

View File

@@ -159,18 +159,18 @@
///////////////////////////////////////////////////////////////////////////////
#define INTERNAL_CATCH_THROWS_STR_MATCHES( macroName, resultDisposition, matcher, ... ) \
do { \
Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #__VA_ARGS__ ", " #matcher, resultDisposition); \
if( __catchResult.allowThrows() ) \
Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, #__VA_ARGS__ ", " #matcher, resultDisposition ); \
if( catchAssertionHandler.allowThrows() ) \
try { \
static_cast<void>(__VA_ARGS__); \
__catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
catchAssertionHandler.handle( Catch::ResultWas::DidntThrowException ); \
} \
catch( ... ) { \
__catchResult.captureExpectedException( matcher ); \
handleExceptionMatchExpr( catchAssertionHandler, matcher, #matcher ); \
} \
else \
__catchResult.captureResult( Catch::ResultWas::Ok ); \
INTERNAL_CATCH_REACT( __catchResult ) \
catchAssertionHandler.handle( Catch::ResultWas::Ok ); \
INTERNAL_CATCH_REACT2( catchAssertionHandler ) \
} while( Catch::alwaysFalse() )