mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-03 13:55:39 +02:00
Fix bad error reporting for nested exceptions in default configuration
Bad handling of `TestFailureException` when translating unexpected exceptions inside assertion macros led to the unexpected exceptions handling erroring out through throwing the same exception again. This was then backstopped by the machinery for handling uncaught exceptions from assertions, which is normally used by the `CATCH_CONFIG_FAST_COMPILE` machinery, where we assume that it can only be invoked because the assertion macros are not configured to catch assertions. Closes #1292
This commit is contained in:
@@ -3,6 +3,49 @@
|
||||
<testExecutions version="1"loose text artifact
|
||||
>
|
||||
<file path="tests/<exe-name>/IntrospectiveTests/AssertionHandler.tests.cpp">
|
||||
<testCase name="Assertions can be nested - CHECK" duration="{duration}">
|
||||
<skipped message="REQUIRE(i > 10)">
|
||||
FAILED:
|
||||
REQUIRE( i > 10 )
|
||||
with expansion:
|
||||
2 > 10
|
||||
at AssertionHandler.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<skipped message="CHECK(foo( 2 ) == 2)">
|
||||
FAILED:
|
||||
CHECK( foo( 2 ) == 2 )
|
||||
{ nested assertion failed }
|
||||
at AssertionHandler.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testCase>
|
||||
<testCase name="Assertions can be nested - REQUIRE" duration="{duration}">
|
||||
<skipped message="REQUIRE(i > 10)">
|
||||
FAILED:
|
||||
REQUIRE( i > 10 )
|
||||
with expansion:
|
||||
2 > 10
|
||||
at AssertionHandler.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<skipped message="REQUIRE(foo( 2 ) == 2)">
|
||||
FAILED:
|
||||
REQUIRE( foo( 2 ) == 2 )
|
||||
{ nested assertion failed }
|
||||
at AssertionHandler.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testCase>
|
||||
<testCase name="FAIL can be nested in assertion" duration="{duration}">
|
||||
<skipped message="FAIL()">
|
||||
FAILED:
|
||||
Throw a Catch::TestFailureException
|
||||
at AssertionHandler.tests.cpp:<line number>
|
||||
</skipped>
|
||||
<skipped message="CHECK_NOTHROW(do_fail())">
|
||||
FAILED:
|
||||
CHECK_NOTHROW( do_fail() )
|
||||
{ nested assertion failed }
|
||||
at AssertionHandler.tests.cpp:<line number>
|
||||
</skipped>
|
||||
</testCase>
|
||||
<testCase name="Incomplete AssertionHandler" duration="{duration}">
|
||||
<skipped message="REQUIRE(Dummy)">
|
||||
FAILED:
|
||||
|
Reference in New Issue
Block a user