diff options
| author | Martin Hořeňovský | 2025-07-16 16:53:02 +0200 |
|---|---|---|
| committer | Martin Hořeňovský | 2025-07-16 21:58:42 +0200 |
| commit | 9be81c0e05aedabbf1224ccb424ef0a628bcb9c8 (patch) | |
| tree | ce7edf2e9eb74608b57ea315e139c5bedc8b6433 | |
| parent | efcb76874e75c267e0b88163897d51996a9e0974 (diff) | |
| download | catch3-9be81c0e05aedabbf1224ccb424ef0a628bcb9c8.tar.gz | |
Move resetAssertionInfo into RunContext::reportExpr
Because `RunContext::populateReaction` no longer implicitly depends
on the value of `RunContext::m_lastAssertionInfo`, we don't have to
delay the reset until `RunContext::reportExpr` is finished.
| -rw-r--r-- | src/catch2/internal/catch_run_context.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/catch2/internal/catch_run_context.cpp b/src/catch2/internal/catch_run_context.cpp index 0beeedaa..a0866fd2 100644 --- a/src/catch2/internal/catch_run_context.cpp +++ b/src/catch2/internal/catch_run_context.cpp @@ -615,7 +615,6 @@ namespace Catch { populateReaction( reaction, info.resultDisposition & ResultDisposition::Normal ); } - resetAssertionInfo(); } void RunContext::reportExpr( AssertionInfo const &info, @@ -623,13 +622,14 @@ namespace Catch { ITransientExpression const *expr, bool negated ) { - m_lastAssertionInfo = info; + m_lastAssertionInfo.lineInfo = info.lineInfo; AssertionResultData data( resultType, LazyExpression( negated ) ); AssertionResult assertionResult{ info, CATCH_MOVE( data ) }; assertionResult.m_resultData.lazyExpression.m_transientExpression = expr; assertionEnded( CATCH_MOVE(assertionResult) ); + resetAssertionInfo(); } void RunContext::handleMessage( |