]> granicus.if.org Git - libexpat/commitdiff
Fix test_predefined_entities() to work correctly with UTF-16 builds
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 22 Aug 2017 14:06:18 +0000 (15:06 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 29 Aug 2017 21:13:13 +0000 (23:13 +0200)
expat/tests/runtests.c

index 698b13250ea056e4f611c340ad09771a02e5d6a2..3f7e5bc3a054af858a27b35ad63022d0710da55c 100644 (file)
@@ -4209,7 +4209,8 @@ END_TEST
 START_TEST(test_predefined_entities)
 {
     const char *text = "<doc>&lt;&gt;&amp;&quot;&apos;</doc>";
-    const char *result = "<>&\"'";
+    const XML_Char *expected = XCS("<doc>&lt;&gt;&amp;&quot;&apos;</doc>");
+    const XML_Char *result = XCS("<>&\"'");
     CharData storage;
 
     XML_SetDefaultHandler(parser, accumulate_characters);
@@ -4222,7 +4223,7 @@ START_TEST(test_predefined_entities)
                                 XML_TRUE) == XML_STATUS_ERROR)
         xml_failure(parser);
     /* The default handler doesn't translate the entities */
-    CharData_CheckXMLChars(&storage, text);
+    CharData_CheckXMLChars(&storage, expected);
 
     /* Now try again and check the translation */
     XML_ParserReset(parser, NULL);