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
Update last seen line info in the assertionEnded fast path
- Commit
55b14e1b3482e1233f0fbf41dee8dceebee8db1e- Author
- Martin Hořeňovský ·
- Parents
ce128f584c29
Changes
src/catch2/internal/catch_run_context.cpp | 6 ++++-- src/catch2/internal/catch_run_context.hpp | 2 +- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index df40d445..02fa3eb8 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -515,7 +515,8 @@ namespace Catch { return m_lastAssertionPassed; } - void RunContext::assertionPassed() { + void RunContext::assertionPassedFastPath(SourceLineInfo lineInfo) { + m_lastKnownLineInfo = lineInfo; m_lastAssertionPassed = true; ++m_totals.assertions.passed; m_messageScopes.clear(); @@ -603,7 +604,8 @@ namespace Catch { if( result ) { if (!m_includeSuccessfulResults) { - assertionPassed(); + // Fast path if neither user nor reporter asked for passing assertions + assertionPassedFastPath(info.lineInfo); } else { reportExpr(info, ResultWas::Ok, &expr, negated); diff --git a/src/catch2/internal/catch_run_context.hpp b/src/catch2/internal/catch_run_context.hpp index 9626e448..6e9f21f7 100644 --- a/src/catch2/internal/catch_run_context.hpp +++ b/src/catch2/internal/catch_run_context.hpp @@ -108,7 +108,7 @@ namespace Catch { bool lastAssertionPassed() override; - void assertionPassed(); + void assertionPassedFastPath(SourceLineInfo lineInfo); public: // !TBD We need to do this another way!