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

Regenerated single include

Commit
6f1543b1b1e0c579ed432ae168f113a2cbd8cad2
Author
Phil Nash ·
Parents
e1cb8f25f2c1

Files · Download .tar.gz

Changes

 single_include/catch.hpp | 23 ++++++++++++++++++++---
 1 file changed, 20 insertions(+), 3 deletions(-)

diff --git a/single_include/catch.hpp b/single_include/catch.hpp
index a112fa92..d1aa46a6 100644
--- a/single_include/catch.hpp
+++ b/single_include/catch.hpp
@@ -991,7 +991,14 @@ namespace Catch
             else if( m_op == "matches" )
                 return m_lhs + " " + m_rhs;
             else if( m_op != "!" )
-                return m_lhs + " " + m_op + " " + m_rhs;
+            {
+                if( m_lhs.size() + m_rhs.size() < 30 )
+                    return m_lhs + " " + m_op + " " + m_rhs;
+                else if( m_lhs.size() < 70 && m_rhs.size() < 70 )
+                    return "\n\t" + m_lhs + "\n\t" + m_op + "\n\t" + m_rhs;
+                else
+                    return "\n" + m_lhs + "\n" + m_op + "\n" + m_rhs + "\n\n";
+            }
             else
                 return "{can't expand - use " + m_macroName + "_FALSE( " + m_expr.substr(1) + " ) instead of " + m_macroName + "( " + m_expr + " ) for better diagnostics}";
         }
@@ -1386,15 +1393,25 @@ namespace Internal
     template<Operator Op, typename T>
     bool compare( long lhs, const T* rhs )
     {
-        return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( NULL ), rhs );
-
+        return Evaluator<const T*, const T*, Op>::evaluate( reinterpret_cast<const T*>( lhs ), rhs );
     }
 
     template<Operator Op, typename T>
     bool compare( long lhs, T* rhs )
     {
         return Evaluator<T*, T*, Op>::evaluate( reinterpret_cast<T*>( lhs ), rhs );
+    }
 
+    template<Operator Op, typename T>
+    bool compare( const T* lhs, long rhs )
+    {
+        return Evaluator<const T*, const T*, Op>::evaluate( lhs, reinterpret_cast<const T*>( rhs ) );
+    }
+
+    template<Operator Op, typename T>
+    bool compare( T* lhs, long rhs )
+    {
+        return Evaluator<T*, T*, Op>::evaluate( lhs, reinterpret_cast<T*>( rhs ) );
     }
 
 } // end of namespace Internal