From cdd83c2e158d0e7d41900d88da14c53429d2c9d8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Ho=C5=99e=C5=88ovsk=C3=BD?= Date: Tue, 4 Apr 2017 11:31:13 +0200 Subject: [PATCH] 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... --- 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 +}