From d7550d1446f179c350e814afc6c4fcc8fb4026fd Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 7 Feb 2017 11:46:55 +0000 Subject: [PATCH] Check parsing is faulted once parser is FINISHED --- expat/tests/runtests.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index fae7fcf7..10638d84 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -1714,6 +1714,12 @@ external_entity_resetter(XML_Parser parser, fail("Parsing status is not FINISHED"); return XML_STATUS_ERROR; } + /* Check we can't parse here */ + if (XML_Parse(ext_parser, text, strlen(text), + XML_TRUE) != XML_STATUS_ERROR) + fail("Parsing when finished not faulted"); + if (XML_GetErrorCode(ext_parser) != XML_ERROR_FINISHED) + fail("Parsing when finished faulted with wrong code"); XML_ParserReset(ext_parser, NULL); XML_GetParsingStatus(ext_parser, &status); if (status.parsing != XML_FINISHED) {