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

Remove C++98 backcompat from toString

Commit
c6980ec2d852e3a5163b2bcb1a5a6b24c87b69ea
Author
Martin Hořeňovský ·
Parents
7c900660ef4c

Files · Download .tar.gz

Changes

 include/internal/catch_tostring.h   | 41 +++----------------------------------
 include/internal/catch_tostring.hpp |  4 ----
 2 files changed, 3 insertions(+), 42 deletions(-)

diff --git a/include/internal/catch_tostring.h b/include/internal/catch_tostring.h
index 21ab99a0..f72eeca3 100644
--- a/include/internal/catch_tostring.h
+++ b/include/internal/catch_tostring.h
@@ -20,13 +20,9 @@
 #include "catch_objc_arc.hpp"
 #endif
 
-#ifdef CATCH_CONFIG_CPP11_TUPLE
 #include <tuple>
-#endif
 
-#ifdef CATCH_CONFIG_CPP11_IS_ENUM
 #include <type_traits>
-#endif
 
 namespace Catch {
 
@@ -52,14 +48,10 @@ std::string toString( char value );
 std::string toString( signed char value );
 std::string toString( unsigned char value );
 
-#ifdef CATCH_CONFIG_CPP11_LONG_LONG
 std::string toString( long long value );
 std::string toString( unsigned long long value );
-#endif
 
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
 std::string toString( std::nullptr_t );
-#endif
 
 #ifdef __OBJC__
     std::string toString( NSString const * const& nsstring );
@@ -72,26 +64,6 @@ namespace Detail {
 
     extern const std::string unprintableString;
 
- #if !defined(CATCH_CONFIG_CPP11_STREAM_INSERTABLE_CHECK)
-    struct BorgType {
-        template<typename T> BorgType( T const& );
-    };
-
-    struct TrueType { char sizer[1]; };
-    struct FalseType { char sizer[2]; };
-
-    TrueType& testStreamable( std::ostream& );
-    FalseType testStreamable( FalseType );
-
-    FalseType operator<<( std::ostream const&, BorgType const& );
-
-    template<typename T>
-    struct IsStreamInsertable {
-        static std::ostream &s;
-        static T  const&t;
-        enum { value = sizeof( testStreamable(s << t) ) == sizeof( TrueType ) };
-    };
-#else
     template<typename T>
     class IsStreamInsertable {
         template<typename SS, typename TT>
@@ -104,9 +76,8 @@ namespace Detail {
     public:
         static const bool value = decltype(test<std::ostream,const T&>(0))::value;
     };
-#endif
 
-#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
+
     template<typename T,
              bool IsEnum = std::is_enum<T>::value
              >
@@ -125,19 +96,14 @@ namespace Detail {
                 );
         }
     };
-#endif
+
     template<bool C>
     struct StringMakerBase {
-#if defined(CATCH_CONFIG_CPP11_IS_ENUM)
         template<typename T>
         static std::string convert( T const& v )
         {
             return EnumStringMaker<T>::convert( v );
         }
-#else
-        template<typename T>
-        static std::string convert( T const& ) { return unprintableString; }
-#endif
     };
 
     template<>
@@ -202,7 +168,6 @@ std::string toString( std::vector<T,Allocator> const& v ) {
 }
 
 
-#ifdef CATCH_CONFIG_CPP11_TUPLE
 
 // toString for tuples
 namespace TupleDetail {
@@ -242,7 +207,7 @@ struct StringMaker<std::tuple<Types...>> {
         return os.str();
     }
 };
-#endif // CATCH_CONFIG_CPP11_TUPLE
+
 
 namespace Detail {
     template<typename T>
diff --git a/include/internal/catch_tostring.hpp b/include/internal/catch_tostring.hpp
index e61191b9..f20c41a2 100644
--- a/include/internal/catch_tostring.hpp
+++ b/include/internal/catch_tostring.hpp
@@ -169,7 +169,6 @@ std::string toString( unsigned char value ) {
     return toString( static_cast<char>( value ) );
 }
 
-#ifdef CATCH_CONFIG_CPP11_LONG_LONG
 std::string toString( long long value ) {
     std::ostringstream oss;
     oss << value;
@@ -184,13 +183,10 @@ std::string toString( unsigned long long value ) {
         oss << " (0x" << std::hex << value << ')';
     return oss.str();
 }
-#endif
 
-#ifdef CATCH_CONFIG_CPP11_NULLPTR
 std::string toString( std::nullptr_t ) {
     return "nullptr";
 }
-#endif
 
 #ifdef __OBJC__
     std::string toString( NSString const * const& nsstring ) {