MCPcopy Create free account
hub / github.com/apache/qpid-proton / handleFatalErrorCondition

Method handleFatalErrorCondition

tests/include/catch.hpp:12921–12957  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

12919 }
12920
12921 void RunContext::handleFatalErrorCondition( StringRef message ) {
12922 // First notify reporter that bad things happened
12923 m_reporter->fatalErrorEncountered(message);
12924
12925 // Don't rebuild the result -- the stringification itself can cause more fatal errors
12926 // Instead, fake a result data.
12927 AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
12928 tempResult.message = static_cast<std::string>(message);
12929 AssertionResult result(m_lastAssertionInfo, tempResult);
12930
12931 assertionEnded(result);
12932
12933 handleUnfinishedSections();
12934
12935 // Recreate section for test case (as we will lose the one that was in scope)
12936 auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
12937 SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
12938
12939 Counts assertions;
12940 assertions.failed = 1;
12941 SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
12942 m_reporter->sectionEnded(testCaseSectionStats);
12943
12944 auto const& testInfo = m_activeTestCase->getTestCaseInfo();
12945
12946 Totals deltaTotals;
12947 deltaTotals.testCases.failed = 1;
12948 deltaTotals.assertions.failed = 1;
12949 m_reporter->testCaseEnded(TestCaseStats(testInfo,
12950 deltaTotals,
12951 std::string(),
12952 std::string(),
12953 false));
12954 m_totals.testCases.failed++;
12955 testGroupEnded(std::string(), m_totals, 1, 1);
12956 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
12957 }
12958
12959 bool RunContext::lastAssertionPassed() {
12960 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