From 0cde0e90a67225dd3204ec8631d842b86f204e62 Mon Sep 17 00:00:00 2001 From: Phil Nash Date: Mon, 9 Jan 2017 14:40:09 +0000 Subject: [PATCH] =?UTF-8?q?Added=20approvals=20for=20=E2=80=9CGreater-than?= =?UTF-8?q?=20inequalities=20with=20different=20epsilons=E2=80=9D=20test?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Baselines/console.std.approved.txt | 4 +- .../Baselines/console.sw.approved.txt | 64 +++++++++++++++- .../SelfTest/Baselines/junit.sw.approved.txt | 4 +- .../SelfTest/Baselines/xml.sw.approved.txt | 74 ++++++++++++++++++- 4 files changed, 139 insertions(+), 7 deletions(-) diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 0b8f1bd9..12dc52ee 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -830,6 +830,6 @@ with expansion: "first" == "second" =============================================================================== -test cases: 157 | 113 passed | 42 failed | 2 failed as expected -assertions: 901 | 805 passed | 78 failed | 18 failed as expected +test cases: 159 | 115 passed | 42 failed | 2 failed as expected +assertions: 909 | 813 passed | 78 failed | 18 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 4d7177dd..ab488d3b 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -2366,6 +2366,36 @@ PASSED: with expansion: 214 == 214 +------------------------------------------------------------------------------- +Greater-than inequalities with different epsilons +------------------------------------------------------------------------------- +ApproxTests.cpp: +............................................................................... + +ApproxTests.cpp:: +PASSED: + REQUIRE( d >= Approx( 1.22 ) ) +with expansion: + 1.23 >= Approx( 1.22 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( d >= Approx( 1.23 ) ) +with expansion: + 1.23 >= Approx( 1.23 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE_FALSE( d >= Approx( 1.24 ) ) +with expansion: + !(1.23 >= Approx( 1.24 )) + +ApproxTests.cpp:: +PASSED: + REQUIRE( d >= Approx( 1.24 ).epsilon(0.1) ) +with expansion: + 1.23 >= Approx( 1.24 ) + ------------------------------------------------------------------------------- INFO and WARN do not abort tests ------------------------------------------------------------------------------- @@ -2530,6 +2560,36 @@ PASSED: with expansion: 5 != 6 +------------------------------------------------------------------------------- +Less-than inequalities with different epsilons +------------------------------------------------------------------------------- +ApproxTests.cpp: +............................................................................... + +ApproxTests.cpp:: +PASSED: + REQUIRE( d <= Approx( 1.24 ) ) +with expansion: + 1.23 <= Approx( 1.24 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE( d <= Approx( 1.23 ) ) +with expansion: + 1.23 <= Approx( 1.23 ) + +ApproxTests.cpp:: +PASSED: + REQUIRE_FALSE( d <= Approx( 1.22 ) ) +with expansion: + !(1.23 <= Approx( 1.22 )) + +ApproxTests.cpp:: +PASSED: + REQUIRE( d <= Approx( 1.22 ).epsilon(0.1) ) +with expansion: + 1.23 <= Approx( 1.22 ) + ------------------------------------------------------------------------------- Long strings can be wrapped plain string @@ -8911,6 +8971,6 @@ MiscTests.cpp:: PASSED: =============================================================================== -test cases: 157 | 112 passed | 43 failed | 2 failed as expected -assertions: 903 | 805 passed | 80 failed | 18 failed as expected +test cases: 159 | 114 passed | 43 failed | 2 failed as expected +assertions: 911 | 813 passed | 80 failed | 18 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 1b4cd69f..a8b43453 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,6 +1,6 @@ - + @@ -193,6 +193,7 @@ MessageTests.cpp: + @@ -229,6 +230,7 @@ ConditionTests.cpp: + diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 1484d398..c09629e1 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -2343,6 +2343,41 @@ + + + + d >= Approx( 1.22 ) + + + 1.23 >= Approx( 1.22 ) + + + + + d >= Approx( 1.23 ) + + + 1.23 >= Approx( 1.23 ) + + + + + !d >= Approx( 1.24 ) + + + !(1.23 >= Approx( 1.24 )) + + + + + d >= Approx( 1.24 ).epsilon(0.1) + + + 1.23 >= Approx( 1.24 ) + + + + this is a message @@ -2544,6 +2579,41 @@ + + + + d <= Approx( 1.24 ) + + + 1.23 <= Approx( 1.24 ) + + + + + d <= Approx( 1.23 ) + + + 1.23 <= Approx( 1.23 ) + + + + + !d <= Approx( 1.22 ) + + + !(1.23 <= Approx( 1.22 )) + + + + + d <= Approx( 1.22 ).epsilon(0.1) + + + 1.23 <= Approx( 1.22 ) + + + +
@@ -9362,7 +9432,7 @@ there"
- + - +