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

build 24

Commit
be890d0c154099f83715e49f1ff331d097b56bde
Author
Phil Nash ·
Parents
e091018514bc

Files · Download .tar.gz

Changes

 README.md                          |  2 +-
 include/internal/catch_version.hpp |  2 +-
 single_include/catch.hpp           | 40 ++++++++++++++++++++++++++++++++------
 3 files changed, 36 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index dba8e0c2..42767531 100644
--- a/README.md
+++ b/README.md
@@ -1,6 +1,6 @@
 ![catch logo](catch-logo-small.png)
 
-*v1.0 build 23 (master branch)*
+*v1.0 build 24 (master branch)*
 
 Build status (on Travis CI) [![Build Status](https://travis-ci.org/philsquared/Catch.png)](https://travis-ci.org/philsquared/Catch)
 
diff --git a/include/internal/catch_version.hpp b/include/internal/catch_version.hpp
index f615b3ea..67390ce8 100644
--- a/include/internal/catch_version.hpp
+++ b/include/internal/catch_version.hpp
@@ -13,7 +13,7 @@
 namespace Catch {
 
     // These numbers are maintained by a script
-    Version libraryVersion( 1, 0, 23, "master" );
+    Version libraryVersion( 1, 0, 24, "master" );
 }
 
 #endif // TWOBLUECUBES_CATCH_VERSION_HPP_INCLUDED
diff --git a/single_include/catch.hpp b/single_include/catch.hpp
index 770b3537..031479b0 100644
--- a/single_include/catch.hpp
+++ b/single_include/catch.hpp
@@ -1,6 +1,6 @@
 /*
- *  CATCH v1.0 build 23 (master branch)
- *  Generated: 2013-12-23 10:22:45.547645
+ *  CATCH v1.0 build 24 (master branch)
+ *  Generated: 2014-01-07 17:26:42.421599
  *  ----------------------------------------------------------
  *  This file has been merged from multiple headers. Please don't edit it directly
  *  Copyright (c) 2012 Two Blue Cubes Ltd. All rights reserved.
@@ -681,6 +681,25 @@ namespace Detail {
         }
     };
 
+    // For display purposes only.
+    // Does not consider endian-ness
+    template<typename T>
+    std::string rawMemoryToString( T value ) {
+        union
+        {
+            T value;
+            unsigned char bytes[sizeof(T)];
+        } valueAsBuffer;
+
+        valueAsBuffer.value = value;
+
+        std::ostringstream oss;
+        oss << "0x";
+        for( unsigned char* cp = valueAsBuffer.bytes; cp < valueAsBuffer.bytes+sizeof(T); ++cp )
+            oss << std::hex << std::setw(2) << std::setfill('0') << (unsigned int)*cp;
+        return oss.str();
+    }
+
 } // end namespace Detail
 
 template<typename T>
@@ -696,9 +715,18 @@ struct StringMaker<T*> {
     static std::string convert( U* p ) {
         if( !p )
             return INTERNAL_CATCH_STRINGIFY( NULL );
-        std::ostringstream oss;
-        oss << p;
-        return oss.str();
+        else
+            return Detail::rawMemoryToString( p );
+    }
+};
+
+template<typename R, typename C>
+struct StringMaker<R C::*> {
+    static std::string convert( R C::* p ) {
+        if( !p )
+            return INTERNAL_CATCH_STRINGIFY( NULL );
+        else
+            return Detail::rawMemoryToString( p );
     }
 };
 
@@ -6179,7 +6207,7 @@ namespace Catch {
 namespace Catch {
 
     // These numbers are maintained by a script
-    Version libraryVersion( 1, 0, 23, "master" );
+    Version libraryVersion( 1, 0, 24, "master" );
 }
 
 // #included from: catch_text.hpp