diff options
| author | Phil Nash | 2015-07-23 18:45:31 +0100 |
|---|---|---|
| committer | Phil Nash | 2015-07-23 18:45:31 +0100 |
| commit | d6e59cd56f196eb40cbec3223531ee8d98e8ac8f (patch) | |
| tree | e6bafb739dcc4b21dd0aed347d050312cb6379b0 | |
| parent | 6de135c63aad8986cb28a88b988661de7fddf003 (diff) | |
| download | catch3-d6e59cd56f196eb40cbec3223531ee8d98e8ac8f.tar.gz | |
Fixed Xml encoding
- don't encode apostrophes
- only encode quotes in attributes
- encode control characters (as in PR #465)
| -rw-r--r-- | include/internal/catch_xmlwriter.hpp | 95 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/console.std.approved.txt | 4 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/console.sw.approved.txt | 126 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/junit.sw.approved.txt | 10 | ||||
| -rw-r--r-- | projects/SelfTest/Baselines/xml.sw.approved.txt | 943 | ||||
| -rw-r--r-- | projects/SelfTest/MiscTests.cpp | 37 |
6 files changed, 762 insertions, 453 deletions
diff --git a/include/internal/catch_xmlwriter.hpp b/include/internal/catch_xmlwriter.hpp index 3355f4d3..5f2e87e5 100644 --- a/include/internal/catch_xmlwriter.hpp +++ b/include/internal/catch_xmlwriter.hpp @@ -14,9 +14,65 @@ #include <sstream> #include <string> #include <vector> +#include <iomanip> namespace Catch { + class XmlEncode { + public: + enum ForWhat { ForTextNodes, ForAttributes }; + + XmlEncode( std::string const& str, ForWhat forWhat = ForTextNodes ) + : m_str( str ), + m_forWhat( forWhat ) + {} + + void encodeTo( std::ostream& os ) const { + + // Apostrophe escaping not necessary if we always use " to write attributes + // (see: http://www.w3.org/TR/xml/#syntax) + + for( std::size_t i = 0; i < m_str.size(); ++ i ) { + char c = m_str[i]; + switch( c ) { + case '<': os << "<"; break; + case '&': os << "&"; break; + + case '>': + // See: http://www.w3.org/TR/xml/#syntax + if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' ) + os << ">"; + else + os << c; + break; + + case '\"': + if( m_forWhat == ForAttributes ) + os << """; + else + os << c; + break; + + default: + // Escape control chars - based on contribution by @espenalb in PR #465 + if ( ( c < '\x09' ) || ( c > '\x0D' && c < '\x20') || c=='\x7F' ) + os << "&#x" << std::uppercase << std::hex << static_cast<int>( c ); + else + os << c; + } + } + } + + friend std::ostream& operator << ( std::ostream& os, XmlEncode const& xmlEncode ) { + xmlEncode.encodeTo( os ); + return os; + } + + private: + std::string m_str; + ForWhat m_forWhat; + }; + class XmlWriter { public: @@ -99,11 +155,8 @@ namespace Catch { } XmlWriter& writeAttribute( std::string const& name, std::string const& attribute ) { - if( !name.empty() && !attribute.empty() ) { - stream() << " " << name << "=\""; - writeEncodedText( attribute ); - stream() << "\""; - } + if( !name.empty() && !attribute.empty() ) + stream() << " " << name << "=\"" << XmlEncode( attribute, XmlEncode::ForAttributes ) << "\""; return *this; } @@ -114,9 +167,9 @@ namespace Catch { template<typename T> XmlWriter& writeAttribute( std::string const& name, T const& attribute ) { - if( !name.empty() ) - stream() << " " << name << "=\"" << attribute << "\""; - return *this; + std::ostringstream oss; + oss << attribute; + return writeAttribute( name, oss.str() ); } XmlWriter& writeText( std::string const& text, bool indent = true ) { @@ -125,7 +178,7 @@ namespace Catch { ensureTagClosed(); if( tagWasOpen && indent ) stream() << m_indent; - writeEncodedText( text ); + stream() << XmlEncode( text ); m_needsNewline = true; } return *this; @@ -170,30 +223,6 @@ namespace Catch { } } - void writeEncodedText( std::string const& text ) { - static const char* charsToEncode = "<&\""; - std::string mtext = text; - std::string::size_type pos = mtext.find_first_of( charsToEncode ); - while( pos != std::string::npos ) { - stream() << mtext.substr( 0, pos ); - - switch( mtext[pos] ) { - case '<': - stream() << "<"; - break; - case '&': - stream() << "&"; - break; - case '\"': - stream() << """; - break; - } - mtext = mtext.substr( pos+1 ); - pos = mtext.find_first_of( charsToEncode ); - } - stream() << mtext; - } - bool m_tagIsOpen; bool m_needsNewline; std::vector<std::string> m_tags; diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index 67fb8437..3aa3ae86 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -797,6 +797,6 @@ with expansion: "first" == "second" =============================================================================== -test cases: 157 | 117 passed | 39 failed | 1 failed as expected -assertions: 773 | 680 passed | 80 failed | 13 failed as expected +test cases: 158 | 118 passed | 39 failed | 1 failed as expected +assertions: 783 | 690 passed | 80 failed | 13 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index 7d41c5a7..238450b0 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -3763,6 +3763,128 @@ with expansion: ""wide load"" == ""wide load"" ------------------------------------------------------------------------------- +XmlEncode + normal string +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "normal string" ) == "normal string" ) +with expansion: + "normal string" == "normal string" + +------------------------------------------------------------------------------- +XmlEncode + empty string +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "" ) == "" ) +with expansion: + "" == "" + +------------------------------------------------------------------------------- +XmlEncode + string with ampersand +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "smith & jones" ) == "smith & jones" ) +with expansion: + "smith & jones" == "smith & jones" + +------------------------------------------------------------------------------- +XmlEncode + string with less-than +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "smith < jones" ) == "smith < jones" ) +with expansion: + "smith < jones" == "smith < jones" + +------------------------------------------------------------------------------- +XmlEncode + string with greater-than +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "smith > jones" ) == "smith > jones" ) +with expansion: + "smith > jones" == "smith > jones" + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "smith ]]> jones" ) == "smith ]]> jones" ) +with expansion: + "smith ]]> jones" + == + "smith ]]> jones" + +------------------------------------------------------------------------------- +XmlEncode + string with quotes +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( stringWithQuotes ) == stringWithQuotes ) +with expansion: + "don't "quote" me on that" + == + "don't "quote" me on that" + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( stringWithQuotes, Catch::XmlEncode::ForAttributes ) == "don't "quote" me on that" ) +with expansion: + "don't "quote" me on that" + == + "don't "quote" me on that" + +------------------------------------------------------------------------------- +XmlEncode + string with control char (1) +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "[\x01]" ) == "[]" ) +with expansion: + "[]" == "[]" + +------------------------------------------------------------------------------- +XmlEncode + string with control char (x7F) +------------------------------------------------------------------------------- +MiscTests.cpp:<line number> +............................................................................... + +MiscTests.cpp:<line number>: +PASSED: + REQUIRE( encode( "[\x7F]" ) == "[]" ) +with expansion: + "[]" == "[]" + +------------------------------------------------------------------------------- Process can be configured on command line default - no arguments ------------------------------------------------------------------------------- @@ -8004,6 +8126,6 @@ with expansion: true =============================================================================== -test cases: 157 | 101 passed | 55 failed | 1 failed as expected -assertions: 793 | 680 passed | 100 failed | 13 failed as expected +test cases: 158 | 102 passed | 55 failed | 1 failed as expected +assertions: 803 | 690 passed | 100 failed | 13 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index cd978bfb..deae7529 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,5 +1,5 @@ <testsuites> - <testsuite name="all tests" errors="12" failures="88" tests="793" hostname="tbd" time="{duration}" timestamp="tbd"> + <testsuite name="all tests" errors="12" failures="88" tests="803" hostname="tbd" time="{duration}" timestamp="tbd"> <testcase classname="global" name="toString(enum)" time="{duration}"/> <testcase classname="global" name="toString(enum w/operator<<)" time="{duration}"/> <testcase classname="global" name="toString(enum class)" time="{duration}"/> @@ -463,6 +463,14 @@ MiscTests.cpp:<line number> <testcase classname="global" name="toString on const wchar_t pointer returns the string contents" time="{duration}"/> <testcase classname="global" name="toString on wchar_t const pointer returns the string contents" time="{duration}"/> <testcase classname="global" name="toString on wchar_t returns the string contents" time="{duration}"/> + <testcase classname="XmlEncode" name="normal string" time="{duration}"/> + <testcase classname="XmlEncode" name="empty string" time="{duration}"/> + <testcase classname="XmlEncode" name="string with ampersand" time="{duration}"/> + <testcase classname="XmlEncode" name="string with less-than" time="{duration}"/> + <testcase classname="XmlEncode" name="string with greater-than" time="{duration}"/> + <testcase classname="XmlEncode" name="string with quotes" time="{duration}"/> + <testcase classname="XmlEncode" name="string with control char (1)" time="{duration}"/> + <testcase classname="XmlEncode" name="string with control char (x7F)" time="{duration}"/> <testcase classname="Process can be configured on command line" name="default - no arguments" time="{duration}"/> <testcase classname="Process can be configured on command line" name="test lists/1 test" time="{duration}"/> <testcase classname="Process can be configured on command line" name="test lists/Specify one test case exclusion using exclude:" time="{duration}"/> diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 654061f2..10b826c2 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -3,18 +3,18 @@ <TestCase name="toString(enum)"> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e0) == "0" + Catch::toString(e0) == "0" </Original> <Expanded> - "0" == "0" + "0" == "0" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e1) == "1" + Catch::toString(e1) == "1" </Original> <Expanded> - "1" == "1" + "1" == "1" </Expanded> </Expression> <OverallResult success="true"/> @@ -22,18 +22,18 @@ <TestCase name="toString(enum w/operator<<)"> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e0) == "E2{0}" + Catch::toString(e0) == "E2{0}" </Original> <Expanded> - "E2{0}" == "E2{0}" + "E2{0}" == "E2{0}" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e1) == "E2{1}" + Catch::toString(e1) == "E2{1}" </Original> <Expanded> - "E2{1}" == "E2{1}" + "E2{1}" == "E2{1}" </Expanded> </Expression> <OverallResult success="true"/> @@ -41,18 +41,18 @@ <TestCase name="toString(enum class)"> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e0) == "0" + Catch::toString(e0) == "0" </Original> <Expanded> - "0" == "0" + "0" == "0" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e1) == "1" + Catch::toString(e1) == "1" </Original> <Expanded> - "1" == "1" + "1" == "1" </Expanded> </Expression> <OverallResult success="true"/> @@ -60,28 +60,28 @@ <TestCase name="toString(enum class w/operator<<)"> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e0) == "E2/V0" + Catch::toString(e0) == "E2/V0" </Original> <Expanded> - "E2/V0" == "E2/V0" + "E2/V0" == "E2/V0" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e1) == "E2/V1" + Catch::toString(e1) == "E2/V1" </Original> <Expanded> - "E2/V1" == "E2/V1" + "E2/V1" == "E2/V1" </Expanded> </Expression> <Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" > <Original> - Catch::toString(e3) == "Unknown enum value 10" + Catch::toString(e3) == "Unknown enum value 10" </Original> <Expanded> - "Unknown enum value 10" + "Unknown enum value 10" == -"Unknown enum value 10" +"Unknown enum value 10" </Expanded> </Expression> <OverallResult success="true"/> @@ -326,10 +326,10 @@ <TestCase name="A METHOD_AS_TEST_CASE based test run that succeeds"> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ClassTests.cpp" > <Original> - s == "hello" + s == "hello" </Original> <Expanded> - "hello" == "hello" + "hello" == "hello" </Expanded> </Expression> <OverallResult success="true"/> @@ -337,10 +337,10 @@ <TestCase name="A METHOD_AS_TEST_CASE based test run that fails"> <Expression success="false" type="REQUIRE" filename="projects/SelfTest/ClassTests.cpp" > <Original> - s == "world" + s == "world" </Original> <Expanded> - "hello" == "world" + "hello" == "world" </Expanded> </Expression> <OverallResult success="false"/> @@ -394,18 +394,18 @@ </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello == "hello" + data.str_hello == "hello" </Original> <Expanded> - "hello" == "hello" + "hello" == "hello" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - "hello" == data.str_hello + "hello" == data.str_hello </Original> <Expanded> - "hello" == "hello" + "hello" == "hello" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > @@ -493,26 +493,26 @@ </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello == "goodbye" + data.str_hello == "goodbye" </Original> <Expanded> - "hello" == "goodbye" + "hello" == "goodbye" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello == "hell" + data.str_hello == "hell" </Original> <Expanded> - "hello" == "hell" + "hello" == "hell" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello == "hello1" + data.str_hello == "hello1" </Original> <Expanded> - "hello" == "hello1" + "hello" == "hello1" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > @@ -592,26 +592,26 @@ </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello != "goodbye" + data.str_hello != "goodbye" </Original> <Expanded> - "hello" != "goodbye" + "hello" != "goodbye" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello != "hell" + data.str_hello != "hell" </Original> <Expanded> - "hello" != "hell" + "hello" != "hell" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello != "hello1" + data.str_hello != "hello1" </Original> <Expanded> - "hello" != "hello1" + "hello" != "hello1" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > @@ -651,10 +651,10 @@ </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello != "hello" + data.str_hello != "hello" </Original> <Expanded> - "hello" != "hello" + "hello" != "hello" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > @@ -758,50 +758,50 @@ </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello <= "hello" + data.str_hello <= "hello" </Original> <Expanded> - "hello" <= "hello" + "hello" <= "hello" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello >= "hello" + data.str_hello >= "hello" </Original> <Expanded> - "hello" >= "hello" + "hello" >= "hello" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello < "hellp" + data.str_hello < "hellp" </Original> <Expanded> - "hello" < "hellp" + "hello" < "hellp" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello < "zebra" + data.str_hello < "zebra" </Original> <Expanded> - "hello" < "zebra" + "hello" < "zebra" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello > "hellm" + data.str_hello > "hellm" </Original> <Expanded> - "hello" > "hellm" + "hello" > "hellm" </Expanded> </Expression> <Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello > "a" + data.str_hello > "a" </Original> <Expanded> - "hello" > "a" + "hello" > "a" </Expanded> </Expression> <OverallResult success="true"/> @@ -897,66 +897,66 @@ </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello > "hello" + data.str_hello > "hello" </Original> <Expanded> - "hello" > "hello" + "hello" > "hello" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello < "hello" + data.str_hello < "hello" </Original> <Expanded> - "hello" < "hello" + "hello" < "hello" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello > "hellp" + data.str_hello > "hellp" </Original> <Expanded> - "hello" > "hellp" + "hello" > "hellp" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello > "z" + data.str_hello > "z" </Original> <Expanded> - "hello" > "z" + "hello" > "z" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello < "hellm" + data.str_hello < "hellm" </Original> <Expanded> - "hello" < "hellm" + "hello" < "hellm" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello < "a" + data.str_hello < "a" </Original> <Expanded> - "hello" < "a" + "hello" < "a" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello >= "z" + data.str_hello >= "z" </Original> <Expanded> - "hello" >= "z" + "hello" >= "z" </Expanded> </Expression> <Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" > <Original> - data.str_hello <= "a" + data.str_hello <= "a" </Original> <Expanded> - "hello" <= "a" + "hello" <= "a" </Expanded> </Expression> <OverallResult success="false"/> @@ -1600,10 +1600,10 @@ <Section name="exact match"> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), "expected exception" + thisThrows(), "expected exception" </Original> <Expanded> - thisThrows(), "expected exception" + thisThrows(), "expected exception" </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> @@ -1611,10 +1611,10 @@ <Section name="different case"> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) + thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) </Original> <Expanded> - thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) + thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No ) </Expanded> </Expression> <OverallResults successes="1" failures="0" expectedFailures="0"/> @@ -1622,34 +1622,34 @@ <Section name="wildcarded"> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), StartsWith( "expected" ) + thisThrows(), StartsWith( "expected" ) </Original> <Expanded> - thisThrows(), StartsWith( "expected" ) + thisThrows(), StartsWith( "expected" ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), EndsWith( "exception" ) + thisThrows(), EndsWith( "exception" ) </Original> <Expanded> - thisThrows(), EndsWith( "exception" ) + thisThrows(), EndsWith( "exception" ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), Contains( "except" ) + thisThrows(), Contains( "except" ) </Original> <Expanded> - thisThrows(), Contains( "except" ) + thisThrows(), Contains( "except" ) </Expanded> </Expression> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) + thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) </Original> <Expanded> - thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) + thisThrows(), Contains( "exCept", Catch::CaseSensitive::No ) </Expanded> </Expression> <OverallResults successes="4" failures="0" expectedFailures="0"/> @@ -1659,15 +1659,15 @@ <TestCase name="Mismatching exception messages failing the test"> <Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), "expected exception" + thisThrows(), "expected exception" </Original> <Expanded> - thisThrows(), "expected exception" + thisThrows(), "expected exception" </Expanded> </Expression> <Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" > <Original> - thisThrows(), "should fail" + thisThrows(), "should fail" </Original> <Expanded> expected exception @@ -3308,7 +3308,7 @@ makeString( false ) != static_cast<char*>(nullptr) </Original> <Expanded> - "valid string" != {null string} + "valid string" != {null string} </Expa |