matcher-like nan check
diff --git a/examples/all_features/test_output/assertion_macros.cpp.txt b/examples/all_features/test_output/assertion_macros.cpp.txt
index dbd8313..513939d 100644
--- a/examples/all_features/test_output/assertion_macros.cpp.txt
+++ b/examples/all_features/test_output/assertion_macros.cpp.txt
@@ -219,10 +219,6 @@
assertion_macros.cpp(0): MESSAGE: :D
-assertion_macros.cpp(0): MESSAGE: :D
-
-assertion_macros.cpp(0): MESSAGE: :D
-
===============================================================================
assertion_macros.cpp(0):
TEST CASE: check return values no print
@@ -250,21 +246,8 @@
assertion_macros.cpp(0): ERROR: CHECK_THROWS_WITH( throw_if(true, 2), "1" ) threw a DIFFERENT exception: "2"
-assertion_macros.cpp(0): ERROR: CHECK_NAN( 0. ) is NOT correct!
- values: CHECK_NAN( 0.0 )
-
===============================================================================
-assertion_macros.cpp(0):
-TEST CASE: nan
-
-assertion_macros.cpp(0): ERROR: CHECK_NAN( std::numeric_limits<long double>::infinity() ) is NOT correct!
- values: CHECK_NAN( inf )
-
-assertion_macros.cpp(0): WARNING: WARN_NOT_NAN( std::numeric_limits<float>::quiet_NaN() ) is NOT correct!
- values: WARN_NOT_NAN( nanf )
-
-===============================================================================
-[doctest] test cases: 24 | 4 passed | 20 failed |
-[doctest] assertions: 99 | 49 passed | 50 failed |
+[doctest] test cases: 23 | 4 passed | 19 failed |
+[doctest] assertions: 92 | 44 passed | 48 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/assertion_macros.cpp_junit.txt b/examples/all_features/test_output/assertion_macros.cpp_junit.txt
index 966f923..bcc119c 100644
--- a/examples/all_features/test_output/assertion_macros.cpp_junit.txt
+++ b/examples/all_features/test_output/assertion_macros.cpp_junit.txt
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
- <testsuite name="all_features" errors="0" failures="64" tests="99">
+ <testsuite name="all_features" errors="0" failures="61" tests="92">
<testcase classname="assertion_macros.cpp" name="normal macros" status="run">
<failure type="CHECK">
assertion_macros.cpp(0):
@@ -369,26 +369,6 @@
CHECK_THROWS_WITH( throw_if(true, 2), "1" ) threw a DIFFERENT exception: "2"
</failure>
- <failure message="0.0" type="CHECK_NAN">
-assertion_macros.cpp(0):
-CHECK_NAN( 0. ) is NOT correct!
- values: CHECK_NAN( 0.0 )
-
- </failure>
- </testcase>
- <testcase classname="assertion_macros.cpp" name="nan" status="run">
- <failure message="inf" type="CHECK_NAN">
-assertion_macros.cpp(0):
-CHECK_NAN( std::numeric_limits<long double>::infinity() ) is NOT correct!
- values: CHECK_NAN( inf )
-
- </failure>
- <failure message="nanf" type="WARN_NOT_NAN">
-assertion_macros.cpp(0):
-WARN_NOT_NAN( std::numeric_limits<float>::quiet_NaN() ) is NOT correct!
- values: WARN_NOT_NAN( nanf )
-
- </failure>
</testcase>
</testsuite>
</testsuites>
diff --git a/examples/all_features/test_output/assertion_macros.cpp_xml.txt b/examples/all_features/test_output/assertion_macros.cpp_xml.txt
index c0bfcd9..28e1033 100644
--- a/examples/all_features/test_output/assertion_macros.cpp_xml.txt
+++ b/examples/all_features/test_output/assertion_macros.cpp_xml.txt
@@ -578,17 +578,7 @@
:D
</Text>
</Message>
- <Message type="WARNING" filename="assertion_macros.cpp" line="0">
- <Text>
- :D
- </Text>
- </Message>
- <Message type="WARNING" filename="assertion_macros.cpp" line="0">
- <Text>
- :D
- </Text>
- </Message>
- <OverallResultsAsserts successes="11" failures="0" test_case_success="true"/>
+ <OverallResultsAsserts successes="9" failures="0" test_case_success="true"/>
</TestCase>
<TestCase name="check return values no print" filename="assertion_macros.cpp" line="0">
<Expression success="false" type="CHECK" filename="assertion_macros.cpp" line="0">
@@ -666,37 +656,10 @@
1
</ExpectedExceptionString>
</Expression>
- <Expression success="false" type="CHECK_NAN" filename="assertion_macros.cpp" line="0">
- <Original>
- 0.
- </Original>
- <Expanded>
- 0.0
- </Expanded>
- </Expression>
- <OverallResultsAsserts successes="0" failures="10" test_case_success="false"/>
- </TestCase>
- <TestCase name="nan" filename="assertion_macros.cpp" line="0">
- <Expression success="false" type="CHECK_NAN" filename="assertion_macros.cpp" line="0">
- <Original>
- std::numeric_limits<long double>::infinity()
- </Original>
- <Expanded>
- inf
- </Expanded>
- </Expression>
- <Expression success="false" type="WARN_NOT_NAN" filename="assertion_macros.cpp" line="0">
- <Original>
- std::numeric_limits<float>::quiet_NaN()
- </Original>
- <Expanded>
- nanf
- </Expanded>
- </Expression>
- <OverallResultsAsserts successes="3" failures="1" test_case_success="false"/>
+ <OverallResultsAsserts successes="0" failures="9" test_case_success="false"/>
</TestCase>
</TestSuite>
- <OverallResultsAsserts successes="49" failures="50"/>
- <OverallResultsTestCases successes="4" failures="20"/>
+ <OverallResultsAsserts successes="44" failures="48"/>
+ <OverallResultsTestCases successes="4" failures="19"/>
</doctest>
Program code.
diff --git a/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt b/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt
index f2d8577..9c09060 100644
--- a/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt
+++ b/examples/all_features/test_output/asserts_used_outside_of_tests.cpp.txt
@@ -14,5 +14,3 @@
values: CHECK( false )
hello!
asserts_used_outside_of_tests.cpp(24): ERROR: an assert dealing with exceptions has failed!
-asserts_used_outside_of_tests.cpp(25): ERROR: CHECK_NAN( 0. ) is NOT correct!
- values: CHECK_NAN( 0.0 )
diff --git a/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_junit.txt b/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_junit.txt
index 0b9472b..5727760 100644
--- a/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_junit.txt
+++ b/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_junit.txt
@@ -13,5 +13,3 @@
values: CHECK( false )
hello!
asserts_used_outside_of_tests.cpp(24): ERROR: an assert dealing with exceptions has failed!
-asserts_used_outside_of_tests.cpp(25): ERROR: CHECK_NAN( 0. ) is NOT correct!
- values: CHECK_NAN( 0.0 )
diff --git a/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_xml.txt b/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_xml.txt
index 935fda8..6490fb1 100644
--- a/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_xml.txt
+++ b/examples/all_features/test_output/asserts_used_outside_of_tests.cpp_xml.txt
@@ -15,5 +15,3 @@
values: CHECK( false )
hello!
asserts_used_outside_of_tests.cpp(24): ERROR: an assert dealing with exceptions has failed!
-asserts_used_outside_of_tests.cpp(25): ERROR: CHECK_NAN( 0. ) is NOT correct!
- values: CHECK_NAN( 0.0 )
diff --git a/examples/all_features/test_output/filter_2.txt b/examples/all_features/test_output/filter_2.txt
index 8618276..662a7e2 100644
--- a/examples/all_features/test_output/filter_2.txt
+++ b/examples/all_features/test_output/filter_2.txt
@@ -1,6 +1,6 @@
[doctest] run with "--help" for options
===============================================================================
-[doctest] test cases: 0 | 0 passed | 0 failed | 97 skipped
+[doctest] test cases: 0 | 0 passed | 0 failed | 96 skipped
[doctest] assertions: 0 | 0 passed | 0 failed |
[doctest] Status: SUCCESS!
Program code.
diff --git a/examples/all_features/test_output/filter_2_xml.txt b/examples/all_features/test_output/filter_2_xml.txt
index bb6bd65..8764a89 100644
--- a/examples/all_features/test_output/filter_2_xml.txt
+++ b/examples/all_features/test_output/filter_2_xml.txt
@@ -89,7 +89,6 @@
<TestCase name="namespace 7 member vs global" filename="namespace7.cpp" line="0" skipped="true"/>
<TestCase name="namespace 8 friend vs global" filename="namespace8.cpp" line="0" skipped="true"/>
<TestCase name="namespace 9 both global" filename="namespace9.cpp" line="0" skipped="true"/>
- <TestCase name="nan" filename="assertion_macros.cpp" line="0" skipped="true"/>
<TestCase name="no checks" filename="no_failures.cpp" line="0" skipped="true"/>
<TestCase name="normal macros" filename="assertion_macros.cpp" line="0" skipped="true"/>
</TestSuite>
@@ -137,6 +136,6 @@
<TestCase name="will end from an unknown exception" filename="coverage_maxout.cpp" line="0" skipped="true"/>
</TestSuite>
<OverallResultsAsserts successes="0" failures="0"/>
- <OverallResultsTestCases successes="0" failures="0" skipped="97"/>
+ <OverallResultsTestCases successes="0" failures="0" skipped="96"/>
</doctest>
Program code.
diff --git a/examples/all_features/test_output/stringification.cpp.txt b/examples/all_features/test_output/stringification.cpp.txt
index bdc5c5a..6ecf351 100644
--- a/examples/all_features/test_output/stringification.cpp.txt
+++ b/examples/all_features/test_output/stringification.cpp.txt
@@ -27,6 +27,12 @@
logged: s1=MyOtherType: 42 s2=MyOtherType: 666
MyOtherType: 42 is not really MyOtherType: 666
+stringification.cpp(0): ERROR: CHECK( doctest::IsNaN(0.5) ) is NOT correct!
+ values: CHECK( 0.5 )
+
+stringification.cpp(0): ERROR: CHECK( doctest::IsNaN(std::numeric_limits<float>::infinity()) ) is NOT correct!
+ values: CHECK( inf )
+
stringification.cpp(0): ERROR: test case THREW exception: MyTypeInherited<int>(5, 4)
===============================================================================
@@ -37,6 +43,6 @@
===============================================================================
[doctest] test cases: 2 | 0 passed | 2 failed |
-[doctest] assertions: 7 | 0 passed | 7 failed |
+[doctest] assertions: 9 | 0 passed | 9 failed |
[doctest] Status: FAILURE!
Program code.
diff --git a/examples/all_features/test_output/stringification.cpp_junit.txt b/examples/all_features/test_output/stringification.cpp_junit.txt
index 608cab1..9feb7cc 100644
--- a/examples/all_features/test_output/stringification.cpp_junit.txt
+++ b/examples/all_features/test_output/stringification.cpp_junit.txt
@@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<testsuites>
- <testsuite name="all_features" errors="2" failures="7" tests="7">
+ <testsuite name="all_features" errors="2" failures="9" tests="9">
<testcase classname="stringification.cpp" name="all asserts should fail and show how the objects get stringified" status="run">
<failure message="Foo{} == Foo{}" type="CHECK">
stringification.cpp(0):
@@ -47,6 +47,18 @@
MyOtherType: 42 is not really MyOtherType: 666
</failure>
+ <failure message="0.5" type="CHECK">
+stringification.cpp(0):
+CHECK( doctest::IsNaN(0.5) ) is NOT correct!
+ values: CHECK( 0.5 )
+
+ </failure>
+ <failure message="inf" type="CHECK">
+stringification.cpp(0):
+CHECK( doctest::IsNaN(std::numeric_limits<float>::infinity()) ) is NOT correct!
+ values: CHECK( inf )
+
+ </failure>
<error message="exception">
MyTypeInherited<int>(5, 4)
</error>
diff --git a/examples/all_features/test_output/stringification.cpp_xml.txt b/examples/all_features/test_output/stringification.cpp_xml.txt
index a3af67b..f167b7f 100644
--- a/examples/all_features/test_output/stringification.cpp_xml.txt
+++ b/examples/all_features/test_output/stringification.cpp_xml.txt
@@ -68,10 +68,26 @@
MyOtherType: 42 is not really MyOtherType: 666
</Info>
</Expression>
+ <Expression success="false" type="CHECK" filename="stringification.cpp" line="0">
+ <Original>
+ doctest::IsNaN(0.5)
+ </Original>
+ <Expanded>
+ 0.5
+ </Expanded>
+ </Expression>
+ <Expression success="false" type="CHECK" filename="stringification.cpp" line="0">
+ <Original>
+ doctest::IsNaN(std::numeric_limits<float>::infinity())
+ </Original>
+ <Expanded>
+ inf
+ </Expanded>
+ </Expression>
<Exception crash="false">
MyTypeInherited<int>(5, 4)
</Exception>
- <OverallResultsAsserts successes="0" failures="7" test_case_success="false"/>
+ <OverallResultsAsserts successes="0" failures="9" test_case_success="false"/>
</TestCase>
<TestCase name="a test case that registers an exception translator for int and then throws one" filename="stringification.cpp" line="0">
<Exception crash="false">
@@ -80,7 +96,7 @@
<OverallResultsAsserts successes="0" failures="0" test_case_success="false"/>
</TestCase>
</TestSuite>
- <OverallResultsAsserts successes="0" failures="7"/>
+ <OverallResultsAsserts successes="0" failures="9"/>
<OverallResultsTestCases successes="0" failures="2"/>
</doctest>
Program code.