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.
This commit is contained in:
Martin Hořeňovský 2025-07-16 16:53:02 +02:00
parent efcb76874e
commit 9be81c0e05
No known key found for this signature in database
GPG Key ID: DE48307B8B0D381A

View File

@ -615,7 +615,6 @@ namespace Catch {
populateReaction( populateReaction(
reaction, info.resultDisposition & ResultDisposition::Normal ); reaction, info.resultDisposition & ResultDisposition::Normal );
} }
resetAssertionInfo();
} }
void RunContext::reportExpr( void RunContext::reportExpr(
AssertionInfo const &info, AssertionInfo const &info,
@ -623,13 +622,14 @@ namespace Catch {
ITransientExpression const *expr, ITransientExpression const *expr,
bool negated ) { bool negated ) {
m_lastAssertionInfo = info; m_lastAssertionInfo.lineInfo = info.lineInfo;
AssertionResultData data( resultType, LazyExpression( negated ) ); AssertionResultData data( resultType, LazyExpression( negated ) );
AssertionResult assertionResult{ info, CATCH_MOVE( data ) }; AssertionResult assertionResult{ info, CATCH_MOVE( data ) };
assertionResult.m_resultData.lazyExpression.m_transientExpression = expr; assertionResult.m_resultData.lazyExpression.m_transientExpression = expr;
assertionEnded( CATCH_MOVE(assertionResult) ); assertionEnded( CATCH_MOVE(assertionResult) );
resetAssertionInfo();
} }
void RunContext::handleMessage( void RunContext::handleMessage(