Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
authorPhil Nash2017-08-08 23:41:55 +0100
committerPhil Nash2017-08-08 23:41:55 +0100
commitef4fa56b71e7013fe39609abfb25819b618c1177 (patch)
treebc947e2e64e61ccdd0925790ccd80c58dc6f5c04 /include
parent9668410b8e415c22d2665a820a1e113acfd6ae64 (diff)
downloadcatch3-ef4fa56b71e7013fe39609abfb25819b618c1177.tar.gz
integrated INTERNAL_CATCH_THROWS_MATCHES with new AssertionHandler
Diffstat (limited to 'include')
-rw-r--r--include/internal/catch_capture.hpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index ef152dae..ee63e044 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -175,23 +175,23 @@
///////////////////////////////////////////////////////////////////////////////
-#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, expr ) \
+#define INTERNAL_CATCH_THROWS_MATCHES( macroName, exceptionType, resultDisposition, matcher, ... ) \
do { \
- Catch::ResultBuilder __catchResult( macroName, CATCH_INTERNAL_LINEINFO, #expr ", " #exceptionType ", " #matcher, resultDisposition ); \
- if( __catchResult.allowThrows() ) \
+ Catch::AssertionHandler catchAssertionHandler( macroName, CATCH_INTERNAL_LINEINFO, #__VA_ARGS__ ", " #exceptionType ", " #matcher, resultDisposition ); \
+ if( catchAssertionHandler.allowThrows() ) \
try { \
- static_cast<void>(expr); \
- __catchResult.captureResult( Catch::ResultWas::DidntThrowException ); \
+ static_cast<void>(__VA_ARGS__ ); \
+ catchAssertionHandler.handle( Catch::ResultWas::DidntThrowException ); \
} \
catch( exceptionType const& ex ) { \
- __catchResult.captureMatch( ex, matcher, #matcher ); \
+ catchAssertionHandler.handle( Catch::makeMatchExpr( ex, matcher, #matcher ) ); \
} \
catch( ... ) { \
- __catchResult.useActiveException( resultDisposition ); \
+ catchAssertionHandler.useActiveException(); \
} \
else \
- __catchResult.captureResult( Catch::ResultWas::Ok ); \
- INTERNAL_CATCH_REACT( __catchResult ) \
+ catchAssertionHandler.handle( Catch::ResultWas::Ok ); \
+ INTERNAL_CATCH_REACT2( catchAssertionHandler ) \
} while( Catch::alwaysFalse() )
#endif // CATCH_CONFIG_DISABLE_MATCHERS