Split combined triplet_count into two distinct flags
@@ -3496,7 +3496,8 @@ namespace_teardown(void)
provided as the userData argument; the first is the expected
element name, and the second is the expected attribute name.
*/
-static int triplet_count = 0;
+static int triplet_start_flag = XML_FALSE;
+static int triplet_end_flag = XML_FALSE;
static void XMLCALL
triplet_start_checker(void *userData, const XML_Char *name,
@@ -3512,7 +3513,7 @@ triplet_start_checker(void *userData, const XML_Char *name,
sprintf(buffer, "unexpected attribute string: '%s'", atts[0]);
fail(buffer);
}
- triplet_count++;
+ triplet_start_flag = XML_TRUE;
}
/* Check that the element name passed to the end-element handler matches
@@ -3528,7 +3529,7 @@ triplet_end_checker(void *userData, const XML_Char *name)
sprintf(buffer, "unexpected end string: '%s'", name);
fail(buffer);
}
- triplet_count++;
+ triplet_end_flag = XML_TRUE;
}
START_TEST(test_return_ns_triplet)
@@ -3548,18 +3549,19 @@ START_TEST(test_return_ns_triplet)
XML_SetNamespaceDeclHandler(parser,
dummy_start_namespace_decl_handler,
dummy_end_namespace_decl_handler);
- triplet_count = 0;
+ triplet_start_flag = XML_FALSE;
+ triplet_end_flag = XML_FALSE;
if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
XML_FALSE) == XML_STATUS_ERROR)
xml_failure(parser);
- if (triplet_count != 1)
+ if (!triplet_start_flag)
fail("triplet_start_checker not invoked");
/* Check that unsetting "return triplets" fails while still parsing */
XML_SetReturnNSTriplet(parser, XML_FALSE);
if (_XML_Parse_SINGLE_BYTES(parser, epilog, strlen(epilog),
XML_TRUE) == XML_STATUS_ERROR)
xml_failure(parser);
- if (triplet_count != 2)
+ if (!triplet_end_flag)
fail("triplet_end_checker not invoked");
}
END_TEST
