Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Integrated new AssertionHandler into unexpected exception handling in RunContext

Commit
7df290dfc1a064d087f5252bc1aac5e832a16d7e
Author
Phil Nash ·
Parents
201028d6ec78

Files · Download .tar.gz

Changes

 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;