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,
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
sprintf(buffer, "unexpected end string: '%s'", name);
fail(buffer);
}
- triplet_count++;
+ triplet_end_flag = XML_TRUE;
}
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