From 41524fed8589f47d4f5f72dd18fafa76d0c59ecd Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 14 Feb 2017 16:13:06 +0000 Subject: [PATCH] Test external entity with no handler --- expat/tests/runtests.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 530cef73..a083e777 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -1022,6 +1022,20 @@ START_TEST(test_ext_entity_set_encoding) } END_TEST +/* Test external entities with no handler */ +START_TEST(test_ext_entity_no_handler) +{ + const char *text = + "\n" + "]>\n" + "&en;"; + + XML_SetDefaultHandler(parser, dummy_default_handler); + run_character_check(text, ""); +} +END_TEST + /* Test UTF-8 BOM is accepted */ static int XMLCALL external_entity_loader_set_bom(XML_Parser parser, @@ -4092,6 +4106,7 @@ make_suite(void) test_wfc_undeclared_entity_with_external_subset_standalone); tcase_add_test(tc_basic, test_wfc_no_recursive_entity_refs); tcase_add_test(tc_basic, test_ext_entity_set_encoding); + tcase_add_test(tc_basic, test_ext_entity_no_handler); tcase_add_test(tc_basic, test_ext_entity_set_bom); tcase_add_test(tc_basic, test_ext_entity_bad_encoding); tcase_add_test(tc_basic, test_ext_entity_invalid_parse);