mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-02 05:15:39 +02:00
Assert Info reset need to also reset result disposition to normal to handle uncaught exception correctly (#2723)
* AssertionEnd does not reset the assertion info yet. That is done after populateReaction. And reset assertion info would also reset the result disposition to normal, so that any uncaught exception would be reported as failure * Approving test output changes due to added unit tests * Unit tests to throw std::runtime_error instead of std::exception * Add a unit test to test incomplete assertion handler --------- Co-authored-by: Ross <ross.tang@gfo-x.com>
This commit is contained in:
@@ -217,6 +217,18 @@ TEST_CASE("Testing checked-if 3", "[checked-if][!shouldfail]") {
|
||||
SUCCEED();
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
TEST_CASE("Testing checked-if 4", "[checked-if][!shouldfail]") {
|
||||
CHECKED_ELSE(true) {}
|
||||
throw std::runtime_error("Uncaught exception should fail!");
|
||||
}
|
||||
|
||||
[[noreturn]]
|
||||
TEST_CASE("Testing checked-if 5", "[checked-if][!shouldfail]") {
|
||||
CHECKED_ELSE(false) {}
|
||||
throw std::runtime_error("Uncaught exception should fail!");
|
||||
}
|
||||
|
||||
TEST_CASE( "xmlentitycheck" ) {
|
||||
SECTION( "embedded xml: <test>it should be possible to embed xml characters, such as <, \" or &, or even whole <xml>documents</xml> within an attribute</test>" ) {
|
||||
SUCCEED(); // We need this here to stop it failing due to no tests
|
||||
|
Reference in New Issue
Block a user