diff options
| author | Phil Nash | 2017-08-08 21:07:30 +0100 |
|---|---|---|
| committer | Phil Nash | 2017-08-08 21:07:30 +0100 |
| commit | 2832e23aa9b4dab95e9391bfc2a8bf86a778b0fb (patch) | |
| tree | 711996b2903bbd3ae7b1e2d818527a7ceea4fb30 /include/internal/catch_assertionhandler.cpp | |
| parent | 5f9172436883c535de4a119bd3b2314a2a5f9f70 (diff) | |
| download | catch3-2832e23aa9b4dab95e9391bfc2a8bf86a778b0fb.tar.gz | |
Restored exceptionGuard functionality under CATCH_CONFIG_FAST_COMPILE
Diffstat (limited to 'include/internal/catch_assertionhandler.cpp')
| -rw-r--r-- | include/internal/catch_assertionhandler.cpp | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp index d53b09fa..8d99e3d0 100644 --- a/include/internal/catch_assertionhandler.cpp +++ b/include/internal/catch_assertionhandler.cpp @@ -14,7 +14,7 @@ #include "catch_debugger.h" #include "catch_interfaces_registry_hub.h" -#include <iostream> // !TBD +#include <cassert> namespace Catch { @@ -58,6 +58,12 @@ namespace Catch { { getCurrentContext().getResultCapture()->assertionStarting( m_assertionInfo ); } + AssertionHandler::~AssertionHandler() { + if ( m_inExceptionGuard ) { + handle( ResultWas::ThrewException, "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE" ); + getCurrentContext().getResultCapture()->exceptionEarlyReported(); + } + } void AssertionHandler::handle( ITransientExpression const& expr ) { @@ -125,4 +131,14 @@ namespace Catch { handle( ResultWas::ThrewException, Catch::translateActiveException().c_str() ); } + void AssertionHandler::setExceptionGuard() { + assert( m_inExceptionGuard == false ); + m_inExceptionGuard = true; + } + void AssertionHandler::unsetExceptionGuard() { + assert( m_inExceptionGuard == true ); + m_inExceptionGuard = false; + } + + } // namespace Catch |