Add NAN test for Approx

This commit is contained in:
Martin Hořeňovský 2017-11-10 18:48:45 +01:00
parent 5f961af70e
commit 030321e3e0
5 changed files with 35 additions and 5 deletions

View File

@ -190,6 +190,8 @@ TEST_CASE("Epsilon only applies to Approx's value", "[Approx]") {
TEST_CASE("Assorted miscellaneous tests", "[Approx]") {
REQUIRE(INFINITY == Approx(INFINITY));
REQUIRE(NAN != Approx(NAN));
REQUIRE_FALSE(NAN == Approx(NAN));
}
class StrongDoubleTypedef

View File

@ -1004,5 +1004,5 @@ with expansion:
===============================================================================
test cases: 187 | 136 passed | 47 failed | 4 failed as expected
assertions: 935 | 818 passed | 96 failed | 21 failed as expected
assertions: 937 | 820 passed | 96 failed | 21 failed as expected

View File

@ -826,6 +826,18 @@ PASSED:
with expansion:
inff == Approx( inf )
ApproxTests.cpp:<line number>:
PASSED:
REQUIRE( NAN != Approx(NAN) )
with expansion:
nanf != Approx( nan )
ApproxTests.cpp:<line number>:
PASSED:
REQUIRE_FALSE( NAN == Approx(NAN) )
with expansion:
!(nanf == Approx( nan ))
-------------------------------------------------------------------------------
Bitfields can be captured (#1027)
-------------------------------------------------------------------------------
@ -7861,5 +7873,5 @@ PASSED:
===============================================================================
test cases: 187 | 134 passed | 49 failed | 4 failed as expected
assertions: 934 | 814 passed | 99 failed | 21 failed as expected
assertions: 936 | 816 passed | 99 failed | 21 failed as expected

View File

@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuitesloose text artifact
>
<testsuite name="<exe-name>" errors="15" failures="85" tests="935" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testsuite name="<exe-name>" errors="15" failures="85" tests="937" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
<testcase classname="<exe-name>.global" name="# A test name that starts with a #" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#1005: Comparing pointer to int and long (NULL can be either on various systems)" time="{duration}"/>
<testcase classname="<exe-name>.global" name="#748 - captures with unexpected exceptions/outside assertions" time="{duration}">

View File

@ -869,6 +869,22 @@
inff == Approx( inf )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/<exe-name>/ApproxTests.cpp" >
<Original>
NAN != Approx(NAN)
</Original>
<Expanded>
nanf != Approx( nan )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_FALSE" filename="projects/<exe-name>/ApproxTests.cpp" >
<Original>
!(NAN == Approx(NAN))
</Original>
<Expanded>
!(nanf == Approx( nan ))
</Expanded>
</Expression>
<OverallResult success="true"/>
</TestCase>
<TestCase name="Bitfields can be captured (#1027)" filename="projects/<exe-name>/TrickyTests.cpp" >
@ -8718,7 +8734,7 @@ loose text artifact
</Section>
<OverallResult success="true"/>
</TestCase>
<OverallResults successes="814" failures="100" expectedFailures="21"/>
<OverallResults successes="816" failures="100" expectedFailures="21"/>
</Group>
<OverallResults successes="814" failures="99" expectedFailures="21"/>
<OverallResults successes="816" failures="99" expectedFailures="21"/>
</Catch>