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

Small fixes and tweaks

Commit
fe1d7c1d08f06c0a83b727e9b2e00cc49e74175d
Author
Phil Nash ·
Parents
355b5e546d2f

Files · Download .tar.gz

Changes

 include/internal/catch_capture.hpp                  | 2 +-
 include/internal/catch_expressionresult_builder.hpp | 2 +-
 include/reporters/catch_reporter_basic.hpp          | 4 ++--
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/include/internal/catch_capture.hpp b/include/internal/catch_capture.hpp
index 43452dd7..7d15b908 100644
--- a/include/internal/catch_capture.hpp
+++ b/include/internal/catch_capture.hpp
@@ -91,7 +91,7 @@ inline bool isTrue( bool value ){ return value; }
 
 ///////////////////////////////////////////////////////////////////////////////
 #define INTERNAL_CATCH_ACCEPT_INFO( expr, macroName, shouldNegate ) \
-    Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, #expr, shouldNegate ) );
+    Catch::getResultCapture().acceptAssertionInfo( Catch::AssertionInfo( macroName, CATCH_INTERNAL_LINEINFO, expr, shouldNegate ) );
 
 ///////////////////////////////////////////////////////////////////////////////
 #define INTERNAL_CATCH_TEST( expr, shouldNegate, stopOnFailure, macroName ) \
diff --git a/include/internal/catch_expressionresult_builder.hpp b/include/internal/catch_expressionresult_builder.hpp
index 69471289..0c0a28a8 100644
--- a/include/internal/catch_expressionresult_builder.hpp
+++ b/include/internal/catch_expressionresult_builder.hpp
@@ -26,7 +26,7 @@ namespace Catch {
     ExpressionResultBuilder& ExpressionResultBuilder::operator=(const ExpressionResultBuilder& other ) {
         m_data = other.m_data;
         m_exprComponents = other.m_exprComponents;
-        m_stream.clear();
+        m_stream.str("");
         m_stream << other.m_stream.str();
         return *this;
     }
diff --git a/include/reporters/catch_reporter_basic.hpp b/include/reporters/catch_reporter_basic.hpp
index a8585e3f..d560569a 100644
--- a/include/reporters/catch_reporter_basic.hpp
+++ b/include/reporters/catch_reporter_basic.hpp
@@ -206,7 +206,7 @@ namespace Catch {
                     streamVariableLengthText( "info", assertionResult.getMessage() );
                     break;
                 case ResultWas::Warning:
-                    m_config.stream << "warning:\n'" << assertionResult.getMessage() << "'";
+                    streamVariableLengthText( "warning", assertionResult.getMessage() );
                     break;
                 case ResultWas::ExplicitFailure:
                 {
@@ -309,7 +309,7 @@ namespace Catch {
         void streamVariableLengthText( const std::string& prefix, const std::string& text ) {
             std::string trimmed = trim( text );
             if( trimmed.find_first_of( "\r\n" ) == std::string::npos ) {
-                m_config.stream << "[" << prefix << ": " << trimmed << "]\n";
+                m_config.stream << "[" << prefix << ": " << trimmed << "]";
             }
             else {
                 m_config.stream << "\n[" << prefix << "] >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\n" << trimmed