From: Rhodri James Date: Thu, 27 Jul 2017 13:18:40 +0000 (+0100) Subject: Make test_alloc_long_attr_value() robust vs allocation changes X-Git-Tag: R_2_2_3~16^2~12 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=39bba875efd7c1b4a722b86fa65063dae07fd9af;p=libexpat Make test_alloc_long_attr_value() robust vs allocation changes --- diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 6e35df1a..7516804c 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -9723,23 +9723,16 @@ START_TEST(test_alloc_long_attr_value) "'>]>\n" ""; int i; -#define MAX_ALLOC_COUNT 10 - int repeat = 0; +#define MAX_ALLOC_COUNT 25 for (i = 0; i < MAX_ALLOC_COUNT; i++) { - /* Repeat some counts to defeat cached allocations */ - if ((i == 2 && repeat < 3) || - (i == 3 && repeat < 6) || - (i == 4 && repeat == 6) || - (i == 5 && repeat == 7)) { - i--; - repeat++; - } allocation_count = i; 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");