Progmasoft Git

catch3

Progmasoft Catch3: an independently maintained C++17 test framework with a parallel runner, property checks, snapshots and structured results.

Clonegit clone https://git.progmasoft.com/catch3

Add more weird chrono::duration stringification tests

Commit
8c32d0b6442bc7075bb27a36d0a28df9f8b5d5ae
Author
Martin Hořeňovský ·
Parents
28d1955ea819

Files · Download .tar.gz

Changes

 projects/SelfTest/Baselines/console.std.approved.txt  |  2 +-
 projects/SelfTest/Baselines/console.sw.approved.txt   |  8 +++++++-
 projects/SelfTest/Baselines/junit.sw.approved.txt     |  2 +-
 projects/SelfTest/Baselines/xml.sw.approved.txt       | 12 ++++++++++--
 projects/SelfTest/UsageTests/ToStringChrono.tests.cpp |  3 +++
 5 files changed, 22 insertions(+), 5 deletions(-)

diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt
index 66488a4e..4b96e2f4 100644
--- a/projects/SelfTest/Baselines/console.std.approved.txt
+++ b/projects/SelfTest/Baselines/console.std.approved.txt
@@ -1053,5 +1053,5 @@ with expansion:
 
 ===============================================================================
 test cases: 191 | 139 passed |  48 failed |  4 failed as expected
-assertions: 954 | 830 passed | 103 failed | 21 failed as expected
+assertions: 955 | 831 passed | 103 failed | 21 failed as expected
 
diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt
index 31c60d0a..083d8dc0 100644
--- a/projects/SelfTest/Baselines/console.sw.approved.txt
+++ b/projects/SelfTest/Baselines/console.sw.approved.txt
@@ -5127,6 +5127,12 @@ PASSED:
 with expansion:
   1 [30/1]s != 1 fs
 
+ToStringChrono.tests.cpp:<line number>:
+PASSED:
+  REQUIRE( pico_second != atto_second )
+with expansion:
+  1 ps != 1 as
+
 -------------------------------------------------------------------------------
 Stringifying std::chrono::time_point<system_clock>
 -------------------------------------------------------------------------------
@@ -8004,5 +8010,5 @@ PASSED:
 
 ===============================================================================
 test cases: 191 | 137 passed |  50 failed |  4 failed as expected
-assertions: 953 | 826 passed | 106 failed | 21 failed as expected
+assertions: 954 | 827 passed | 106 failed | 21 failed as expected
 
diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt
index 54598096..dbb424a3 100644
--- a/projects/SelfTest/Baselines/junit.sw.approved.txt
+++ b/projects/SelfTest/Baselines/junit.sw.approved.txt
@@ -1,7 +1,7 @@
 <?xml version="1.0" encoding="UTF-8"?>
 <testsuitesloose text artifact
 >
-  <testsuite name="<exe-name>" errors="15" failures="92" tests="954" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}">
+  <testsuite name="<exe-name>" errors="15" failures="92" tests="955" 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="#1027" time="{duration}"/>
diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt
index 4ae2e015..be6c4f30 100644
--- a/projects/SelfTest/Baselines/xml.sw.approved.txt
+++ b/projects/SelfTest/Baselines/xml.sw.approved.txt
@@ -5878,6 +5878,14 @@ Message from section two
           1 [30/1]s != 1 fs
         </Expanded>
       </Expression>
+      <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
+        <Original>
+          pico_second != atto_second
+        </Original>
+        <Expanded>
+          1 ps != 1 as
+        </Expanded>
+      </Expression>
       <OverallResult success="true"/>
     </TestCase>
     <TestCase name="Stringifying std::chrono::time_point&lt;system_clock>" tags="[chrono][toString]" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" >
@@ -8889,7 +8897,7 @@ loose text artifact
       </Section>
       <OverallResult success="true"/>
     </TestCase>
-    <OverallResults successes="826" failures="107" expectedFailures="21"/>
+    <OverallResults successes="827" failures="107" expectedFailures="21"/>
   </Group>
-  <OverallResults successes="826" failures="106" expectedFailures="21"/>
+  <OverallResults successes="827" failures="106" expectedFailures="21"/>
 </Catch>
diff --git a/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp b/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp
index 97d0c1cb..c2c0829f 100644
--- a/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp
+++ b/projects/SelfTest/UsageTests/ToStringChrono.tests.cpp
@@ -20,8 +20,11 @@ TEST_CASE("Stringifying std::chrono::duration helpers", "[toString][chrono]") {
 
 TEST_CASE("Stringifying std::chrono::duration with weird ratios", "[toString][chrono]") {
     std::chrono::duration<int64_t, std::ratio<30>> half_minute(1);
+    std::chrono::duration<int64_t, std::ratio<1, 1000000000000>> pico_second(1);
     std::chrono::duration<int64_t, std::ratio<1, 1000000000000000>> femto_second(1);
+    std::chrono::duration<int64_t, std::ratio<1, 1000000000000000000>> atto_second(1);
     REQUIRE(half_minute != femto_second);
+    REQUIRE(pico_second != atto_second);
 }
 
 TEST_CASE("Stringifying std::chrono::time_point<system_clock>", "[toString][chrono]") {