| 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; |
nothing calls this directly
no test coverage detected