From 60942737e23049793b835055c18ef32fce44697c Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 22 Aug 2017 19:05:07 +0100 Subject: [PATCH] Fix test_misc_version() for various XML_UNICODE issues. --- expat/tests/runtests.c | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index c637dc0c..03c90593 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -8010,10 +8010,16 @@ START_TEST(test_misc_version) if (!versions_equal(&read_version, &parsed_version)) fail("Version mismatch"); -#if ! defined(XML_UNICODE) - if (strcmp(version_text, "expat_2.2.4")) /* needs bump on releases */ +#if ! defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T) + if (xcstrcmp(version_text, XCS("expat_2.2.4"))) /* needs bump on releases */ fail("XML_*_VERSION in expat.h out of sync?\n"); -#endif /* ! defined(XML_UNICODE) */ +#else + /* If we have XML_UNICODE defined but not XML_UNICODE_WCHAR_T + * then XML_LChar is defined as char, for some reason. + */ + if (strcmp(version_text, "expat_2.2.4")) /* needs bump on releases */ + fail("XML_*_VERSION in expat.h out of sync?\n"); +#endif /* ! defined(XML_UNICODE) || defined(XML_UNICODE_WCHAR_T) */ } END_TEST