diff --git a/include/internal/catch_assertionhandler.cpp b/include/internal/catch_assertionhandler.cpp index 3465269f..8bef64c1 100644 --- a/include/internal/catch_assertionhandler.cpp +++ b/include/internal/catch_assertionhandler.cpp @@ -8,10 +8,8 @@ #include "catch_assertionhandler.h" #include "catch_assertionresult.h" -#include "catch_interfaces_capture.h" #include "catch_interfaces_runner.h" #include "catch_interfaces_config.h" -#include "catch_context.h" #include "catch_debugger.h" #include "catch_interfaces_registry_hub.h" #include "catch_capture_matchers.h" @@ -60,12 +58,6 @@ 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 ) { diff --git a/include/internal/catch_assertionhandler.h b/include/internal/catch_assertionhandler.h index 9fdbee4f..bfd6aeba 100644 --- a/include/internal/catch_assertionhandler.h +++ b/include/internal/catch_assertionhandler.h @@ -10,6 +10,8 @@ #include "catch_decomposer.h" #include "catch_assertioninfo.h" +#include "catch_context.h" +#include "catch_interfaces_capture.h" namespace Catch { @@ -44,7 +46,13 @@ namespace Catch { SourceLineInfo const& lineInfo, StringRef capturedExpression, ResultDisposition::Flags resultDisposition ); - ~AssertionHandler(); + ~AssertionHandler() + { + if ( m_inExceptionGuard ) { + handle( ResultWas::ThrewException, "Exception translation was disabled by CATCH_CONFIG_FAST_COMPILE" ); + getCurrentContext().getResultCapture()->exceptionEarlyReported(); + } + } void handle( ITransientExpression const& expr ); diff --git a/include/internal/catch_context.cpp b/include/internal/catch_context.cpp index 0341a6f1..3f1f196f 100644 --- a/include/internal/catch_context.cpp +++ b/include/internal/catch_context.cpp @@ -20,7 +20,7 @@ namespace Catch { return m_runner; } - virtual IConfigPtr getConfig() const override { + virtual IConfigPtr const & getConfig() const override { return m_config; } diff --git a/include/internal/catch_context.h b/include/internal/catch_context.h index eb8611cc..5f9e2d8e 100644 --- a/include/internal/catch_context.h +++ b/include/internal/catch_context.h @@ -25,7 +25,7 @@ namespace Catch { virtual IResultCapture* getResultCapture() = 0; virtual IRunner* getRunner() = 0; - virtual IConfigPtr getConfig() const = 0; + virtual IConfigPtr const & getConfig() const = 0; }; struct IMutableContext : IContext