mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 12:17:11 +01:00 
			
		
		
		
	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.
This commit is contained in:
		| @@ -1692,14 +1692,14 @@ ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify(string | |||||||
| == | == | ||||||
| "stringmaker(streamable_range)" | "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(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>" | ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "StringMaker<has_maker>" for: "StringMaker<has_maker>" | ||||||
| == | == | ||||||
| "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>" | 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>" | "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 )" | ToStringWhich.tests.cpp:<line number>: passed: ::Catch::Detail::stringify( item ) == "operator<<( has_operator )" for: "operator<<( has_operator )" | ||||||
| == | == | ||||||
| "operator<<( has_operator )" | "operator<<( has_operator )" | ||||||
|   | |||||||
| @@ -12545,9 +12545,9 @@ with expansion: | |||||||
|   "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" |   "{ 1, 2, 3, 4 }" == "{ 1, 2, 3, 4 }" | ||||||
|  |  | ||||||
| ToStringWhich.tests.cpp:<line number>: PASSED: | ToStringWhich.tests.cpp:<line number>: PASSED: | ||||||
|   REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" ) |   REQUIRE( ::Catch::Detail::stringify(disabled_range{}) == "{?}" ) | ||||||
| with expansion: | with expansion: | ||||||
|   "{ !!! }" == "{ !!! }" |   "{?}" == "{?}" | ||||||
|  |  | ||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||||||
| stringify( has_maker ) | stringify( has_maker ) | ||||||
| @@ -12582,9 +12582,9 @@ ToStringWhich.tests.cpp:<line number> | |||||||
| ............................................................................... | ............................................................................... | ||||||
|  |  | ||||||
| ToStringWhich.tests.cpp:<line number>: PASSED: | ToStringWhich.tests.cpp:<line number>: PASSED: | ||||||
|   REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" ) |   REQUIRE( ::Catch::Detail::stringify(item) == "{?}" ) | ||||||
| with expansion: | with expansion: | ||||||
|   "{ !!! }" == "{ !!! }" |   "{?}" == "{?}" | ||||||
|  |  | ||||||
| ------------------------------------------------------------------------------- | ------------------------------------------------------------------------------- | ||||||
| stringify( has_operator ) | stringify( has_operator ) | ||||||
|   | |||||||
| @@ -15098,10 +15098,10 @@ loose text artifact | |||||||
|       </Expression> |       </Expression> | ||||||
|       <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > |       <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > | ||||||
|         <Original> |         <Original> | ||||||
|           ::Catch::Detail::stringify(disabled_range{}) == "{ !!! }" |           ::Catch::Detail::stringify(disabled_range{}) == "{?}" | ||||||
|         </Original> |         </Original> | ||||||
|         <Expanded> |         <Expanded> | ||||||
|           "{ !!! }" == "{ !!! }" |           "{?}" == "{?}" | ||||||
|         </Expanded> |         </Expanded> | ||||||
|       </Expression> |       </Expression> | ||||||
|       <OverallResult success="true"/> |       <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" > |     <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" > |       <Expression success="true" type="REQUIRE" filename="tests/<exe-name>/UsageTests/ToStringWhich.tests.cpp" > | ||||||
|         <Original> |         <Original> | ||||||
|           ::Catch::Detail::stringify(item) == "{ !!! }" |           ::Catch::Detail::stringify(item) == "{?}" | ||||||
|         </Original> |         </Original> | ||||||
|         <Expanded> |         <Expanded> | ||||||
|           "{ !!! }" == "{ !!! }" |           "{?}" == "{?}" | ||||||
|         </Expanded> |         </Expanded> | ||||||
|       </Expression> |       </Expression> | ||||||
|       <OverallResult success="true"/> |       <OverallResult success="true"/> | ||||||
|   | |||||||
| @@ -3,16 +3,6 @@ | |||||||
|  * for various types |  * 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> | #include <catch2/catch_test_macros.hpp> | ||||||
|  |  | ||||||
|  |  | ||||||
| @@ -85,7 +75,7 @@ TEST_CASE( "stringify( has_maker_and_operator )", "[toString]" ) { | |||||||
|  |  | ||||||
| TEST_CASE("stringify( has_neither )", "[toString]") { | TEST_CASE("stringify( has_neither )", "[toString]") { | ||||||
|     has_neither item; |     has_neither item; | ||||||
|     REQUIRE( ::Catch::Detail::stringify(item) == "{ !!! }" ); |     REQUIRE( ::Catch::Detail::stringify(item) == "{?}" ); | ||||||
| } | } | ||||||
|  |  | ||||||
| // Call the templated operator | // 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(streamable_range{}) == "op<<(streamable_range)"); | ||||||
|     REQUIRE(::Catch::Detail::stringify(stringmaker_range{}) == "stringmaker(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(just_range{}) == "{ 1, 2, 3, 4 }"); | ||||||
|     REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{ !!! }"); |     REQUIRE(::Catch::Detail::stringify(disabled_range{}) == "{?}"); | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský