| 8581 | } |
| 8582 | |
| 8583 | void RunContext::assertionEnded(AssertionResult const &result) { |
| 8584 | if (result.getResultType() == ResultWas::Ok) { |
| 8585 | m_totals.assertions.passed++; |
| 8586 | m_lastAssertionPassed = true; |
| 8587 | } else if (!result.isOk()) { |
| 8588 | m_lastAssertionPassed = false; |
| 8589 | if (m_activeTestCase->getTestCaseInfo().okToFail()) |
| 8590 | m_totals.assertions.failedButOk++; |
| 8591 | else |
| 8592 | m_totals.assertions.failed++; |
| 8593 | } else { |
| 8594 | m_lastAssertionPassed = true; |
| 8595 | } |
| 8596 | |
| 8597 | // We have no use for the return value (whether messages should be cleared), because messages were made scoped |
| 8598 | // and should be let to clear themselves out. |
| 8599 | static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); |
| 8600 | |
| 8601 | // Reset working state |
| 8602 | resetAssertionInfo(); |
| 8603 | m_lastResult = result; |
| 8604 | } |
| 8605 | void RunContext::resetAssertionInfo() { |
| 8606 | m_lastAssertionInfo.macroName = StringRef(); |
| 8607 | m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr; |
nothing calls this directly
no test coverage detected