Make test_alloc_dtd_default_handling() robust vs allocation changes
@@ -8468,18 +8468,9 @@ START_TEST(test_alloc_dtd_default_handling)
const char *expected = "\n\n\n\n\n\n\n\n\n<doc>text in doc</doc>";
CharData storage;
int i;
-#define MAX_ALLOC_COUNT 15
- int repeat = 0;
+#define MAX_ALLOC_COUNT 25
for (i = 0; i < MAX_ALLOC_COUNT; i++) {
- /* Repeat some counts to catch cached allocations */
- if ((repeat < 4 && i == 2) ||
- (repeat == 4 && i == 4) ||
- (repeat == 5 && i == 5) ||
- (repeat == 6 && i == 8)) {
- i--;
- repeat++;
- }
allocation_count = i;
dummy_handler_flags = 0;
XML_SetDefaultHandler(parser, accumulate_characters);
@@ -8504,7 +8495,9 @@ START_TEST(test_alloc_dtd_default_handling)
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("Default DTD parsed despite allocation failures");
