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

more portability fixes

Commit
7e8cfa714f2fdf577497ed65f7c631523ed26cfa
Author
Phil Nash ·
Parents
9e4708371e1c

Files · Download .tar.gz

Changes

 Test/ClassTests.cpp        | 2 +-
 Test/ConditionTests.cpp    | 2 +-
 Test/ExceptionTests.cpp    | 2 +-
 Test/MessageTests.cpp      | 2 +-
 Test/TrickyTests.cpp       | 2 +-
 Test/main.cpp              | 4 ++--
 internal/catch_capture.hpp | 7 ++++++-
 7 files changed, 13 insertions(+), 8 deletions(-)

diff --git a/Test/ClassTests.cpp b/Test/ClassTests.cpp
index 9dd7147c..9213d34f 100644
--- a/Test/ClassTests.cpp
+++ b/Test/ClassTests.cpp
@@ -10,7 +10,7 @@
  *
  */
 
-#include "catch.hpp"
+#include "../catch.hpp"
 
 namespace
 {
diff --git a/Test/ConditionTests.cpp b/Test/ConditionTests.cpp
index 3eaec140..a48b29e8 100644
--- a/Test/ConditionTests.cpp
+++ b/Test/ConditionTests.cpp
@@ -10,7 +10,7 @@
  *
  */
 
-#include "catch.hpp"
+#include "../catch.hpp"
 
 #include <string>
 
diff --git a/Test/ExceptionTests.cpp b/Test/ExceptionTests.cpp
index 3bb222ee..35ba0b9a 100644
--- a/Test/ExceptionTests.cpp
+++ b/Test/ExceptionTests.cpp
@@ -10,7 +10,7 @@
  *
  */
 
-#include "catch.hpp"
+#include "../catch.hpp"
 
 #include <string>
 
diff --git a/Test/MessageTests.cpp b/Test/MessageTests.cpp
index be62f059..1a73b0ac 100644
--- a/Test/MessageTests.cpp
+++ b/Test/MessageTests.cpp
@@ -10,7 +10,7 @@
  *
  */
 
-#include "catch.hpp"
+#include "../catch.hpp"
 
 TEST_CASE( "succeeding/message", "INFO and WARN do not abort tests" )
 {
diff --git a/Test/TrickyTests.cpp b/Test/TrickyTests.cpp
index 5e0b5efe..73378323 100644
--- a/Test/TrickyTests.cpp
+++ b/Test/TrickyTests.cpp
@@ -10,7 +10,7 @@
  *
  */
 
-#include "catch.hpp"
+#include "../catch.hpp"
 
 namespace Catch
 {
diff --git a/Test/main.cpp b/Test/main.cpp
index 5477f96d..2a577905 100644
--- a/Test/main.cpp
+++ b/Test/main.cpp
@@ -10,8 +10,8 @@
  *
  */
 
-#include "catch.hpp"
-#include "catch_runner.hpp"
+#include "../catch.hpp"
+#include "../catch_runner.hpp"
 
 // This code runs the meta tests and verifies that the failing ones failed and the successful ones succeeded
 int main (int argc, char * const argv[])
diff --git a/internal/catch_capture.hpp b/internal/catch_capture.hpp
index f084dea4..dd923bf8 100644
--- a/internal/catch_capture.hpp
+++ b/internal/catch_capture.hpp
@@ -218,6 +218,11 @@ private:
 #define CATCH_absTol 1e-10
 #define CATCH_relTol 1e-10
 
+inline double catch_max( double x, double y )
+{
+    return x > y ? x : y;
+}
+    
 class Approx
 {
 public:
@@ -232,7 +237,7 @@ public:
         // !TBD Use proper tolerance
         // From: http://realtimecollisiondetection.net/blog/?p=89
         // see also: http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
-        return fabs( lhs - rhs.m_d ) <= std::max( CATCH_absTol, CATCH_relTol * std::max( fabs(lhs), fabs(rhs.m_d) ) );
+        return fabs( lhs - rhs.m_d ) <= catch_max( CATCH_absTol, CATCH_relTol * catch_max( fabs(lhs), fabs(rhs.m_d) ) );
     }
     
     template<typename T>