diff options
author | Thomas Capricelli <orzel@freehackers.org> | 2010-05-21 02:13:50 +0200 |
---|---|---|
committer | Thomas Capricelli <orzel@freehackers.org> | 2010-05-21 02:13:50 +0200 |
commit | 00a3d0779572c519a836c39e7f05d36781682be2 (patch) | |
tree | 6fee6f264d7ceed49a35f38dee1e8198b949ec2d /test/main.h | |
parent | aadea5ae56b97f316f29bba2fd176c1be8fba852 (diff) |
display actual/expected warning if ei_isApprox() fails
Diffstat (limited to 'test/main.h')
-rw-r--r-- | test/main.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/test/main.h b/test/main.h index d9223aa78..0c0381f75 100644 --- a/test/main.h +++ b/test/main.h @@ -294,7 +294,14 @@ inline bool test_ei_isApproxOrLessThan(const float& a, const float& b) { return ei_isApproxOrLessThan(a, b, test_precision<float>()); } inline bool test_ei_isApprox(const double& a, const double& b) -{ return ei_isApprox(a, b, test_precision<double>()); } +{ + bool ret = ei_isApprox(a, b, test_precision<double>()); + if (!ret) std::cerr + << std::endl << " actual = " << a + << std::endl << " expected = " << b << std::endl << std::endl; + return ret; +} + inline bool test_ei_isMuchSmallerThan(const double& a, const double& b) { return ei_isMuchSmallerThan(a, b, test_precision<double>()); } inline bool test_ei_isApproxOrLessThan(const double& a, const double& b) @@ -311,7 +318,14 @@ inline bool test_ei_isMuchSmallerThan(const std::complex<double>& a, const std:: { return ei_isMuchSmallerThan(a, b, test_precision<std::complex<double> >()); } inline bool test_ei_isApprox(const long double& a, const long double& b) -{ return ei_isApprox(a, b, test_precision<long double>()); } +{ + bool ret = ei_isApprox(a, b, test_precision<long double>()); + if (!ret) std::cerr + << std::endl << " actual = " << a + << std::endl << " expected = " << b << std::endl << std::endl; + return ret; +} + inline bool test_ei_isMuchSmallerThan(const long double& a, const long double& b) { return ei_isMuchSmallerThan(a, b, test_precision<long double>()); } inline bool test_ei_isApproxOrLessThan(const long double& a, const long double& b) |