mirror of
https://github.com/catchorg/Catch2.git
synced 2024-11-24 22:36:10 +01:00
Use Catch::StringMaker for output in WithinRelMatcher (#2846)
The WithinRelMatcher does not listen to the precision specification; it just naively pipes to stringstream. If you specify the precision, that has no impact on the outputted values when the match fails. This fix makes the WithinRelMatcher listen to the precision (https://github.com/catchorg/Catch2/blob/devel/docs/tostring.md#floating-point-precision) specified by: Catch::StringMaker<float>::precision
This commit is contained in:
parent
029fe3b460
commit
53ddf37af4
@ -176,7 +176,7 @@ namespace Detail {
|
||||
|
||||
std::string WithinRelMatcher::describe() const {
|
||||
Catch::ReusableStringStream sstr;
|
||||
sstr << "and " << m_target << " are within " << m_epsilon * 100. << "% of each other";
|
||||
sstr << "and " << ::Catch::Detail::stringify(m_target) << " are within " << m_epsilon * 100. << "% of each other";
|
||||
return sstr.str();
|
||||
}
|
||||
|
||||
|
@ -598,9 +598,9 @@ Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<
|
||||
GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
|
||||
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0
|
||||
@ -618,7 +618,7 @@ Matchers.tests.cpp:<line number>: passed: 1., WithinULP( 1., 0 ) for: 1.0 is wit
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00])
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1., 0. )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1., -1. ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: WithinULP( 1., 0 )
|
||||
@ -626,11 +626,11 @@ Matchers.tests.cpp:<line number>: passed: WithinRel( 1., 0. )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinRel( 1., -0.2 ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: WithinRel( 1., 1. ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: 1., !IsNaN() for: 1.0 not is NaN
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0
|
||||
@ -650,7 +650,7 @@ Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00])
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1.f, 0.f )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1.f, -1.f ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: WithinULP( 1.f, 0 )
|
||||
|
@ -596,9 +596,9 @@ Misc.tests.cpp:<line number>: passed: Factorial(10) == 3628800 for: 3628800 (0x<
|
||||
GeneratorsImpl.tests.cpp:<line number>: passed: filter( []( int ) { return false; }, value( 3 ) ), Catch::GeneratorException
|
||||
Matchers.tests.cpp:<line number>: passed: 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0., WithinAbs( 1., 1 ) for: 0.0 is within 1.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0., !WithinAbs( 1., 0.99 ) for: 0.0 not is within 0.99 of 1.0
|
||||
@ -616,7 +616,7 @@ Matchers.tests.cpp:<line number>: passed: 1., WithinULP( 1., 0 ) for: 1.0 is wit
|
||||
Matchers.tests.cpp:<line number>: passed: -0., WithinULP( 0., 0 ) for: -0.0 is within 0 ULPs of 0.0000000000000000e+00 ([0.0000000000000000e+00, 0.0000000000000000e+00])
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is within 0.5 of 1.0 or is within 1 ULPs of 2.0000000000000000e+00 ([1.9999999999999998e+00, 2.0000000000000004e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1., 0. )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1., -1. ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: WithinULP( 1., 0 )
|
||||
@ -624,11 +624,11 @@ Matchers.tests.cpp:<line number>: passed: WithinRel( 1., 0. )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinRel( 1., -0.2 ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: WithinRel( 1., 1. ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: 1., !IsNaN() for: 1.0 not is NaN
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0.f, WithinAbs( 1.f, 1 ) for: 0.0f is within 1.0 of 1.0
|
||||
Matchers.tests.cpp:<line number>: passed: 0.f, !WithinAbs( 1.f, 0.99f ) for: 0.0f not is within 0.9900000095 of 1.0
|
||||
@ -648,7 +648,7 @@ Matchers.tests.cpp:<line number>: passed: 1.f, WithinULP( 1.f, 0 ) for: 1.0f is
|
||||
Matchers.tests.cpp:<line number>: passed: -0.f, WithinULP( 0.f, 0 ) for: -0.0f is within 0 ULPs of 0.00000000e+00f ([0.00000000e+00, 0.00000000e+00])
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f ( is within 0.5 of 1.0 or is within 1 ULPs of 1.00000000e+00f ([9.99999940e-01, 1.00000012e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1.f, 0.f )
|
||||
Matchers.tests.cpp:<line number>: passed: WithinAbs( 1.f, -1.f ), std::domain_error
|
||||
Matchers.tests.cpp:<line number>: passed: WithinULP( 1.f, 0 )
|
||||
|
@ -4487,12 +4487,12 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 1., !WithinRel( 0., 0.99 ) )
|
||||
with expansion:
|
||||
1.0 not and 0 are within 99% of each other
|
||||
1.0 not and 0.0 are within 99% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( -0., WithinRel( 0. ) )
|
||||
with expansion:
|
||||
-0.0 and 0 are within 2.22045e-12% of each other
|
||||
-0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: double
|
||||
@ -4505,7 +4505,7 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( v1, WithinRel( v2 ) )
|
||||
with expansion:
|
||||
0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: double
|
||||
@ -4625,7 +4625,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) )
|
||||
with expansion:
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: double
|
||||
@ -4674,22 +4674,22 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 10.f, WithinRel( 11.1f, 0.1f ) )
|
||||
with expansion:
|
||||
10.0f and 11.1 are within 10% of each other
|
||||
10.0f and 11.1000003815 are within 10% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 10.f, !WithinRel( 11.2f, 0.1f ) )
|
||||
with expansion:
|
||||
10.0f not and 11.2 are within 10% of each other
|
||||
10.0f not and 11.1999998093 are within 10% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 1.f, !WithinRel( 0.f, 0.99f ) )
|
||||
with expansion:
|
||||
1.0f not and 0 are within 99% of each other
|
||||
1.0f not and 0.0 are within 99% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( -0.f, WithinRel( 0.f ) )
|
||||
with expansion:
|
||||
-0.0f and 0 are within 0.00119209% of each other
|
||||
-0.0f and 0.0 are within 0.00119209% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: float
|
||||
@ -4702,7 +4702,7 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( v1, WithinRel( v2 ) )
|
||||
with expansion:
|
||||
0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
0.0f and 0.0 are within 0.00119209% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: float
|
||||
@ -4827,7 +4827,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) )
|
||||
with expansion:
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: float
|
||||
|
@ -4485,12 +4485,12 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 1., !WithinRel( 0., 0.99 ) )
|
||||
with expansion:
|
||||
1.0 not and 0 are within 99% of each other
|
||||
1.0 not and 0.0 are within 99% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( -0., WithinRel( 0. ) )
|
||||
with expansion:
|
||||
-0.0 and 0 are within 2.22045e-12% of each other
|
||||
-0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: double
|
||||
@ -4503,7 +4503,7 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( v1, WithinRel( v2 ) )
|
||||
with expansion:
|
||||
0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: double
|
||||
@ -4623,7 +4623,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) )
|
||||
with expansion:
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: double
|
||||
@ -4672,22 +4672,22 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 10.f, WithinRel( 11.1f, 0.1f ) )
|
||||
with expansion:
|
||||
10.0f and 11.1 are within 10% of each other
|
||||
10.0f and 11.1000003815 are within 10% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 10.f, !WithinRel( 11.2f, 0.1f ) )
|
||||
with expansion:
|
||||
10.0f not and 11.2 are within 10% of each other
|
||||
10.0f not and 11.1999998093 are within 10% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 1.f, !WithinRel( 0.f, 0.99f ) )
|
||||
with expansion:
|
||||
1.0f not and 0 are within 99% of each other
|
||||
1.0f not and 0.0 are within 99% of each other
|
||||
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( -0.f, WithinRel( 0.f ) )
|
||||
with expansion:
|
||||
-0.0f and 0 are within 0.00119209% of each other
|
||||
-0.0f and 0.0 are within 0.00119209% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: float
|
||||
@ -4700,7 +4700,7 @@ Matchers.tests.cpp:<line number>
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( v1, WithinRel( v2 ) )
|
||||
with expansion:
|
||||
0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
0.0f and 0.0 are within 0.00119209% of each other
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: float
|
||||
@ -4825,7 +4825,7 @@ with expansion:
|
||||
Matchers.tests.cpp:<line number>: PASSED:
|
||||
REQUIRE_THAT( 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) )
|
||||
with expansion:
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
|
||||
-------------------------------------------------------------------------------
|
||||
Floating point matchers: float
|
||||
|
@ -1129,11 +1129,11 @@ ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10%
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other
|
||||
ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other
|
||||
ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0
|
||||
# Floating point matchers: double
|
||||
@ -1169,7 +1169,7 @@ ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) )
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - WithinAbs( 1., 0. )
|
||||
# Floating point matchers: double
|
||||
@ -1185,15 +1185,15 @@ ok {test-number} - WithinRel( 1., 1. ), std::domain_error
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other
|
||||
ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other
|
||||
ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other
|
||||
ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other
|
||||
ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0
|
||||
# Floating point matchers: float
|
||||
@ -1233,7 +1233,7 @@ ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f (
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) )
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - WithinAbs( 1.f, 0.f )
|
||||
# Floating point matchers: float
|
||||
|
@ -1127,11 +1127,11 @@ ok {test-number} - 10., WithinRel( 11.1, 0.1 ) for: 10.0 and 11.1 are within 10%
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 10., !WithinRel( 11.2, 0.1 ) for: 10.0 not and 11.2 are within 10% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0 are within 99% of each other
|
||||
ok {test-number} - 1., !WithinRel( 0., 0.99 ) for: 1.0 not and 0.0 are within 99% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0 are within 2.22045e-12% of each other
|
||||
ok {test-number} - -0., WithinRel( 0. ) for: -0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., WithinAbs( 1., 0 ) for: 1.0 is within 0.0 of 1.0
|
||||
# Floating point matchers: double
|
||||
@ -1167,7 +1167,7 @@ ok {test-number} - 1., WithinAbs( 1., 0.5 ) || WithinULP( 2., 1 ) for: 1.0 ( is
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., WithinAbs( 2., 0.5 ) || WithinULP( 1., 0 ) for: 1.0 ( is within 0.5 of 2.0 or is within 0 ULPs of 1.0000000000000000e+00 ([1.0000000000000000e+00, 1.0000000000000000e+00]) )
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
ok {test-number} - 0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 ) for: 0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - WithinAbs( 1., 0. )
|
||||
# Floating point matchers: double
|
||||
@ -1183,15 +1183,15 @@ ok {test-number} - WithinRel( 1., 1. ), std::domain_error
|
||||
# Floating point matchers: double
|
||||
ok {test-number} - 1., !IsNaN() for: 1.0 not is NaN
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1 are within 10% of each other
|
||||
ok {test-number} - 10.f, WithinRel( 11.1f, 0.1f ) for: 10.0f and 11.1000003815 are within 10% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.2 are within 10% of each other
|
||||
ok {test-number} - 10.f, !WithinRel( 11.2f, 0.1f ) for: 10.0f not and 11.1999998093 are within 10% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0 are within 99% of each other
|
||||
ok {test-number} - 1.f, !WithinRel( 0.f, 0.99f ) for: 1.0f not and 0.0 are within 99% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0 are within 0.00119209% of each other
|
||||
ok {test-number} - -0.f, WithinRel( 0.f ) for: -0.0f and 0.0 are within 0.00119209% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
ok {test-number} - v1, WithinRel( v2 ) for: 0.0f and 0.0 are within 0.00119209% of each other
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 1.f, WithinAbs( 1.f, 0 ) for: 1.0f is within 0.0 of 1.0
|
||||
# Floating point matchers: float
|
||||
@ -1231,7 +1231,7 @@ ok {test-number} - 1.f, WithinAbs( 1.f, 0.5 ) || WithinULP( 1.f, 1 ) for: 1.0f (
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 1.f, WithinAbs( 2.f, 0.5 ) || WithinULP( 1.f, 0 ) for: 1.0f ( is within 0.5 of 2.0 or is within 0 ULPs of 1.00000000e+00f ([1.00000000e+00, 1.00000000e+00]) )
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
ok {test-number} - 0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f ) for: 0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
# Floating point matchers: float
|
||||
ok {test-number} - WithinAbs( 1.f, 0.f )
|
||||
# Floating point matchers: float
|
||||
|
@ -5022,7 +5022,7 @@ C
|
||||
1., !WithinRel( 0., 0.99 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0 not and 0 are within 99% of each other
|
||||
1.0 not and 0.0 are within 99% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5030,7 +5030,7 @@ C
|
||||
-0., WithinRel( 0. )
|
||||
</Original>
|
||||
<Expanded>
|
||||
-0.0 and 0 are within 2.22045e-12% of each other
|
||||
-0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5039,7 +5039,7 @@ C
|
||||
v1, WithinRel( v2 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@ -5194,7 +5194,7 @@ C
|
||||
0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@ -5270,7 +5270,7 @@ C
|
||||
10.f, WithinRel( 11.1f, 0.1f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
10.0f and 11.1 are within 10% of each other
|
||||
10.0f and 11.1000003815 are within 10% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5278,7 +5278,7 @@ C
|
||||
10.f, !WithinRel( 11.2f, 0.1f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
10.0f not and 11.2 are within 10% of each other
|
||||
10.0f not and 11.1999998093 are within 10% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5286,7 +5286,7 @@ C
|
||||
1.f, !WithinRel( 0.f, 0.99f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0f not and 0 are within 99% of each other
|
||||
1.0f not and 0.0 are within 99% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5294,7 +5294,7 @@ C
|
||||
-0.f, WithinRel( 0.f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
-0.0f and 0 are within 0.00119209% of each other
|
||||
-0.0f and 0.0 are within 0.00119209% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5303,7 +5303,7 @@ C
|
||||
v1, WithinRel( v2 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
0.0f and 0.0 are within 0.00119209% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@ -5474,7 +5474,7 @@ C
|
||||
0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/>
|
||||
|
@ -5022,7 +5022,7 @@ C
|
||||
1., !WithinRel( 0., 0.99 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0 not and 0 are within 99% of each other
|
||||
1.0 not and 0.0 are within 99% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5030,7 +5030,7 @@ C
|
||||
-0., WithinRel( 0. )
|
||||
</Original>
|
||||
<Expanded>
|
||||
-0.0 and 0 are within 2.22045e-12% of each other
|
||||
-0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5039,7 +5039,7 @@ C
|
||||
v1, WithinRel( v2 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0 and 2.22507e-308 are within 2.22045e-12% of each other
|
||||
0.0 and 0.0 are within 2.22045e-12% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@ -5194,7 +5194,7 @@ C
|
||||
0.0001, WithinAbs( 0., 0.001 ) || WithinRel( 0., 0.1 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001 ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@ -5270,7 +5270,7 @@ C
|
||||
10.f, WithinRel( 11.1f, 0.1f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
10.0f and 11.1 are within 10% of each other
|
||||
10.0f and 11.1000003815 are within 10% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5278,7 +5278,7 @@ C
|
||||
10.f, !WithinRel( 11.2f, 0.1f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
10.0f not and 11.2 are within 10% of each other
|
||||
10.0f not and 11.1999998093 are within 10% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5286,7 +5286,7 @@ C
|
||||
1.f, !WithinRel( 0.f, 0.99f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
1.0f not and 0 are within 99% of each other
|
||||
1.0f not and 0.0 are within 99% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Expression success="true" type="REQUIRE_THAT" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5294,7 +5294,7 @@ C
|
||||
-0.f, WithinRel( 0.f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
-0.0f and 0 are within 0.00119209% of each other
|
||||
-0.0f and 0.0 are within 0.00119209% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<Section name="Some subnormal values" filename="tests/<exe-name>/UsageTests/Matchers.tests.cpp" >
|
||||
@ -5303,7 +5303,7 @@ C
|
||||
v1, WithinRel( v2 )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0f and 1.17549e-38 are within 0.00119209% of each other
|
||||
0.0f and 0.0 are within 0.00119209% of each other
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="1" failures="0" expectedFailures="0" skipped="false"/>
|
||||
@ -5474,7 +5474,7 @@ C
|
||||
0.0001f, WithinAbs( 0.f, 0.001f ) || WithinRel( 0.f, 0.1f )
|
||||
</Original>
|
||||
<Expanded>
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0 are within 10% of each other )
|
||||
0.0001f ( is within 0.001 of 0.0 or and 0.0 are within 10% of each other )
|
||||
</Expanded>
|
||||
</Expression>
|
||||
<OverallResults successes="3" failures="0" expectedFailures="0" skipped="false"/>
|
||||
|
Loading…
Reference in New Issue
Block a user