diff options
| author | Phil Nash | 2010-11-12 08:12:01 +0000 |
|---|---|---|
| committer | Phil Nash | 2010-11-12 08:12:01 +0000 |
| commit | 7e8cfa714f2fdf577497ed65f7c631523ed26cfa (patch) | |
| tree | 65378234f86945d14b45a63ac6f08b7432d5651b | |
| parent | 9e4708371e1c29e1a343a7bfeabd7fedcf0a67a6 (diff) | |
| download | catch3-7e8cfa714f2fdf577497ed65f7c631523ed26cfa.tar.gz | |
more portability fixes
| -rw-r--r-- | Test/ClassTests.cpp | 2 | ||||
| -rw-r--r-- | Test/ConditionTests.cpp | 2 | ||||
| -rw-r--r-- | Test/ExceptionTests.cpp | 2 | ||||
| -rw-r--r-- | Test/MessageTests.cpp | 2 | ||||
| -rw-r--r-- | Test/TrickyTests.cpp | 2 | ||||
| -rw-r--r-- | Test/main.cpp | 4 | ||||
| -rw-r--r-- | 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> |