Read-only mirrors. Development, issues and pull requests are on GitHub.

summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorPhil Nash2015-07-23 18:45:31 +0100
committerPhil Nash2015-07-23 18:45:31 +0100
commitd6e59cd56f196eb40cbec3223531ee8d98e8ac8f (patch)
treee6bafb739dcc4b21dd0aed347d050312cb6379b0
parent6de135c63aad8986cb28a88b988661de7fddf003 (diff)
downloadcatch3-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.hpp95
-rw-r--r--projects/SelfTest/Baselines/console.std.approved.txt4
-rw-r--r--projects/SelfTest/Baselines/console.sw.approved.txt126
-rw-r--r--projects/SelfTest/Baselines/junit.sw.approved.txt10
-rw-r--r--projects/SelfTest/Baselines/xml.sw.approved.txt943
-rw-r--r--projects/SelfTest/MiscTests.cpp37
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 << "&lt;"; break;
+ case '&': os << "&amp;"; break;
+
+ case '>':
+ // See: http://www.w3.org/TR/xml/#syntax
+ if( i > 2 && m_str[i-1] == ']' && m_str[i-2] == ']' )
+ os << "&gt;";
+ else
+ os << c;
+ break;
+
+ case '\"':
+ if( m_forWhat == ForAttributes )
+ os << "&quot;";
+ 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() << "&lt;";
- break;
- case '&':
- stream() << "&amp;";
- break;
- case '\"':
- stream() << "&quot;";
- 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 &amp; jones" )
+with expansion:
+ "smith &amp; jones" == "smith &amp; jones"
+
+-------------------------------------------------------------------------------
+XmlEncode
+ string with less-than
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+ REQUIRE( encode( "smith < jones" ) == "smith &lt; jones" )
+with expansion:
+ "smith &lt; jones" == "smith &lt; 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 ]]&gt; jones" )
+with expansion:
+ "smith ]]&gt; jones"
+ ==
+ "smith ]]&gt; 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 &quot;quote&quot; me on that" )
+with expansion:
+ "don't &quot;quote&quot; me on that"
+ ==
+ "don't &quot;quote&quot; me on that"
+
+-------------------------------------------------------------------------------
+XmlEncode
+ string with control char (1)
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+ REQUIRE( encode( "[\x01]" ) == "[&#x1]" )
+with expansion:
+ "[&#x1]" == "[&#x1]"
+
+-------------------------------------------------------------------------------
+XmlEncode
+ string with control char (x7F)
+-------------------------------------------------------------------------------
+MiscTests.cpp:<line number>
+...............................................................................
+
+MiscTests.cpp:<line number>:
+PASSED:
+ REQUIRE( encode( "[\x7F]" ) == "[&#x7F]" )
+with expansion:
+ "[&#x7F]" == "[&#x7F]"
+
+-------------------------------------------------------------------------------
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&lt;&lt;)" 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) == &quot;0&quot;
+ Catch::toString(e0) == "0"
</Original>
<Expanded>
- &quot;0&quot; == &quot;0&quot;
+ "0" == "0"
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e1) == &quot;1&quot;
+ Catch::toString(e1) == "1"
</Original>
<Expanded>
- &quot;1&quot; == &quot;1&quot;
+ "1" == "1"
</Expanded>
</Expression>
<OverallResult success="true"/>
@@ -22,18 +22,18 @@
<TestCase name="toString(enum w/operator&lt;&lt;)">
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e0) == &quot;E2{0}&quot;
+ Catch::toString(e0) == "E2{0}"
</Original>
<Expanded>
- &quot;E2{0}&quot; == &quot;E2{0}&quot;
+ "E2{0}" == "E2{0}"
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e1) == &quot;E2{1}&quot;
+ Catch::toString(e1) == "E2{1}"
</Original>
<Expanded>
- &quot;E2{1}&quot; == &quot;E2{1}&quot;
+ "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) == &quot;0&quot;
+ Catch::toString(e0) == "0"
</Original>
<Expanded>
- &quot;0&quot; == &quot;0&quot;
+ "0" == "0"
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e1) == &quot;1&quot;
+ Catch::toString(e1) == "1"
</Original>
<Expanded>
- &quot;1&quot; == &quot;1&quot;
+ "1" == "1"
</Expanded>
</Expression>
<OverallResult success="true"/>
@@ -60,28 +60,28 @@
<TestCase name="toString(enum class w/operator&lt;&lt;)">
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e0) == &quot;E2/V0&quot;
+ Catch::toString(e0) == "E2/V0"
</Original>
<Expanded>
- &quot;E2/V0&quot; == &quot;E2/V0&quot;
+ "E2/V0" == "E2/V0"
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e1) == &quot;E2/V1&quot;
+ Catch::toString(e1) == "E2/V1"
</Original>
<Expanded>
- &quot;E2/V1&quot; == &quot;E2/V1&quot;
+ "E2/V1" == "E2/V1"
</Expanded>
</Expression>
<Expression success="true" type="CHECK" filename="projects/SelfTest/EnumToString.cpp" >
<Original>
- Catch::toString(e3) == &quot;Unknown enum value 10&quot;
+ Catch::toString(e3) == "Unknown enum value 10"
</Original>
<Expanded>
- &quot;Unknown enum value 10&quot;
+ "Unknown enum value 10"
==
-&quot;Unknown enum value 10&quot;
+"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 == &quot;hello&quot;
+ s == "hello"
</Original>
<Expanded>
- &quot;hello&quot; == &quot;hello&quot;
+ "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 == &quot;world&quot;
+ s == "world"
</Original>
<Expanded>
- &quot;hello&quot; == &quot;world&quot;
+ "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 == &quot;hello&quot;
+ data.str_hello == "hello"
</Original>
<Expanded>
- &quot;hello&quot; == &quot;hello&quot;
+ "hello" == "hello"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- &quot;hello&quot; == data.str_hello
+ "hello" == data.str_hello
</Original>
<Expanded>
- &quot;hello&quot; == &quot;hello&quot;
+ "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 == &quot;goodbye&quot;
+ data.str_hello == "goodbye"
</Original>
<Expanded>
- &quot;hello&quot; == &quot;goodbye&quot;
+ "hello" == "goodbye"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello == &quot;hell&quot;
+ data.str_hello == "hell"
</Original>
<Expanded>
- &quot;hello&quot; == &quot;hell&quot;
+ "hello" == "hell"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello == &quot;hello1&quot;
+ data.str_hello == "hello1"
</Original>
<Expanded>
- &quot;hello&quot; == &quot;hello1&quot;
+ "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 != &quot;goodbye&quot;
+ data.str_hello != "goodbye"
</Original>
<Expanded>
- &quot;hello&quot; != &quot;goodbye&quot;
+ "hello" != "goodbye"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello != &quot;hell&quot;
+ data.str_hello != "hell"
</Original>
<Expanded>
- &quot;hello&quot; != &quot;hell&quot;
+ "hello" != "hell"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello != &quot;hello1&quot;
+ data.str_hello != "hello1"
</Original>
<Expanded>
- &quot;hello&quot; != &quot;hello1&quot;
+ "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 != &quot;hello&quot;
+ data.str_hello != "hello"
</Original>
<Expanded>
- &quot;hello&quot; != &quot;hello&quot;
+ "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 &lt;= &quot;hello&quot;
+ data.str_hello &lt;= "hello"
</Original>
<Expanded>
- &quot;hello&quot; &lt;= &quot;hello&quot;
+ "hello" &lt;= "hello"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello >= &quot;hello&quot;
+ data.str_hello >= "hello"
</Original>
<Expanded>
- &quot;hello&quot; >= &quot;hello&quot;
+ "hello" >= "hello"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello &lt; &quot;hellp&quot;
+ data.str_hello &lt; "hellp"
</Original>
<Expanded>
- &quot;hello&quot; &lt; &quot;hellp&quot;
+ "hello" &lt; "hellp"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello &lt; &quot;zebra&quot;
+ data.str_hello &lt; "zebra"
</Original>
<Expanded>
- &quot;hello&quot; &lt; &quot;zebra&quot;
+ "hello" &lt; "zebra"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello > &quot;hellm&quot;
+ data.str_hello > "hellm"
</Original>
<Expanded>
- &quot;hello&quot; > &quot;hellm&quot;
+ "hello" > "hellm"
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello > &quot;a&quot;
+ data.str_hello > "a"
</Original>
<Expanded>
- &quot;hello&quot; > &quot;a&quot;
+ "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 > &quot;hello&quot;
+ data.str_hello > "hello"
</Original>
<Expanded>
- &quot;hello&quot; > &quot;hello&quot;
+ "hello" > "hello"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello &lt; &quot;hello&quot;
+ data.str_hello &lt; "hello"
</Original>
<Expanded>
- &quot;hello&quot; &lt; &quot;hello&quot;
+ "hello" &lt; "hello"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello > &quot;hellp&quot;
+ data.str_hello > "hellp"
</Original>
<Expanded>
- &quot;hello&quot; > &quot;hellp&quot;
+ "hello" > "hellp"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello > &quot;z&quot;
+ data.str_hello > "z"
</Original>
<Expanded>
- &quot;hello&quot; > &quot;z&quot;
+ "hello" > "z"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello &lt; &quot;hellm&quot;
+ data.str_hello &lt; "hellm"
</Original>
<Expanded>
- &quot;hello&quot; &lt; &quot;hellm&quot;
+ "hello" &lt; "hellm"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello &lt; &quot;a&quot;
+ data.str_hello &lt; "a"
</Original>
<Expanded>
- &quot;hello&quot; &lt; &quot;a&quot;
+ "hello" &lt; "a"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello >= &quot;z&quot;
+ data.str_hello >= "z"
</Original>
<Expanded>
- &quot;hello&quot; >= &quot;z&quot;
+ "hello" >= "z"
</Expanded>
</Expression>
<Expression success="false" type="CHECK" filename="projects/SelfTest/ConditionTests.cpp" >
<Original>
- data.str_hello &lt;= &quot;a&quot;
+ data.str_hello &lt;= "a"
</Original>
<Expanded>
- &quot;hello&quot; &lt;= &quot;a&quot;
+ "hello" &lt;= "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(), &quot;expected exception&quot;
+ thisThrows(), "expected exception"
</Original>
<Expanded>
- thisThrows(), &quot;expected exception&quot;
+ 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( &quot;expecteD Exception&quot;, Catch::CaseSensitive::No )
+ thisThrows(), Equals( "expecteD Exception", Catch::CaseSensitive::No )
</Original>
<Expanded>
- thisThrows(), Equals( &quot;expecteD Exception&quot;, 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( &quot;expected&quot; )
+ thisThrows(), StartsWith( "expected" )
</Original>
<Expanded>
- thisThrows(), StartsWith( &quot;expected&quot; )
+ thisThrows(), StartsWith( "expected" )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
<Original>
- thisThrows(), EndsWith( &quot;exception&quot; )
+ thisThrows(), EndsWith( "exception" )
</Original>
<Expanded>
- thisThrows(), EndsWith( &quot;exception&quot; )
+ thisThrows(), EndsWith( "exception" )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
<Original>
- thisThrows(), Contains( &quot;except&quot; )
+ thisThrows(), Contains( "except" )
</Original>
<Expanded>
- thisThrows(), Contains( &quot;except&quot; )
+ thisThrows(), Contains( "except" )
</Expanded>
</Expression>
<Expression success="true" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
<Original>
- thisThrows(), Contains( &quot;exCept&quot;, Catch::CaseSensitive::No )
+ thisThrows(), Contains( "exCept", Catch::CaseSensitive::No )
</Original>
<Expanded>
- thisThrows(), Contains( &quot;exCept&quot;, 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(), &quot;expected exception&quot;
+ thisThrows(), "expected exception"
</Original>
<Expanded>
- thisThrows(), &quot;expected exception&quot;
+ thisThrows(), "expected exception"
</Expanded>
</Expression>
<Expression success="false" type="REQUIRE_THROWS_WITH" filename="projects/SelfTest/ExceptionTests.cpp" >
<Original>
- thisThrows(), &quot;should fail&quot;
+ thisThrows(), "should fail"
</Original>
<Expanded>
expected exception
@@ -3308,7 +3308,7 @@
makeString( false ) != static_cast&lt;char*>(nullptr)
</Original>
<Expanded>
- &quot;valid string&quot; != {null string}
+ "valid string" != {null string}
</Expanded>