mirror of
https://github.com/catchorg/Catch2.git
synced 2025-08-01 21:05: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:
17
tests/SelfTest/IntrospectiveTests/AssertionHandler.tests.cpp
Normal file
17
tests/SelfTest/IntrospectiveTests/AssertionHandler.tests.cpp
Normal file
@@ -0,0 +1,17 @@
|
||||
|
||||
// Copyright Catch2 Authors
|
||||
// Distributed under the Boost Software License, Version 1.0.
|
||||
// (See accompanying file LICENSE.txt or copy at
|
||||
// https://www.boost.org/LICENSE_1_0.txt)
|
||||
|
||||
// SPDX-License-Identifier: BSL-1.0
|
||||
|
||||
#include <catch2/catch_test_macros.hpp>
|
||||
|
||||
TEST_CASE( "Incomplete AssertionHandler", "[assertion-handler][!shouldfail]" ) {
|
||||
Catch::AssertionHandler catchAssertionHandler(
|
||||
"REQUIRE"_catch_sr,
|
||||
CATCH_INTERNAL_LINEINFO,
|
||||
"Dummy",
|
||||
Catch::ResultDisposition::Normal );
|
||||
}
|
Reference in New Issue
Block a user