diff --git a/projects/SelfTest/Baselines/compact.sw.approved.txt b/projects/SelfTest/Baselines/compact.sw.approved.txt index a65f15ab..e10e63b0 100644 --- a/projects/SelfTest/Baselines/compact.sw.approved.txt +++ b/projects/SelfTest/Baselines/compact.sw.approved.txt @@ -1186,7 +1186,7 @@ String.tests.cpp:: passed: s.data() == s2.data() for: "hello world! String.tests.cpp:: passed: s.data() == ss.data() for: "hello world!" == "hello world!" String.tests.cpp:: passed: s.substr(s.size() + 1, 123).empty() for: true String.tests.cpp:: passed: std::strcmp(ss.c_str(), "world!") == 0 for: 0 == 0 -String.tests.cpp:: passed: buffer1 != buffer2 for: "Hello" != "Hello" +String.tests.cpp:: passed: (char*)buffer1 != (char*)buffer2 for: "Hello" != "Hello" String.tests.cpp:: passed: left == right for: Hello == Hello String.tests.cpp:: passed: left != left.substr(0, 3) for: Hello != Hel String.tests.cpp:: passed: sr == "a standard string" for: a standard string == "a standard string" @@ -1561,48 +1561,6 @@ Xml.tests.cpp:: passed: encode( stringWithQuotes, Catch::XmlEncode: "don't "quote" me on that" Xml.tests.cpp:: passed: encode( "[\x01]" ) == "[\\x01]" for: "[\x01]" == "[\x01]" Xml.tests.cpp:: passed: encode( "[\x7F]" ) == "[\\x7F]" for: "[\x7F]" == "[\x7F]" -Xml.tests.cpp:: passed: encode(u8"Here be 👾") == u8"Here be 👾" for: "Here be 👾" == "Here be 👾" -Xml.tests.cpp:: passed: encode(u8"šš") == u8"šš" for: "šš" == "šš" -Xml.tests.cpp:: passed: encode("\xDF\xBF") == "\xDF\xBF" for: "߿" == "߿" -Xml.tests.cpp:: passed: encode("\xE0\xA0\x80") == "\xE0\xA0\x80" for: "ࠀ" == "ࠀ" -Xml.tests.cpp:: passed: encode("\xED\x9F\xBF") == "\xED\x9F\xBF" for: "퟿" == "퟿" -Xml.tests.cpp:: passed: encode("\xEE\x80\x80") == "\xEE\x80\x80" for: "" == "" -Xml.tests.cpp:: passed: encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF" for: "￿" == "￿" -Xml.tests.cpp:: passed: encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80" for: "𐀀" == "𐀀" -Xml.tests.cpp:: passed: encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF" for: "􏿿" == "􏿿" -Xml.tests.cpp:: passed: encode("Here \xFF be 👾") == u8"Here \\xFF be 👾" for: "Here \xFF be 👾" == "Here \xFF be 👾" -Xml.tests.cpp:: passed: encode("\xFF") == "\\xFF" for: "\xFF" == "\xFF" -Xml.tests.cpp:: passed: encode("\xC5\xC5\xA0") == u8"\\xC5Š" for: "\xC5Š" == "\xC5Š" -Xml.tests.cpp:: passed: encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80" for: "\xF4\x90\x80\x80" == "\xF4\x90\x80\x80" -Xml.tests.cpp:: passed: encode("\xC0\x80") == u8"\\xC0\\x80" for: "\xC0\x80" == "\xC0\x80" -Xml.tests.cpp:: passed: encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80" for: "\xF0\x80\x80\x80" == "\xF0\x80\x80\x80" -Xml.tests.cpp:: passed: encode("\xC1\xBF") == u8"\\xC1\\xBF" for: "\xC1\xBF" == "\xC1\xBF" -Xml.tests.cpp:: passed: encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF" for: "\xE0\x9F\xBF" == "\xE0\x9F\xBF" -Xml.tests.cpp:: passed: encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF" for: "\xF0\x8F\xBF\xBF" == "\xF0\x8F\xBF\xBF" -Xml.tests.cpp:: passed: encode("\xED\xA0\x80") == "\xED\xA0\x80" for: "" == "" -Xml.tests.cpp:: passed: encode("\xED\xAF\xBF") == "\xED\xAF\xBF" for: "" == "" -Xml.tests.cpp:: passed: encode("\xED\xB0\x80") == "\xED\xB0\x80" for: "" == "" -Xml.tests.cpp:: passed: encode("\xED\xBF\xBF") == "\xED\xBF\xBF" for: "" == "" -Xml.tests.cpp:: passed: encode("\x80") == u8"\\x80" for: "\x80" == "\x80" -Xml.tests.cpp:: passed: encode("\x81") == u8"\\x81" for: "\x81" == "\x81" -Xml.tests.cpp:: passed: encode("\xBC") == u8"\\xBC" for: "\xBC" == "\xBC" -Xml.tests.cpp:: passed: encode("\xBF") == u8"\\xBF" for: "\xBF" == "\xBF" -Xml.tests.cpp:: passed: encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80" for: "\xF5\x80\x80\x80" == "\xF5\x80\x80\x80" -Xml.tests.cpp:: passed: encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80" for: "\xF6\x80\x80\x80" == "\xF6\x80\x80\x80" -Xml.tests.cpp:: passed: encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80" for: "\xF7\x80\x80\x80" == "\xF7\x80\x80\x80" -Xml.tests.cpp:: passed: encode("\xDE") == u8"\\xDE" for: "\xDE" == "\xDE" -Xml.tests.cpp:: passed: encode("\xDF") == u8"\\xDF" for: "\xDF" == "\xDF" -Xml.tests.cpp:: passed: encode("\xE0") == u8"\\xE0" for: "\xE0" == "\xE0" -Xml.tests.cpp:: passed: encode("\xEF") == u8"\\xEF" for: "\xEF" == "\xEF" -Xml.tests.cpp:: passed: encode("\xF0") == u8"\\xF0" for: "\xF0" == "\xF0" -Xml.tests.cpp:: passed: encode("\xF4") == u8"\\xF4" for: "\xF4" == "\xF4" -Xml.tests.cpp:: passed: encode("\xE0\x80") == u8"\\xE0\\x80" for: "\xE0\x80" == "\xE0\x80" -Xml.tests.cpp:: passed: encode("\xE0\xBF") == u8"\\xE0\\xBF" for: "\xE0\xBF" == "\xE0\xBF" -Xml.tests.cpp:: passed: encode("\xE1\x80") == u8"\\xE1\\x80" for: "\xE1\x80" == "\xE1\x80" -Xml.tests.cpp:: passed: encode("\xF0\x80") == u8"\\xF0\\x80" for: "\xF0\x80" == "\xF0\x80" -Xml.tests.cpp:: passed: encode("\xF4\x80") == u8"\\xF4\\x80" for: "\xF4\x80" == "\xF4\x80" -Xml.tests.cpp:: passed: encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80" for: "\xF0\x80\x80" == "\xF0\x80\x80" -Xml.tests.cpp:: passed: encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80" for: "\xF4\x80\x80" == "\xF4\x80\x80" ToStringVector.tests.cpp:: passed: Catch::Detail::stringify( empty ) == "{ }" for: "{ }" == "{ }" ToStringVector.tests.cpp:: passed: Catch::Detail::stringify( oneValue ) == "{ 42 }" for: "{ 42 }" == "{ 42 }" ToStringVector.tests.cpp:: passed: Catch::Detail::stringify( twoValues ) == "{ 42, 250 }" for: "{ 42, 250 }" == "{ 42, 250 }" diff --git a/projects/SelfTest/Baselines/console.std.approved.txt b/projects/SelfTest/Baselines/console.std.approved.txt index d43063fe..039ecc09 100644 --- a/projects/SelfTest/Baselines/console.std.approved.txt +++ b/projects/SelfTest/Baselines/console.std.approved.txt @@ -1380,6 +1380,6 @@ due to unexpected exception with message: Why would you throw a std::string? =============================================================================== -test cases: 305 | 231 passed | 70 failed | 4 failed as expected -assertions: 1695 | 1543 passed | 131 failed | 21 failed as expected +test cases: 304 | 230 passed | 70 failed | 4 failed as expected +assertions: 1653 | 1501 passed | 131 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/console.sw.approved.txt b/projects/SelfTest/Baselines/console.sw.approved.txt index d321bd91..e3684cc8 100644 --- a/projects/SelfTest/Baselines/console.sw.approved.txt +++ b/projects/SelfTest/Baselines/console.sw.approved.txt @@ -8670,7 +8670,7 @@ String.tests.cpp: ............................................................................... String.tests.cpp:: PASSED: - CHECK( buffer1 != buffer2 ) + CHECK( (char*)buffer1 != (char*)buffer2 ) with expansion: "Hello" != "Hello" @@ -11421,263 +11421,6 @@ Xml.tests.cpp:: PASSED: with expansion: "[\x7F]" == "[\x7F]" -------------------------------------------------------------------------------- -XmlEncode: UTF-8 - Valid utf-8 strings -------------------------------------------------------------------------------- -Xml.tests.cpp: -............................................................................... - -Xml.tests.cpp:: PASSED: - CHECK( encode(u8"Here be 👾") == u8"Here be 👾" ) -with expansion: - "Here be 👾" == "Here be 👾" - -Xml.tests.cpp:: PASSED: - CHECK( encode(u8"šš") == u8"šš" ) -with expansion: - "šš" == "šš" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xDF\xBF") == "\xDF\xBF" ) -with expansion: - "߿" == "߿" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xE0\xA0\x80") == "\xE0\xA0\x80" ) -with expansion: - "ࠀ" == "ࠀ" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xED\x9F\xBF") == "\xED\x9F\xBF" ) -with expansion: - "퟿" == "퟿" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xEE\x80\x80") == "\xEE\x80\x80" ) -with expansion: - "" == "" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF" ) -with expansion: - "￿" == "￿" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80" ) -with expansion: - "𐀀" == "𐀀" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF" ) -with expansion: - "􏿿" == "􏿿" - -------------------------------------------------------------------------------- -XmlEncode: UTF-8 - Invalid utf-8 strings - Various broken strings -------------------------------------------------------------------------------- -Xml.tests.cpp: -............................................................................... - -Xml.tests.cpp:: PASSED: - CHECK( encode("Here \xFF be 👾") == u8"Here \\xFF be 👾" ) -with expansion: - "Here \xFF be 👾" == "Here \xFF be 👾" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xFF") == "\\xFF" ) -with expansion: - "\xFF" == "\xFF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xC5\xC5\xA0") == u8"\\xC5Š" ) -with expansion: - "\xC5Š" == "\xC5Š" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80" ) -with expansion: - "\xF4\x90\x80\x80" == "\xF4\x90\x80\x80" - -------------------------------------------------------------------------------- -XmlEncode: UTF-8 - Invalid utf-8 strings - Overlong encodings -------------------------------------------------------------------------------- -Xml.tests.cpp: -............................................................................... - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xC0\x80") == u8"\\xC0\\x80" ) -with expansion: - "\xC0\x80" == "\xC0\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80" ) -with expansion: - "\xF0\x80\x80\x80" == "\xF0\x80\x80\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xC1\xBF") == u8"\\xC1\\xBF" ) -with expansion: - "\xC1\xBF" == "\xC1\xBF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF" ) -with expansion: - "\xE0\x9F\xBF" == "\xE0\x9F\xBF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF" ) -with expansion: - "\xF0\x8F\xBF\xBF" == "\xF0\x8F\xBF\xBF" - -------------------------------------------------------------------------------- -XmlEncode: UTF-8 - Invalid utf-8 strings - Surrogate pairs -------------------------------------------------------------------------------- -Xml.tests.cpp: -............................................................................... - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xED\xA0\x80") == "\xED\xA0\x80" ) -with expansion: - "" == "" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xED\xAF\xBF") == "\xED\xAF\xBF" ) -with expansion: - "" == "" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xED\xB0\x80") == "\xED\xB0\x80" ) -with expansion: - "" == "" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xED\xBF\xBF") == "\xED\xBF\xBF" ) -with expansion: - "" == "" - -------------------------------------------------------------------------------- -XmlEncode: UTF-8 - Invalid utf-8 strings - Invalid start byte -------------------------------------------------------------------------------- -Xml.tests.cpp: -............................................................................... - -Xml.tests.cpp:: PASSED: - CHECK( encode("\x80") == u8"\\x80" ) -with expansion: - "\x80" == "\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\x81") == u8"\\x81" ) -with expansion: - "\x81" == "\x81" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xBC") == u8"\\xBC" ) -with expansion: - "\xBC" == "\xBC" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xBF") == u8"\\xBF" ) -with expansion: - "\xBF" == "\xBF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80" ) -with expansion: - "\xF5\x80\x80\x80" == "\xF5\x80\x80\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80" ) -with expansion: - "\xF6\x80\x80\x80" == "\xF6\x80\x80\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80" ) -with expansion: - "\xF7\x80\x80\x80" == "\xF7\x80\x80\x80" - -------------------------------------------------------------------------------- -XmlEncode: UTF-8 - Invalid utf-8 strings - Missing continuation byte(s) -------------------------------------------------------------------------------- -Xml.tests.cpp: -............................................................................... - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xDE") == u8"\\xDE" ) -with expansion: - "\xDE" == "\xDE" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xDF") == u8"\\xDF" ) -with expansion: - "\xDF" == "\xDF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xE0") == u8"\\xE0" ) -with expansion: - "\xE0" == "\xE0" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xEF") == u8"\\xEF" ) -with expansion: - "\xEF" == "\xEF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF0") == u8"\\xF0" ) -with expansion: - "\xF0" == "\xF0" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF4") == u8"\\xF4" ) -with expansion: - "\xF4" == "\xF4" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xE0\x80") == u8"\\xE0\\x80" ) -with expansion: - "\xE0\x80" == "\xE0\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xE0\xBF") == u8"\\xE0\\xBF" ) -with expansion: - "\xE0\xBF" == "\xE0\xBF" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xE1\x80") == u8"\\xE1\\x80" ) -with expansion: - "\xE1\x80" == "\xE1\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF0\x80") == u8"\\xF0\\x80" ) -with expansion: - "\xF0\x80" == "\xF0\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF4\x80") == u8"\\xF4\\x80" ) -with expansion: - "\xF4\x80" == "\xF4\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80" ) -with expansion: - "\xF0\x80\x80" == "\xF0\x80\x80" - -Xml.tests.cpp:: PASSED: - CHECK( encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80" ) -with expansion: - "\xF4\x80\x80" == "\xF4\x80\x80" - ------------------------------------------------------------------------------- array -> toString ------------------------------------------------------------------------------- @@ -13464,6 +13207,6 @@ Misc.tests.cpp: Misc.tests.cpp:: PASSED: =============================================================================== -test cases: 305 | 215 passed | 86 failed | 4 failed as expected -assertions: 1712 | 1543 passed | 148 failed | 21 failed as expected +test cases: 304 | 214 passed | 86 failed | 4 failed as expected +assertions: 1670 | 1501 passed | 148 failed | 21 failed as expected diff --git a/projects/SelfTest/Baselines/junit.sw.approved.txt b/projects/SelfTest/Baselines/junit.sw.approved.txt index 588c3a21..fcf933dd 100644 --- a/projects/SelfTest/Baselines/junit.sw.approved.txt +++ b/projects/SelfTest/Baselines/junit.sw.approved.txt @@ -1,7 +1,7 @@ - + @@ -1402,12 +1402,6 @@ Exception.tests.cpp: - - - - - - diff --git a/projects/SelfTest/Baselines/sonarqube.sw.approved.txt b/projects/SelfTest/Baselines/sonarqube.sw.approved.txt index 65f4655a..0bd44a18 100644 --- a/projects/SelfTest/Baselines/sonarqube.sw.approved.txt +++ b/projects/SelfTest/Baselines/sonarqube.sw.approved.txt @@ -157,12 +157,6 @@ - - - - - - diff --git a/projects/SelfTest/Baselines/xml.sw.approved.txt b/projects/SelfTest/Baselines/xml.sw.approved.txt index 35640250..fa8c3084 100644 --- a/projects/SelfTest/Baselines/xml.sw.approved.txt +++ b/projects/SelfTest/Baselines/xml.sw.approved.txt @@ -10849,7 +10849,7 @@ Message from section two
- buffer1 != buffer2 + (char*)buffer1 != (char*)buffer2 "Hello" != "Hello" @@ -13846,378 +13846,6 @@ There is no extra whitespace here
- -
- - - encode(u8"Here be 👾") == u8"Here be 👾" - - - "Here be 👾" == "Here be 👾" - - - - - encode(u8"šš") == u8"šš" - - - "šš" == "šš" - - - - - encode("\xDF\xBF") == "\xDF\xBF" - - - "߿" == "߿" - - - - - encode("\xE0\xA0\x80") == "\xE0\xA0\x80" - - - "ࠀ" == "ࠀ" - - - - - encode("\xED\x9F\xBF") == "\xED\x9F\xBF" - - - "퟿" == "퟿" - - - - - encode("\xEE\x80\x80") == "\xEE\x80\x80" - - - "" == "" - - - - - encode("\xEF\xBF\xBF") == "\xEF\xBF\xBF" - - - "￿" == "￿" - - - - - encode("\xF0\x90\x80\x80") == "\xF0\x90\x80\x80" - - - "𐀀" == "𐀀" - - - - - encode("\xF4\x8F\xBF\xBF") == "\xF4\x8F\xBF\xBF" - - - "􏿿" == "􏿿" - - - -
-
-
- - - encode("Here \xFF be 👾") == u8"Here \\xFF be 👾" - - - "Here \xFF be 👾" == "Here \xFF be 👾" - - - - - encode("\xFF") == "\\xFF" - - - "\xFF" == "\xFF" - - - - - encode("\xC5\xC5\xA0") == u8"\\xC5Š" - - - "\xC5Š" == "\xC5Š" - - - - - encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80" - - - "\xF4\x90\x80\x80" == "\xF4\x90\x80\x80" - - - -
- -
-
-
- - - encode("\xC0\x80") == u8"\\xC0\\x80" - - - "\xC0\x80" == "\xC0\x80" - - - - - encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80" - - - "\xF0\x80\x80\x80" == "\xF0\x80\x80\x80" - - - - - encode("\xC1\xBF") == u8"\\xC1\\xBF" - - - "\xC1\xBF" == "\xC1\xBF" - - - - - encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF" - - - "\xE0\x9F\xBF" == "\xE0\x9F\xBF" - - - - - encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF" - - - "\xF0\x8F\xBF\xBF" == "\xF0\x8F\xBF\xBF" - - - -
- -
-
-
- - - encode("\xED\xA0\x80") == "\xED\xA0\x80" - - - "" == "" - - - - - encode("\xED\xAF\xBF") == "\xED\xAF\xBF" - - - "" == "" - - - - - encode("\xED\xB0\x80") == "\xED\xB0\x80" - - - "" == "" - - - - - encode("\xED\xBF\xBF") == "\xED\xBF\xBF" - - - "" == "" - - - -
- -
-
-
- - - encode("\x80") == u8"\\x80" - - - "\x80" == "\x80" - - - - - encode("\x81") == u8"\\x81" - - - "\x81" == "\x81" - - - - - encode("\xBC") == u8"\\xBC" - - - "\xBC" == "\xBC" - - - - - encode("\xBF") == u8"\\xBF" - - - "\xBF" == "\xBF" - - - - - encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80" - - - "\xF5\x80\x80\x80" == "\xF5\x80\x80\x80" - - - - - encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80" - - - "\xF6\x80\x80\x80" == "\xF6\x80\x80\x80" - - - - - encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80" - - - "\xF7\x80\x80\x80" == "\xF7\x80\x80\x80" - - - -
- -
-
-
- - - encode("\xDE") == u8"\\xDE" - - - "\xDE" == "\xDE" - - - - - encode("\xDF") == u8"\\xDF" - - - "\xDF" == "\xDF" - - - - - encode("\xE0") == u8"\\xE0" - - - "\xE0" == "\xE0" - - - - - encode("\xEF") == u8"\\xEF" - - - "\xEF" == "\xEF" - - - - - encode("\xF0") == u8"\\xF0" - - - "\xF0" == "\xF0" - - - - - encode("\xF4") == u8"\\xF4" - - - "\xF4" == "\xF4" - - - - - encode("\xE0\x80") == u8"\\xE0\\x80" - - - "\xE0\x80" == "\xE0\x80" - - - - - encode("\xE0\xBF") == u8"\\xE0\\xBF" - - - "\xE0\xBF" == "\xE0\xBF" - - - - - encode("\xE1\x80") == u8"\\xE1\\x80" - - - "\xE1\x80" == "\xE1\x80" - - - - - encode("\xF0\x80") == u8"\\xF0\\x80" - - - "\xF0\x80" == "\xF0\x80" - - - - - encode("\xF4\x80") == u8"\\xF4\\x80" - - - "\xF4\x80" == "\xF4\x80" - - - - - encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80" - - - "\xF0\x80\x80" == "\xF0\x80\x80" - - - - - encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80" - - - "\xF4\x80\x80" == "\xF4\x80\x80" - - - -
- -
- -
@@ -16162,7 +15790,7 @@ loose text artifact - + - + diff --git a/projects/SelfTest/IntrospectiveTests/String.tests.cpp b/projects/SelfTest/IntrospectiveTests/String.tests.cpp index 91a2b4ab..3a308657 100644 --- a/projects/SelfTest/IntrospectiveTests/String.tests.cpp +++ b/projects/SelfTest/IntrospectiveTests/String.tests.cpp @@ -79,7 +79,7 @@ TEST_CASE( "StringRef", "[Strings][StringRef]" ) { SECTION( "Comparisons are deep" ) { char buffer1[] = "Hello"; char buffer2[] = "Hello"; - CHECK(buffer1 != buffer2); + CHECK((char*)buffer1 != (char*)buffer2); StringRef left(buffer1), right(buffer2); REQUIRE( left == right ); diff --git a/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp b/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp index c3886ab2..bf6c8602 100644 --- a/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp +++ b/projects/SelfTest/IntrospectiveTests/Xml.tests.cpp @@ -40,10 +40,11 @@ TEST_CASE( "XmlEncode", "[XML]" ) { } // Thanks to Peter Bindels (dascandy) for some of the tests -TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8]") { +TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8][approvals]") { +#define ESC(lit) (char*)(lit) SECTION("Valid utf-8 strings") { - CHECK(encode(u8"Here be 👾") == u8"Here be 👾"); - CHECK(encode(u8"šš") == u8"šš"); + CHECK(encode(ESC(u8"Here be 👾")) == ESC(u8"Here be 👾")); + CHECK(encode(ESC(u8"šš")) == ESC(u8"šš")); CHECK(encode("\xDF\xBF") == "\xDF\xBF"); // 0x7FF CHECK(encode("\xE0\xA0\x80") == "\xE0\xA0\x80"); // 0x800 @@ -55,18 +56,18 @@ TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8]") { } SECTION("Invalid utf-8 strings") { SECTION("Various broken strings") { - CHECK(encode("Here \xFF be 👾") == u8"Here \\xFF be 👾"); + CHECK(encode(ESC("Here \xFF be \xF0\x9F\x91\xBE")) == ESC(u8"Here \\xFF be 👾")); CHECK(encode("\xFF") == "\\xFF"); - CHECK(encode("\xC5\xC5\xA0") == u8"\\xC5Š"); - CHECK(encode("\xF4\x90\x80\x80") == u8"\\xF4\\x90\\x80\\x80"); // 0x110000 -- out of unicode range + CHECK(encode("\xC5\xC5\xA0") == ESC(u8"\\xC5Š")); + CHECK(encode("\xF4\x90\x80\x80") == ESC(u8"\\xF4\\x90\\x80\\x80")); // 0x110000 -- out of unicode range } SECTION("Overlong encodings") { - CHECK(encode("\xC0\x80") == u8"\\xC0\\x80"); // \0 - CHECK(encode("\xF0\x80\x80\x80") == u8"\\xF0\\x80\\x80\\x80"); // Super-over-long \0 - CHECK(encode("\xC1\xBF") == u8"\\xC1\\xBF"); // ASCII char as UTF-8 (0x7F) - CHECK(encode("\xE0\x9F\xBF") == u8"\\xE0\\x9F\\xBF"); // 0x7FF - CHECK(encode("\xF0\x8F\xBF\xBF") == u8"\\xF0\\x8F\\xBF\\xBF"); // 0xFFFF + CHECK(encode("\xC0\x80") == "\\xC0\\x80"); // \0 + CHECK(encode("\xF0\x80\x80\x80") == "\\xF0\\x80\\x80\\x80"); // Super-over-long \0 + CHECK(encode("\xC1\xBF") == "\\xC1\\xBF"); // ASCII char as UTF-8 (0x7F) + CHECK(encode("\xE0\x9F\xBF") == "\\xE0\\x9F\\xBF"); // 0x7FF + CHECK(encode("\xF0\x8F\xBF\xBF") == "\\xF0\\x8F\\xBF\\xBF"); // 0xFFFF } // Note that we actually don't modify surrogate pairs, as we do not do strict checking @@ -78,35 +79,36 @@ TEST_CASE("XmlEncode: UTF-8", "[XML][UTF-8]") { } SECTION("Invalid start byte") { - CHECK(encode("\x80") == u8"\\x80"); - CHECK(encode("\x81") == u8"\\x81"); - CHECK(encode("\xBC") == u8"\\xBC"); - CHECK(encode("\xBF") == u8"\\xBF"); + CHECK(encode("\x80") == "\\x80"); + CHECK(encode("\x81") == "\\x81"); + CHECK(encode("\xBC") == "\\xBC"); + CHECK(encode("\xBF") == "\\xBF"); // Out of range - CHECK(encode("\xF5\x80\x80\x80") == u8"\\xF5\\x80\\x80\\x80"); - CHECK(encode("\xF6\x80\x80\x80") == u8"\\xF6\\x80\\x80\\x80"); - CHECK(encode("\xF7\x80\x80\x80") == u8"\\xF7\\x80\\x80\\x80"); + CHECK(encode("\xF5\x80\x80\x80") == "\\xF5\\x80\\x80\\x80"); + CHECK(encode("\xF6\x80\x80\x80") == "\\xF6\\x80\\x80\\x80"); + CHECK(encode("\xF7\x80\x80\x80") == "\\xF7\\x80\\x80\\x80"); } SECTION("Missing continuation byte(s)") { // Missing first continuation byte - CHECK(encode("\xDE") == u8"\\xDE"); - CHECK(encode("\xDF") == u8"\\xDF"); - CHECK(encode("\xE0") == u8"\\xE0"); - CHECK(encode("\xEF") == u8"\\xEF"); - CHECK(encode("\xF0") == u8"\\xF0"); - CHECK(encode("\xF4") == u8"\\xF4"); + CHECK(encode("\xDE") == "\\xDE"); + CHECK(encode("\xDF") == "\\xDF"); + CHECK(encode("\xE0") == "\\xE0"); + CHECK(encode("\xEF") == "\\xEF"); + CHECK(encode("\xF0") == "\\xF0"); + CHECK(encode("\xF4") == "\\xF4"); // Missing second continuation byte - CHECK(encode("\xE0\x80") == u8"\\xE0\\x80"); - CHECK(encode("\xE0\xBF") == u8"\\xE0\\xBF"); - CHECK(encode("\xE1\x80") == u8"\\xE1\\x80"); - CHECK(encode("\xF0\x80") == u8"\\xF0\\x80"); - CHECK(encode("\xF4\x80") == u8"\\xF4\\x80"); + CHECK(encode("\xE0\x80") == "\\xE0\\x80"); + CHECK(encode("\xE0\xBF") == "\\xE0\\xBF"); + CHECK(encode("\xE1\x80") == "\\xE1\\x80"); + CHECK(encode("\xF0\x80") == "\\xF0\\x80"); + CHECK(encode("\xF4\x80") == "\\xF4\\x80"); // Missing third continuation byte - CHECK(encode("\xF0\x80\x80") == u8"\\xF0\\x80\\x80"); - CHECK(encode("\xF4\x80\x80") == u8"\\xF4\\x80\\x80"); + CHECK(encode("\xF0\x80\x80") == "\\xF0\\x80\\x80"); + CHECK(encode("\xF4\x80\x80") == "\\xF4\\x80\\x80"); } } +#undef ESC }