From: Rhodri James Date: Thu, 27 Jul 2017 11:18:47 +0000 (+0100) Subject: Make test_alloc_parse_comment_2() robust vs allocation pattern changes X-Git-Tag: R_2_2_3~16^2~45 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=21b1bb4c6f965a0e4a8df352c99edfecfe890309;p=libexpat Make test_alloc_parse_comment_2() robust vs allocation pattern changes --- diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 5bc10b05..ff6d8ee5 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -8071,25 +8071,17 @@ START_TEST(test_alloc_parse_comment_2) "" ""; int i; - int repeat = 0; -#define MAX_ALLOC_COUNT 10 +#define MAX_ALLOC_COUNT 15 for (i = 0; i < MAX_ALLOC_COUNT; i++) { allocation_count = i; - /* Repeat some counts because of cached memory */ - if (i == 2 && repeat == 1) { - i -= 2; - repeat++; - } else if ((i == 1 && repeat < 1) || - (i == 1 && repeat > 1 && repeat < 4)) { - i--; - repeat++; - } XML_SetCommentHandler(parser, dummy_comment_handler); if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text), XML_TRUE) != XML_STATUS_ERROR) break; - XML_ParserReset(parser, NULL); + /* See comment in test_alloc_parse_xdecl() */ + alloc_teardown(); + alloc_setup(); } if (i == 0) fail("Parse succeeded despite failing allocator");