mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-04 05:09:53 +01:00
Integrated new AssertionHandler into unexpected exception handling in RunContext
This commit is contained in:
parent
201028d6ec
commit
7df290dfc1
@ -270,7 +270,11 @@ namespace Catch {
|
|||||||
// Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
|
// Under CATCH_CONFIG_FAST_COMPILE, unexpected exceptions under REQUIRE assertions
|
||||||
// are reported without translation at the point of origin.
|
// are reported without translation at the point of origin.
|
||||||
if (m_shouldReportUnexpected) {
|
if (m_shouldReportUnexpected) {
|
||||||
makeUnexpectedResultBuilder().useActiveException();
|
AssertionHandler
|
||||||
|
( m_lastAssertionInfo.macroName,
|
||||||
|
m_lastAssertionInfo.lineInfo,
|
||||||
|
m_lastAssertionInfo.capturedExpression,
|
||||||
|
m_lastAssertionInfo.resultDisposition ).useActiveException();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_testCaseTracker->close();
|
m_testCaseTracker->close();
|
||||||
@ -296,13 +300,6 @@ namespace Catch {
|
|||||||
fatalConditionHandler.reset();
|
fatalConditionHandler.reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
ResultBuilder RunContext::makeUnexpectedResultBuilder() const {
|
|
||||||
return ResultBuilder(m_lastAssertionInfo.macroName,
|
|
||||||
m_lastAssertionInfo.lineInfo,
|
|
||||||
m_lastAssertionInfo.capturedExpression,
|
|
||||||
m_lastAssertionInfo.resultDisposition);
|
|
||||||
}
|
|
||||||
|
|
||||||
void RunContext::handleUnfinishedSections() {
|
void RunContext::handleUnfinishedSections() {
|
||||||
// If sections ended prematurely due to an exception we stored their
|
// If sections ended prematurely due to an exception we stored their
|
||||||
// infos here so we can tear them down outside the unwind process.
|
// infos here so we can tear them down outside the unwind process.
|
||||||
|
@ -103,8 +103,6 @@ namespace Catch {
|
|||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
ResultBuilder makeUnexpectedResultBuilder() const;
|
|
||||||
|
|
||||||
void handleUnfinishedSections();
|
void handleUnfinishedSections();
|
||||||
|
|
||||||
TestRunInfo m_runInfo;
|
TestRunInfo m_runInfo;
|
||||||
|
Loading…
Reference in New Issue
Block a user