mirror of
				https://github.com/catchorg/Catch2.git
				synced 2025-10-31 20:27:11 +01:00 
			
		
		
		
	StringRef will not take ownership when writing itself to stream
This also fixes some tests that were previously failing unnoticed - WTF?
This commit is contained in:
		| @@ -627,7 +627,10 @@ String.tests.cpp:<line number>: passed: isOwned( s ) == false for: false == fals | ||||
| String.tests.cpp:<line number>: passed: s.c_str() == rawChars for: "hello" == "hello" | ||||
| String.tests.cpp:<line number>: passed: isOwned( s ) == false for: false == false | ||||
| String.tests.cpp:<line number>: passed: original == "original" | ||||
| String.tests.cpp:<line number>: failed: isSubstring( original ) for: false | ||||
| String.tests.cpp:<line number>: passed: isSubstring( original ) for: true | ||||
| String.tests.cpp:<line number>: passed: isOwned( original ) == false for: false == false | ||||
| String.tests.cpp:<line number>: passed: isSubstring( original ) == false for: false == false | ||||
| String.tests.cpp:<line number>: passed: isOwned( original ) for: true | ||||
| String.tests.cpp:<line number>: passed: ss.empty() == false for: false == false | ||||
| String.tests.cpp:<line number>: passed: ss.size() == 5 for: 5 == 5 | ||||
| String.tests.cpp:<line number>: passed: std::strcmp( ss.c_str(), "hello" ) == 0 for: 0 == 0 | ||||
| @@ -1077,5 +1080,5 @@ Misc.tests.cpp:<line number>: passed: v.size() == 5 for: 5 == 5 | ||||
| Misc.tests.cpp:<line number>: passed: v.capacity() >= 5 for: 5 >= 5 | ||||
| Misc.tests.cpp:<line number>: passed: | ||||
| Misc.tests.cpp:<line number>: passed: | ||||
| Failed 63 test cases, failed 122 assertions. | ||||
| Failed 62 test cases, failed 121 assertions. | ||||
|  | ||||
|   | ||||
| @@ -4998,10 +4998,29 @@ String.tests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( original == "original" ) | ||||
|  | ||||
| String.tests.cpp:<line number>: FAILED: | ||||
| String.tests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( isSubstring( original ) ) | ||||
| with expansion: | ||||
|   false | ||||
|   true | ||||
|  | ||||
| String.tests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( isOwned( original ) == false ) | ||||
| with expansion: | ||||
|   false == false | ||||
|  | ||||
| String.tests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( isSubstring( original ) == false ) | ||||
| with expansion: | ||||
|   false == false | ||||
|  | ||||
| String.tests.cpp:<line number>: | ||||
| PASSED: | ||||
|   REQUIRE( isOwned( original ) ) | ||||
| with expansion: | ||||
|   true | ||||
|  | ||||
| ------------------------------------------------------------------------------- | ||||
| StringRef | ||||
| @@ -8531,6 +8550,6 @@ Misc.tests.cpp:<line number>: | ||||
| PASSED: | ||||
|  | ||||
| =============================================================================== | ||||
| test cases:  202 | 135 passed |  63 failed |  4 failed as expected | ||||
| assertions: 1018 | 875 passed | 122 failed | 21 failed as expected | ||||
| test cases:  202 | 136 passed |  62 failed |  4 failed as expected | ||||
| assertions: 1021 | 879 passed | 121 failed | 21 failed as expected | ||||
|  | ||||
|   | ||||
| @@ -1,7 +1,7 @@ | ||||
| <?xml version="1.0" encoding="UTF-8"?> | ||||
| <testsuitesloose text artifact | ||||
| > | ||||
|   <testsuite name="<exe-name>" errors="17" failures="106" tests="1019" hostname="tbd" time="{duration}" timestamp="{iso8601-timestamp}"> | ||||
|   <testsuite name="<exe-name>" errors="17" failures="105" tests="1022" 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}"/> | ||||
| @@ -546,11 +546,7 @@ Matchers.tests.cpp:<line number> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/Empty string" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/From string literal" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/From string literal/c_str() does not cause copy" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}"> | ||||
|       <failure message="false" type="REQUIRE"> | ||||
| String.tests.cpp:<line number> | ||||
|       </failure> | ||||
|     </testcase> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/From sub-string" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/Substrings/zero-based substring" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/Substrings/c_str() causes copy" time="{duration}"/> | ||||
|     <testcase classname="<exe-name>.global" name="StringRef/Substrings/non-zero-based substring" time="{duration}"/> | ||||
|   | ||||
| @@ -5716,15 +5716,39 @@ Message from section two | ||||
|             original == "original" | ||||
|           </Expanded> | ||||
|         </Expression> | ||||
|         <Expression success="false" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
|         <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
|           <Original> | ||||
|             isSubstring( original ) | ||||
|           </Original> | ||||
|           <Expanded> | ||||
|             false | ||||
|             true | ||||
|           </Expanded> | ||||
|         </Expression> | ||||
|         <OverallResults successes="1" failures="1" expectedFailures="0"/> | ||||
|         <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
|           <Original> | ||||
|             isOwned( original ) == false | ||||
|           </Original> | ||||
|           <Expanded> | ||||
|             false == false | ||||
|           </Expanded> | ||||
|         </Expression> | ||||
|         <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
|           <Original> | ||||
|             isSubstring( original ) == false | ||||
|           </Original> | ||||
|           <Expanded> | ||||
|             false == false | ||||
|           </Expanded> | ||||
|         </Expression> | ||||
|         <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
|           <Original> | ||||
|             isOwned( original ) | ||||
|           </Original> | ||||
|           <Expanded> | ||||
|             true | ||||
|           </Expanded> | ||||
|         </Expression> | ||||
|         <OverallResults successes="5" failures="0" expectedFailures="0"/> | ||||
|       </Section> | ||||
|       <Section name="Substrings" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
|         <Section name="zero-based substring" filename="projects/<exe-name>/IntrospectiveTests/String.tests.cpp" > | ||||
| @@ -6054,7 +6078,7 @@ Message from section two | ||||
|         </Expression> | ||||
|         <OverallResults successes="3" failures="0" expectedFailures="0"/> | ||||
|       </Section> | ||||
|       <OverallResult success="false"/> | ||||
|       <OverallResult success="true"/> | ||||
|     </TestCase> | ||||
|     <TestCase name="Stringifying std::chrono::duration helpers" tags="[chrono][toString]" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > | ||||
|       <Expression success="true" type="REQUIRE" filename="projects/<exe-name>/UsageTests/ToStringChrono.tests.cpp" > | ||||
| @@ -9381,7 +9405,7 @@ loose text artifact | ||||
|       </Section> | ||||
|       <OverallResult success="true"/> | ||||
|     </TestCase> | ||||
|     <OverallResults successes="875" failures="123" expectedFailures="21"/> | ||||
|     <OverallResults successes="879" failures="122" expectedFailures="21"/> | ||||
|   </Group> | ||||
|   <OverallResults successes="875" failures="122" expectedFailures="21"/> | ||||
|   <OverallResults successes="879" failures="121" expectedFailures="21"/> | ||||
| </Catch> | ||||
|   | ||||
		Reference in New Issue
	
	Block a user
	 Martin Hořeňovský
					Martin Hořeňovský