Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
path: root/src/catch2
diff options
context:
space:
mode:
authorMartin Hořeňovský2025-07-16 16:53:02 +0200
committerMartin Hořeňovský2025-07-16 21:58:42 +0200
commit9be81c0e05aedabbf1224ccb424ef0a628bcb9c8 (patch)
treece7edf2e9eb74608b57ea315e139c5bedc8b6433 /src/catch2
parentefcb76874e75c267e0b88163897d51996a9e0974 (diff)
downloadcatch3-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.
Diffstat (limited to 'src/catch2')
-rw-r--r--src/catch2/internal/catch_run_context.cpp4
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(