Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Fmt and tag fixup for #876

Github wouldn't let me push to the PR, probably because it was made from
fork of a fork...
Commit
cdd83c2e158d0e7d41900d88da14c53429d2c9d8
Author
Martin Hořeňovský ·
Parents
9a07dde16dc8

Files · Download .tar.gz

Changes

 include/internal/catch_message.hpp   |  3 +--
 projects/SelfTest/ExceptionTests.cpp | 10 +++++-----
 2 files changed, 6 insertions(+), 7 deletions(-)

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
+}