| 10401 | } |
| 10402 | |
| 10403 | void RunContext::assertionEnded(AssertionResult const & result) { |
| 10404 | if (result.getResultType() == ResultWas::Ok) { |
| 10405 | m_totals.assertions.passed++; |
| 10406 | m_lastAssertionPassed = true; |
| 10407 | } else if (!result.isOk()) { |
| 10408 | m_lastAssertionPassed = false; |
| 10409 | if( m_activeTestCase->getTestCaseInfo().okToFail() ) |
| 10410 | m_totals.assertions.failedButOk++; |
| 10411 | else |
| 10412 | m_totals.assertions.failed++; |
| 10413 | } |
| 10414 | else { |
| 10415 | m_lastAssertionPassed = true; |
| 10416 | } |
| 10417 | |
| 10418 | // We have no use for the return value (whether messages should be cleared), because messages were made scoped |
| 10419 | // and should be let to clear themselves out. |
| 10420 | static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); |
| 10421 | |
| 10422 | if (result.getResultType() != ResultWas::Warning) |
| 10423 | m_messageScopes.clear(); |
| 10424 | |
| 10425 | // Reset working state |
| 10426 | resetAssertionInfo(); |
| 10427 | m_lastResult = result; |
| 10428 | } |
| 10429 | void RunContext::resetAssertionInfo() { |
| 10430 | m_lastAssertionInfo.macroName = StringRef(); |
| 10431 | m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr; |
nothing calls this directly
no test coverage detected