mirror of
https://gitlab.com/libeigen/eigen.git
synced 2025-01-18 14:34:17 +08:00
display actual/expected warning if ei_isApprox() fails
This commit is contained in:
parent
aadea5ae56
commit
00a3d07795
18
test/main.h
18
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>()); }
|
{ return ei_isApproxOrLessThan(a, b, test_precision<float>()); }
|
||||||
|
|
||||||
inline bool test_ei_isApprox(const double& a, const double& b)
|
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)
|
inline bool test_ei_isMuchSmallerThan(const double& a, const double& b)
|
||||||
{ return ei_isMuchSmallerThan(a, b, test_precision<double>()); }
|
{ return ei_isMuchSmallerThan(a, b, test_precision<double>()); }
|
||||||
inline bool test_ei_isApproxOrLessThan(const double& a, const double& b)
|
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> >()); }
|
{ return ei_isMuchSmallerThan(a, b, test_precision<std::complex<double> >()); }
|
||||||
|
|
||||||
inline bool test_ei_isApprox(const long double& a, const long double& b)
|
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)
|
inline bool test_ei_isMuchSmallerThan(const long double& a, const long double& b)
|
||||||
{ return ei_isMuchSmallerThan(a, b, test_precision<long double>()); }
|
{ return ei_isMuchSmallerThan(a, b, test_precision<long double>()); }
|
||||||
inline bool test_ei_isApproxOrLessThan(const long double& a, const long double& b)
|
inline bool test_ei_isApproxOrLessThan(const long double& a, const long double& b)
|
||||||
|
Loading…
Reference in New Issue
Block a user