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

string reporting is more consistent

Commit
7a4b215dd30c1d468e06c7391297d99b137e6ca9
Author
Phil Nash ·
Parents
f5f130c0702e

Files · Download .tar.gz

Changes

 Test/TrickyTests.cpp       | 44 --------------------------------------------
 internal/catch_capture.hpp |  7 ++++---
 2 files changed, 4 insertions(+), 47 deletions(-)

diff --git a/Test/TrickyTests.cpp b/Test/TrickyTests.cpp
index 2f58e5de..6a2f69bc 100644
--- a/Test/TrickyTests.cpp
+++ b/Test/TrickyTests.cpp
@@ -120,47 +120,3 @@ TEST_CASE
     REQUIRE( i++ == 8 );
     
 }
-
-template<typename T1, typename T2>
-void comp( T1 v1, T2 v2 )
-{
-
-}
-
-
-
-///////////////////////////////////////////////////////////////////////////////
-TEST_CASE
-(   
-    "investigation/neg comp", 
-    "from Malcolm Noyes" 
-)
-{
-    int negative_value = std::numeric_limits<int>::min();
-
-    bool ok = (negative_value == 2147483648);    // VC doesn't warn, gcc does
-    REQUIRE(ok);
-    CHECK(negative_value == 2147483648);    // doesn't warn, fails
-    
-    
-    {
-    enum Bits {bit0 = 0x0001, bit1 = 0x0002, bit2 = 0x0004, bit3 = 0x0008, bit1and2 = 0x0006,
-        bit30 = 0x40000000, bit31 = 0x80000000,
-        bit30and31 = 0xc0000000};
-
-    ok = (0xc0000000 == (bit30 | bit31));    // doesn't warn
-    REQUIRE(ok);
-    CHECK(0xc0000000 == (bit30 | bit31));     
-    }
-    {
-        enum Bits2 {bit0 = 0x0001, bit1 = 0x0002, bit2 = 0x0004, bit3 = 0x0008, bit1and2 = 0x0006,
-            bit30 = 0x40000000, bit31 = 0x80000000,
-            bit30and31 = 0xc0000000};
-        
-        Bits2 b = bit0;
-        ok = (b == bit0);
-        REQUIRE(ok);
-        comp( 0x0001, bit0 | bit0 );
-//        REQUIRE(b == bit0);    // gcc 4.4 doesn't compile this    
-    }
-}
diff --git a/internal/catch_capture.hpp b/internal/catch_capture.hpp
index 724b5bba..c0aa02ac 100644
--- a/internal/catch_capture.hpp
+++ b/internal/catch_capture.hpp
@@ -104,16 +104,17 @@ inline std::string toString
     const std::string& value
 )
 {
-    return value;
+    return "\"" + value + "\"";
 }
+
 ///////////////////////////////////////////////////////////////////////////////
 inline std::string toString
 (
     const char* const value
 )
 {
-    return value ? "'" + std::string( value ) + "'" : std::string( "{null string}" );
-}    
+    return value ? toString( std::string( value ) ) : std::string( "{null string}" );
+}   
 
 ///////////////////////////////////////////////////////////////////////////////
 inline std::string toString