mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-22 13:26:10 +01:00
more portability fixes
This commit is contained in:
parent
9e4708371e
commit
7e8cfa714f
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "catch.hpp"
|
#include "../catch.hpp"
|
||||||
|
|
||||||
namespace
|
namespace
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "catch.hpp"
|
#include "../catch.hpp"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "catch.hpp"
|
#include "../catch.hpp"
|
||||||
|
|
||||||
#include <string>
|
#include <string>
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "catch.hpp"
|
#include "../catch.hpp"
|
||||||
|
|
||||||
TEST_CASE( "succeeding/message", "INFO and WARN do not abort tests" )
|
TEST_CASE( "succeeding/message", "INFO and WARN do not abort tests" )
|
||||||
{
|
{
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "catch.hpp"
|
#include "../catch.hpp"
|
||||||
|
|
||||||
namespace Catch
|
namespace Catch
|
||||||
{
|
{
|
||||||
|
@ -10,8 +10,8 @@
|
|||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include "catch.hpp"
|
#include "../catch.hpp"
|
||||||
#include "catch_runner.hpp"
|
#include "../catch_runner.hpp"
|
||||||
|
|
||||||
// This code runs the meta tests and verifies that the failing ones failed and the successful ones succeeded
|
// 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[])
|
int main (int argc, char * const argv[])
|
||||||
|
@ -218,6 +218,11 @@ private:
|
|||||||
#define CATCH_absTol 1e-10
|
#define CATCH_absTol 1e-10
|
||||||
#define CATCH_relTol 1e-10
|
#define CATCH_relTol 1e-10
|
||||||
|
|
||||||
|
inline double catch_max( double x, double y )
|
||||||
|
{
|
||||||
|
return x > y ? x : y;
|
||||||
|
}
|
||||||
|
|
||||||
class Approx
|
class Approx
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
@ -232,7 +237,7 @@ public:
|
|||||||
// !TBD Use proper tolerance
|
// !TBD Use proper tolerance
|
||||||
// From: http://realtimecollisiondetection.net/blog/?p=89
|
// From: http://realtimecollisiondetection.net/blog/?p=89
|
||||||
// see also: http://www.cygnus-software.com/papers/comparingfloats/comparingfloats.htm
|
// 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>
|
template<typename T>
|
||||||
|
Loading…
Reference in New Issue
Block a user