From 9a7d8d2c3f890ee1cad5de82f758ae76fc7b2c61 Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Tue, 14 Feb 2017 16:04:56 +0000 Subject: [PATCH] Tweak tests for greater allocation failure coverage --- expat/tests/runtests.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 9bf84fda..530cef73 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -3862,9 +3862,17 @@ START_TEST(test_alloc_ext_entity_set_encoding) "]>\n" "&en;"; int i; + int repeat = 0; #define MAX_ALLOCATION_COUNT 20 for (i = 0; i < MAX_ALLOCATION_COUNT; i++) { + /* Repeat some counts to get round caching */ + if ((i == 2 && repeat < 3) || + (i == 3 && repeat < 6) || + (i == 4 && repeat == 6)) { + i--; + repeat++; + } XML_SetExternalEntityRefHandler(parser, external_entity_alloc_set_encoding); allocation_count = i; -- 2.40.0