| 12789 | } |
| 12790 | |
| 12791 | void RunContext::assertionEnded(AssertionResult const & result) { |
| 12792 | if (result.getResultType() == ResultWas::Ok) { |
| 12793 | m_totals.assertions.passed++; |
| 12794 | m_lastAssertionPassed = true; |
| 12795 | } else if (!result.isOk()) { |
| 12796 | m_lastAssertionPassed = false; |
| 12797 | if( m_activeTestCase->getTestCaseInfo().okToFail() ) |
| 12798 | m_totals.assertions.failedButOk++; |
| 12799 | else |
| 12800 | m_totals.assertions.failed++; |
| 12801 | } |
| 12802 | else { |
| 12803 | m_lastAssertionPassed = true; |
| 12804 | } |
| 12805 | |
| 12806 | // We have no use for the return value (whether messages should be cleared), because messages were made scoped |
| 12807 | // and should be let to clear themselves out. |
| 12808 | static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); |
| 12809 | |
| 12810 | if (result.getResultType() != ResultWas::Warning) |
| 12811 | m_messageScopes.clear(); |
| 12812 | |
| 12813 | // Reset working state |
| 12814 | resetAssertionInfo(); |
| 12815 | m_lastResult = result; |
| 12816 | } |
| 12817 | void RunContext::resetAssertionInfo() { |
| 12818 | m_lastAssertionInfo.macroName = StringRef(); |
| 12819 | m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr; |
nothing calls this directly
no test coverage detected