MCPcopy Create free account
hub / github.com/ChaiScript/ChaiScript / assertionEnded

Method assertionEnded

unittests/catch.hpp:8625–8647  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8623 }
8624
8625 void RunContext::assertionEnded(AssertionResult const & result) {
8626 if (result.getResultType() == ResultWas::Ok) {
8627 m_totals.assertions.passed++;
8628 m_lastAssertionPassed = true;
8629 } else if (!result.isOk()) {
8630 m_lastAssertionPassed = false;
8631 if( m_activeTestCase->getTestCaseInfo().okToFail() )
8632 m_totals.assertions.failedButOk++;
8633 else
8634 m_totals.assertions.failed++;
8635 }
8636 else {
8637 m_lastAssertionPassed = true;
8638 }
8639
8640 // We have no use for the return value (whether messages should be cleared), because messages were made scoped
8641 // and should be let to clear themselves out.
8642 static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals)));
8643
8644 // Reset working state
8645 resetAssertionInfo();
8646 m_lastResult = result;
8647 }
8648 void RunContext::resetAssertionInfo() {
8649 m_lastAssertionInfo.macroName = StringRef();
8650 m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr;

Callers

nothing calls this directly

Calls 14

AssertionStatsClass · 0.85
getResultTypeMethod · 0.80
isOkMethod · 0.80
okToFailMethod · 0.80
scopedElementMethod · 0.80
hasExpressionMethod · 0.80
succeededMethod · 0.80
getTestMacroNameMethod · 0.80
getSourceInfoMethod · 0.80
getExpressionMethod · 0.80
getExpandedExpressionMethod · 0.80

Tested by

no test coverage detected