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