mirror of
https://github.com/catchorg/Catch2.git
synced 2025-11-05 22:49:33 +01:00
Restored exceptionGuard functionality under CATCH_CONFIG_FAST_COMPILE
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user