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

Remove testing of CATCH_CONFIG_FALLBACK_STRINGIFIER from SelfTest

This removes a potential ODR violation and the configuration option
is tested in its own separate binary anyway.
Commit
d63681f707e9ec21b25ed4c73c811a1c299e38ce
Author
Martin Hořeňovský ·
Parents
2b696c43880c

Files · Download .tar.gz

Changes

 tests/SelfTest/Baselines/compact.sw.approved.txt  |  4 ++--
 tests/SelfTest/Baselines/console.sw.approved.txt  |  8 ++++----
 tests/SelfTest/Baselines/xml.sw.approved.txt      |  8 ++++----
 tests/SelfTest/UsageTests/ToStringWhich.tests.cpp | 14 ++------------
 4 files changed, 12 insertions(+), 22 deletions(-)

diff --git a/tests/SelfTest/Baselines/compact.sw.approved.txt b/tests/SelfTest/Baselines/compact.sw.approved.txt
index 0b2436ce..6bad3c92 100644
--- a/tests/SelfTest/Baselines/compact.sw.approved.txt
+++ b/tests/SelfTest/Baselines/compact.sw.approved.txt
@@ -1692,14 +1692,14 @@ ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(string
 ==
 "stringmaker(streamable_range)"
 ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }" for: "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" for: "{ !!! }" == "{ !!! }"
+ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(disabled_range{}) == "{?}" for: "{?}" == "{?}"
 ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>"
 ==
 "StringMaker<has_maker>"
 ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker_and_operator>" for: "StringMaker<has_maker_and_operator>"
 ==
 "StringMaker<has_maker_and_operator>"
-ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(item) == "{ !!! }" for: "{ !!! }" == "{ !!! }"
+ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(item) == "{?}" for: "{?}" == "{?}"
 ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )"
 ==
 "operator<<( has_operator )"
diff --git a/tests/SelfTest/Baselines/console.sw.approved.txt b/tests/SelfTest/Baselines/console.sw.approved.txt
index 42f94b55..6665214a 100644
--- a/tests/SelfTest/Baselines/console.sw.approved.txt
+++ b/tests/SelfTest/Baselines/console.sw.approved.txt
@@ -12545,9 +12545,9 @@ with expansion:
   "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }"
 
 ToStringWhich.tests.cpp:<line number>: PASSED:
-  REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" )
+  REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{?}" )
 with expansion:
-  "{ !!! }" == "{ !!! }"
+  "{?}" == "{?}"
 
 -------------------------------------------------------------------------------
 stringify( has_maker )
@@ -12582,9 +12582,9 @@ ToStringWhich.tests.cpp:<line number>
 ...............................................................................
 
 ToStringWhich.tests.cpp:<line number>: PASSED:
-  REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" )
+  REQUIRE( ::Catch::Detail::stringify(item) == "{?}" )
 with expansion:
-  "{ !!! }" == "{ !!! }"
+  "{?}" == "{?}"
 
 -------------------------------------------------------------------------------
 stringify( has_operator )
diff --git a/tests/SelfTest/Baselines/xml.sw.approved.txt b/tests/SelfTest/Baselines/xml.sw.approved.txt
index 934a593b..5b07c107 100644
--- a/tests/SelfTest/Baselines/xml.sw.approved.txt
+++ b/tests/SelfTest/Baselines/xml.sw.approved.txt
@@ -15098,10 +15098,10 @@ loose text artifact
       </Expression>
       <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
         <Original>
-          ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }"
+          ::Catch::Detail::stringify(disabled_range{}) == "{?}"
         </Original>
         <Expanded>
-          "{ !!! }" == "{ !!! }"
+          "{?}" == "{?}"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
@@ -15135,10 +15135,10 @@ loose text artifact
     <TestCase name="stringify( has_neither )" tags="[toString]" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
       <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" >
         <Original>
-          ::Catch::Detail::stringify(item) == "{ !!! }"
+          ::Catch::Detail::stringify(item) == "{?}"
         </Original>
         <Expanded>
-          "{ !!! }" == "{ !!! }"
+          "{?}" == "{?}"
         </Expanded>
       </Expression>
       <OverallResult success="true"/>
diff --git a/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp b/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp
index 4c10207e..7af8cc5b 100644
--- a/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp
+++ b/tests/SelfTest/UsageTests/ToStringWhich.tests.cpp
@@ -3,16 +3,6 @@
  * for various types
  */
 
-// Replace fallback stringifier for this TU
-// We should avoid ODR violations because these specific types aren't
-// present in different TUs
-#include <string>
-template <typename T>
-std::string fallbackStringifier(T const&) {
-    return "{ !!! }";
-}
-
-#define CATCH_CONFIG_FALLBACK_STRINGIFIER fallbackStringifier
 #include <catch2/catch_test_macros.hpp>
 
 
@@ -85,7 +75,7 @@ TEST_CASE( "stringify( has_maker_and_operator )", "[toString]" ) {
 
 TEST_CASE("stringify( has_neither )", "[toString]") {
     has_neither item;
-    REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" );
+    REQUIRE( ::Catch::Detail::stringify(item) == "{?}" );
 }
 
 // Call the templated operator
@@ -189,5 +179,5 @@ TEST_CASE("stringify ranges", "[toString]") {
     REQUIRE(::Catch::Detail::stringify(streamable_range{}) == "op<<(streamable_range)");
     REQUIRE(::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(streamable_range)");
     REQUIRE(::Catch::Detail::stringify(just_range{}) == "{ 1, 2, 3, 4 }");
-    REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{ !!! }");
+    REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{?}");
 }