| 10143 | } |
| 10144 | |
| 10145 | void RunContext::assertionEnded(AssertionResult const & result) { |
| 10146 | if (result.getResultType() == ResultWas::Ok) { |
| 10147 | m_totals.assertions.passed++; |
| 10148 | m_lastAssertionPassed = true; |
| 10149 | } else if (!result.isOk()) { |
| 10150 | m_lastAssertionPassed = false; |
| 10151 | if( m_activeTestCase->getTestCaseInfo().okToFail() ) |
| 10152 | m_totals.assertions.failedButOk++; |
| 10153 | else |
| 10154 | m_totals.assertions.failed++; |
| 10155 | } |
| 10156 | else { |
| 10157 | m_lastAssertionPassed = true; |
| 10158 | } |
| 10159 | |
| 10160 | // We have no use for the return value (whether messages should be cleared), because messages were made scoped |
| 10161 | // and should be let to clear themselves out. |
| 10162 | static_cast<void>(m_reporter->assertionEnded(AssertionStats(result, m_messages, m_totals))); |
| 10163 | |
| 10164 | // Reset working state |
| 10165 | resetAssertionInfo(); |
| 10166 | m_lastResult = result; |
| 10167 | } |
| 10168 | void RunContext::resetAssertionInfo() { |
| 10169 | m_lastAssertionInfo.macroName = StringRef(); |
| 10170 | m_lastAssertionInfo.capturedExpression = "{Unknown expression after the reported line}"_sr; |
nothing calls this directly
no test coverage detected