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

Removed templates from Approx (just uses double)

Commit
6b6143ccd4a5c38acf64f06e24967e8e96aecb38
Author
Phil Nash ·
Parents
89d1e6c4f11f

Files · Download .tar.gz

Changes

 glueHeaders.py                    |  2 --
 include/internal/catch_approx.hpp | 12 ++++--------
 single_include/catch.hpp          | 16 +++++++---------
 3 files changed, 11 insertions(+), 19 deletions(-)

diff --git a/glueHeaders.py b/glueHeaders.py
index 175ecc12..f33ddff5 100644
--- a/glueHeaders.py
+++ b/glueHeaders.py
@@ -36,8 +36,6 @@ print "// This file has been merged from multiple headers. Please don't edit it
 print
 print '#ifndef TWOBLUECUBES_CATCH_HPP_INCLUDED'
 print '#define TWOBLUECUBES_CATCH_HPP_INCLUDED'
-
 parseFile( rootPath, 'catch.hpp' )
-
 print '#endif // TWOBLUECUBES_CATCH_HPP_INCLUDED'
 print
diff --git a/include/internal/catch_approx.hpp b/include/internal/catch_approx.hpp
index 5630e3a2..37d54f37 100644
--- a/include/internal/catch_approx.hpp
+++ b/include/internal/catch_approx.hpp
@@ -36,10 +36,9 @@ namespace Catch
             }
             
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator == 
             (
-                const T& lhs, 
+                double lhs,
                 const Approx& rhs
             )
             {
@@ -48,21 +47,19 @@ namespace Catch
             }
             
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator == 
             (
                 const Approx& lhs,
-                const T& rhs
+                double rhs
             )
             {
                 return operator==( rhs, lhs );
             }
             
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator != 
             (
-                const T& lhs, 
+                double lhs, 
                 const Approx& rhs
             )
             {
@@ -70,11 +67,10 @@ namespace Catch
             }
 
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator != 
             (
                 const Approx& lhs,
-                const T& rhs
+                double rhs
             )
             {
                 return !operator==( rhs, lhs );
diff --git a/single_include/catch.hpp b/single_include/catch.hpp
index 66a15e47..09e5d0c8 100644
--- a/single_include/catch.hpp
+++ b/single_include/catch.hpp
@@ -25,7 +25,6 @@
     Finish macros, listed here, later (just CHECK_NOFAIL now)
  */
 #define TWOBLUECUBES_CATCH_HPP_INCLUDED
-
 // #included from: internal/catch_hub.h
 
 /*
@@ -2388,10 +2387,9 @@ namespace Catch
             }
 
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator ==
             (
-                const T& lhs,
+                double lhs,
                 const Approx& rhs
             )
             {
@@ -2400,21 +2398,19 @@ namespace Catch
             }
 
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator ==
             (
                 const Approx& lhs,
-                const T& rhs
+                double rhs
             )
             {
                 return operator==( rhs, lhs );
             }
 
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator !=
             (
-                const T& lhs,
+                double lhs,
                 const Approx& rhs
             )
             {
@@ -2422,11 +2418,10 @@ namespace Catch
             }
 
             ///////////////////////////////////////////////////////////////////////////
-            template<typename T>
             friend bool operator !=
             (
                 const Approx& lhs,
-                const T& rhs
+                double rhs
             )
             {
                 return !operator==( rhs, lhs );
@@ -5925,6 +5920,9 @@ int main (int argc, char * const argv[])
 #import <objc/runtime.h>
 #include <string>
 
+// NB. Any general catch headers included here must be included
+// in catch.hpp first to make sure they are included by the single
+// header for non obj-usage
 
 ///////////////////////////////////////////////////////////////////////////////
 // This protocol is really only here for (self) documenting purposes, since