diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index ad3fd9c1..bca3b1c3 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -894,20 +894,30 @@ START_TEST(test_latin1_umlauts) "\n" "\xE4 \xF6 \xFC ä ö ü ä ö ü >"; - const char *utf8 = - "\xC3\xA4 \xC3\xB6 \xC3\xBC " - "\xC3\xA4 \xC3\xB6 \xC3\xBC " - "\xC3\xA4 \xC3\xB6 \xC3\xBC >"; - run_character_check(text, utf8); +#ifdef XML_UNICODE + /* Expected results in UTF-16 */ + const XML_Char *expected = + XCS("\x00e4 \x00f6 \x00fc ") + XCS("\x00e4 \x00f6 \x00fc ") + XCS("\x00e4 \x00f6 \x00fc >"); +#else + /* Expected results in UTF-8 */ + const XML_Char *expected = + XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC ") + XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC ") + XCS("\xC3\xA4 \xC3\xB6 \xC3\xBC >"); +#endif + + run_character_check(text, expected); XML_ParserReset(parser, NULL); - run_attribute_check(text, utf8); + run_attribute_check(text, expected); /* Repeat with a default handler */ XML_ParserReset(parser, NULL); XML_SetDefaultHandler(parser, dummy_default_handler); - run_character_check(text, utf8); + run_character_check(text, expected); XML_ParserReset(parser, NULL); XML_SetDefaultHandler(parser, dummy_default_handler); - run_attribute_check(text, utf8); + run_attribute_check(text, expected); } END_TEST