MCPcopy Create free account
hub / github.com/InteractiveComputerGraphics/TriangleMeshDistance / handleFatalErrorCondition

Method handleFatalErrorCondition

tests/catch.hpp:10258–10294  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

10256 }
10257
10258 void RunContext::handleFatalErrorCondition( StringRef message ) {
10259 // First notify reporter that bad things happened
10260 m_reporter->fatalErrorEncountered(message);
10261
10262 // Don't rebuild the result -- the stringification itself can cause more fatal errors
10263 // Instead, fake a result data.
10264 AssertionResultData tempResult( ResultWas::FatalErrorCondition, { false } );
10265 tempResult.message = message;
10266 AssertionResult result(m_lastAssertionInfo, tempResult);
10267
10268 assertionEnded(result);
10269
10270 handleUnfinishedSections();
10271
10272 // Recreate section for test case (as we will lose the one that was in scope)
10273 auto const& testCaseInfo = m_activeTestCase->getTestCaseInfo();
10274 SectionInfo testCaseSection(testCaseInfo.lineInfo, testCaseInfo.name);
10275
10276 Counts assertions;
10277 assertions.failed = 1;
10278 SectionStats testCaseSectionStats(testCaseSection, assertions, 0, false);
10279 m_reporter->sectionEnded(testCaseSectionStats);
10280
10281 auto const& testInfo = m_activeTestCase->getTestCaseInfo();
10282
10283 Totals deltaTotals;
10284 deltaTotals.testCases.failed = 1;
10285 deltaTotals.assertions.failed = 1;
10286 m_reporter->testCaseEnded(TestCaseStats(testInfo,
10287 deltaTotals,
10288 std::string(),
10289 std::string(),
10290 false));
10291 m_totals.testCases.failed++;
10292 testGroupEnded(std::string(), m_totals, 1, 1);
10293 m_reporter->testRunEnded(TestRunStats(m_runInfo, m_totals, false));
10294 }
10295
10296 bool RunContext::lastAssertionPassed() {
10297 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