From: Rhodri James Date: Wed, 14 Jun 2017 17:35:02 +0000 (+0100) Subject: Test that UTF-8 safely passes through a CDATA section. X-Git-Tag: R_2_2_3~22^2~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7e7cb2c560ee78e009ec97ee5dae207a0731c97b;p=libexpat Test that UTF-8 safely passes through a CDATA section. Specifically test that multi-byte characters are correctly tokenised --- diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index e1933e53..5a5a171d 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -5986,6 +5986,16 @@ START_TEST(test_ext_entity_utf8_non_bom) } END_TEST +/* Test that UTF-8 in a CDATA section is correctly passed through */ +START_TEST(test_utf8_in_cdata_section) +{ + const char *text = ""; + const XML_Char *expected = "one \xc3\xa9 two"; + + run_character_check(text, expected); +} +END_TEST + /* * Namespaces tests. */ @@ -11306,6 +11316,7 @@ make_suite(void) tcase_add_test(tc_basic, test_ext_entity_utf16_le); tcase_add_test(tc_basic, test_ext_entity_utf16_unknown); tcase_add_test(tc_basic, test_ext_entity_utf8_non_bom); + tcase_add_test(tc_basic, test_utf8_in_cdata_section); suite_add_tcase(s, tc_namespace); tcase_add_checked_fixture(tc_namespace,