From 1044af1f31c925c0cd7fb241ec1fd18223903b1e Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Fri, 10 Mar 2017 16:34:35 +0000 Subject: [PATCH] Extend notation allocation test with notation declaration handler This extends the code coverage a little, in particular checking another allocation failure path. --- expat/tests/runtests.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index ce5330ee..0f2f4e39 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -6321,12 +6321,13 @@ START_TEST(test_alloc_notation) for (i = 0; i < MAX_ALLOC_COUNT; i++) { /* Repeat some counts to allow for cached allocations */ - if ((i == 2 && repeat < 3) || (i == 3)) { + if ((i == 2 && repeat < 4) || (i == 3)) { i--; repeat++; } allocation_count = i; dummy_handler_flags = 0; + XML_SetNotationDeclHandler(parser, dummy_notation_decl_handler); XML_SetEntityDeclHandler(parser, dummy_entity_decl_handler); if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) @@ -6337,7 +6338,8 @@ START_TEST(test_alloc_notation) fail("Parse succeeded despite allocation failures"); if (i == MAX_ALLOC_COUNT) fail("Parse failed at maximum allocation count"); - if (dummy_handler_flags != DUMMY_ENTITY_DECL_HANDLER_FLAG) + if (dummy_handler_flags != (DUMMY_ENTITY_DECL_HANDLER_FLAG | + DUMMY_NOTATION_DECL_HANDLER_FLAG)) fail("Entity declaration handler not called"); } #undef MAX_ALLOC_COUNT