From 7df290dfc1a064d087f5252bc1aac5e832a16d7e Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Wed, 9 Aug 2017 08:49:59 +0100 Subject: [PATCH] Integrated new AssertionHandler into unexpected exception handling in RunContext --- include/internal/catch_run_context.cpp | 13 +++++-------- include/internal/catch_run_context.hpp | 2 -- 2 files changed, 5 insertions(+), 10 deletions(-) diff --git a/include/internal/catch_run_context.cpp b/include/internal/catch_run_context.cpp index 509a18e6..b0479797 100644 --- a/include/internal/catch_run_context.cpp +++ b/include/internal/catch_run_context.cpp @@ -270,7 +270,11 @@ namespace Catch { // Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions // are reported without translation at the point of origin. if (m_shouldReportUnexpected) { - makeUnexpectedResultBuilder().useActiveException(); + AssertionHandler + ( m_lastAssertionInfo.macroName, + m_lastAssertionInfo.lineInfo, + m_lastAssertionInfo.capturedExpression, + m_lastAssertionInfo.resultDisposition ).useActiveException(); } } m_testCaseTracker->close(); @@ -296,13 +300,6 @@ namespace Catch { fatalConditionHandler.reset(); } - ResultBuilder RunContext::makeUnexpectedResultBuilder() const { - return ResultBuilder(m_lastAssertionInfo.macroName, - m_lastAssertionInfo.lineInfo, - m_lastAssertionInfo.capturedExpression, - m_lastAssertionInfo.resultDisposition); - } - void RunContext::handleUnfinishedSections() { // If sections ended prematurely due to an exception we stored their // infos here so we can tear them down outside the unwind process. diff --git a/include/internal/catch_run_context.hpp b/include/internal/catch_run_context.hpp index 9e9f8974..a356e3bf 100644 --- a/include/internal/catch_run_context.hpp +++ b/include/internal/catch_run_context.hpp @@ -103,8 +103,6 @@ namespace Catch { private: - ResultBuilder makeUnexpectedResultBuilder() const; - void handleUnfinishedSections(); TestRunInfo m_runInfo;