From 278545e976335320e8d22118b3b3bbdbc02bd6d5 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Mon, 12 Jun 2017 18:38:27 +0100 Subject: [PATCH] Test unknown encoding handler in a parser with namespaces --- expat/tests/runtests.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index c32d5f78..12ca1c08 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -6542,6 +6542,18 @@ START_TEST(test_ns_extremely_long_prefix) } END_TEST +/* Test unknown encoding handlers in namespace setup */ +START_TEST(test_ns_unknown_encoding_success) +{ + const char *text = + "\n" + "Hi"; + + XML_SetUnknownEncodingHandler(parser, MiscEncodingHandler, NULL); + run_character_check(text, "Hi"); +} +END_TEST + /* Control variable; the number of times duff_allocator() will successfully allocate */ #define ALLOC_ALWAYS_SUCCEED (-1) @@ -11245,6 +11257,7 @@ make_suite(void) tcase_add_test(tc_namespace, test_ns_reserved_attributes); tcase_add_test(tc_namespace, test_ns_reserved_attributes_2); tcase_add_test(tc_namespace, test_ns_extremely_long_prefix); + tcase_add_test(tc_namespace, test_ns_unknown_encoding_success); suite_add_tcase(s, tc_misc); tcase_add_checked_fixture(tc_misc, NULL, basic_teardown);