MCPcopy Create free account
hub / github.com/CodingGay/BlackDex / handleFatalErrorCondition

Method handleFatalErrorCondition

Bcore/src/main/cpp/Dobby/tests/catch.hpp:8687–8719  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

8685}
8686
8687void RunContext::handleFatalErrorCondition(StringRef message) {
8688 // First notify reporter that bad things happened
8689 m_reporter->fatalErrorEncountered(message);
8690
8691 // Don't rebuild the result -- the stringification itself can cause more fatal errors
8692 // Instead, fake a result data.
8693 AssertionResultData tempResult(ResultWas::FatalErrorCondition, {false});
8694 tempResult.message = message;
8695 AssertionResult result(m_lastAssertionInfo, tempResult);
8696
8697 assertionEnded(result);
8698
8699 handleUnfinishedSections();
8700
8701 // Recreate section for test case (as we will lose the one that was in scope)
8702 auto const &testCaseInfo = m_activeTestCase->getTestCaseInfo();
8703 SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name, testCaseInfo.description);
8704
8705 Counts assertions;
8706 assertions.failed = 1;
8707 SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
8708 m_reporter->sectionEnded(testCaseSectionStats);
8709
8710 auto const &testInfo = m_activeTestCase->getTestCaseInfo();
8711
8712 Totals deltaTotals;
8713 deltaTotals.testCases.failed = 1;
8714 deltaTotals.assertions.failed = 1;
8715 m_reporter->testCaseEnded(TestCaseStats(testInfo, deltaTotals, std::string(), std::string(), false));
8716 m_totals.testCases.failed++;
8717 testGroupEnded(std::string(), m_totals, 1, 1);
8718 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
8719}
8720
8721bool RunContext::lastAssertionPassed() {
8722 return m_lastAssertionPassed;

Callers 1

reportFatalFunction · 0.80

Calls 6

TestCaseStatsClass · 0.85
TestRunStatsClass · 0.85
fatalErrorEncounteredMethod · 0.80
sectionEndedMethod · 0.45
testCaseEndedMethod · 0.45
testRunEndedMethod · 0.45

Tested by

no test coverage detected