From: Rhodri James Date: Mon, 27 Feb 2017 15:39:47 +0000 (+0000) Subject: Increase test coverage of ignore section processing X-Git-Tag: R_2_2_3~28^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=23e64e1fbc709014d98cbbe19251d9d392219015;p=libexpat Increase test coverage of ignore section processing --- diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index ddfdfe2b..4c7d3520 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -3450,17 +3450,29 @@ START_TEST(test_bad_ignore_section) const char *text = "\n" "&entity;"; - ExtFaults fault = { - "", + "Invalid XML character not faulted", + XML_ERROR_INVALID_TOKEN + }, + { NULL, NULL, XML_ERROR_NONE } }; + ExtFaults *fault; - XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); - XML_SetExternalEntityRefHandler(parser, external_entity_faulter); - XML_SetUserData(parser, &fault); - expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING, - "Incomplete IGNORE section not failed"); + for (fault = &faults[0]; fault->parse_text != NULL; fault++) { + XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS); + XML_SetExternalEntityRefHandler(parser, external_entity_faulter); + XML_SetUserData(parser, fault); + expect_failure(text, XML_ERROR_EXTERNAL_ENTITY_HANDLING, + "Incomplete IGNORE section not failed"); + XML_ParserReset(parser, NULL); + } } END_TEST