diff --git a/include/internal/catch_message.hpp b/include/internal/catch_message.hpp index 1b72afec..11d07466 100644 --- a/include/internal/catch_message.hpp +++ b/include/internal/catch_message.hpp @@ -38,8 +38,7 @@ namespace Catch { {} ScopedMessage::~ScopedMessage() { - if (!std::uncaught_exception()) - { + if ( !std::uncaught_exception() ){ getResultCapture().popScopedMessage(m_info); } } diff --git a/projects/SelfTest/ExceptionTests.cpp b/projects/SelfTest/ExceptionTests.cpp index 0f363da4..8ba5cb54 100644 --- a/projects/SelfTest/ExceptionTests.cpp +++ b/projects/SelfTest/ExceptionTests.cpp @@ -210,17 +210,17 @@ TEST_CASE( "Mismatching exception messages failing the test", "[.][failing][!thr REQUIRE_THROWS_WITH( thisThrows(), "expected exception" ); } -TEST_CASE( "#748 - captures with unexpected exceptions", "[!shouldfail]" ) { +TEST_CASE( "#748 - captures with unexpected exceptions", "[!shouldfail][!throws]" ) { int answer = 42; - CAPTURE(answer); + CAPTURE( answer ); // the message should be printed on the first two sections but not on the third SECTION( "outside assertions" ) { thisThrows(); } SECTION( "inside REQUIRE_NOTHROW" ) { - REQUIRE_NOTHROW(thisThrows()); + REQUIRE_NOTHROW( thisThrows() ); } SECTION( "inside REQUIRE_THROWS" ) { - REQUIRE_THROWS(thisThrows()); + REQUIRE_THROWS( thisThrows() ); } -} \ No newline at end of file +}