Make test_alloc_set_foreign_dtd() robust vs allocation pattern changes
@@ -8943,19 +8943,9 @@ START_TEST(test_alloc_set_foreign_dtd)
"<doc>&entity;</doc>";
char text2[] = "<!ELEMENT doc (#PCDATA)*>";
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 deal with cached allocations */
- if (i == 9 && repeat == 2) {
- i -= 2;
- repeat++;
- }
- else if (i == 2 && repeat < 2) {
- i--;
- repeat++;
- }
allocation_count = i;
XML_SetParamEntityParsing(parser, XML_PARAM_ENTITY_PARSING_ALWAYS);
XML_SetUserData(parser, &text2);
@@ -8965,7 +8955,9 @@ START_TEST(test_alloc_set_foreign_dtd)
if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
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");
