summaryrefslogtreecommitdiff
path: root/expat/tests/runtests.c
diff options
context:
space:
mode:
authorRhodri James <rhodri@kynesim.co.uk>2017-07-27 14:08:06 +0100
committerRhodri James <rhodri@kynesim.co.uk>2017-07-27 14:08:06 +0100
commit8311f7ad7a4a070551e692c334ae5714ca8a1d84 (patch)
tree526585105d04c4dc5bb0e075b0fb774792e17d38 /expat/tests/runtests.c
parent32c257274779be588be2728379ec9f8283c2421b (diff)
downloadlibexpat-git-8311f7ad7a4a070551e692c334ae5714ca8a1d84.tar.gz
Make test_alloc_comment_in_epilog() robust vs allocation changes
Diffstat (limited to 'expat/tests/runtests.c')
-rw-r--r--expat/tests/runtests.c16
1 files changed, 4 insertions, 12 deletions
diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c
index 3ac3ce5f..34eb9c48 100644
--- a/expat/tests/runtests.c
+++ b/expat/tests/runtests.c
@@ -9537,26 +9537,18 @@ START_TEST(test_alloc_comment_in_epilog)
"<doc></doc>\n"
"<!-- comment in epilog -->";
int i;
-#define MAX_ALLOC_COUNT 10
- int repeat = 0;
+#define MAX_ALLOC_COUNT 15
for (i = 0; i < MAX_ALLOC_COUNT; i++) {
- /* Repeat certain counts to allow for cached allocations */
- if (i == 3 && repeat == 1) {
- i -= 2;
- repeat++;
- }
- else if (i == 2 && repeat < 4 && repeat != 1) {
- i--;
- repeat++;
- }
allocation_count = i;
XML_SetCommentHandler(parser, dummy_comment_handler);
dummy_handler_flags = 0;
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 completed despite failing allocator");