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

Test for FAIL that doesn’t take an argument

Commit
b4625208d01f881258e4090e465e44eb85fda9b6
Author
Phil Nash ·
Parents
274ed3ea7623

Files · Download .tar.gz

Changes

 include/internal/catch_capture.hpp | 2 +-
 projects/SelfTest/MessageTests.cpp | 8 ++++++++
 2 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index 3b2cfdf7..5055cddf 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -159,7 +159,7 @@ struct TestFailureException{};
     #define INTERNAL_CATCH_MSG( messageType, resultDisposition, macroName, log ) \
         do { \
             INTERNAL_CATCH_ACCEPT_INFO( "", macroName, resultDisposition ); \
-            INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log +::Catch::StreamEndStop(), resultDisposition, true ) \
+            INTERNAL_CATCH_ACCEPT_EXPR( Catch::ExpressionResultBuilder( messageType ) << log, resultDisposition, true ) \
         } while( Catch::isTrue( false ) )
 #endif
 
diff --git a/projects/SelfTest/MessageTests.cpp b/projects/SelfTest/MessageTests.cpp
index e0c44848..55098b2c 100644
--- a/projects/SelfTest/MessageTests.cpp
+++ b/projects/SelfTest/MessageTests.cpp
@@ -51,6 +51,14 @@ TEST_CASE( "FAIL aborts the test", "[failing][messages][.]" )
         FAIL( "This is a " << "failure" );    // This should output the message and abort
 }
 
+#ifdef CATCH_CONFIG_VARIADIC_MACROS
+TEST_CASE( "FAIL does not require an argument", "[failing][messages][.]" )
+{
+	if( Catch::isTrue( true ) )
+        FAIL();
+}
+#endif
+
 TEST_CASE( "Output from all sections is reported", "[failing][messages][.]" )
 {
     SECTION( "one", "" )