Restored exceptionGuard functionality under CATCH_CONFIG_FAST_COMPILE
This commit is contained in:
parent
5f91724368
commit
2832e23aa9
3 changed files with 31 additions and 7 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue