tests: Migrate test_attributes off of g_parser

This commit is contained in:
Sebastian Pipping 2024-09-21 21:46:25 +02:00
parent 1968906b22
commit f001f38aed

View file

@ -2356,16 +2356,21 @@ START_TEST(test_attributes) {
{NULL, 0, NULL, NULL}};
info[0].attributes = doc_info;
info[1].attributes = tag_info;
XML_Parser parser = XML_ParserCreate(NULL);
assert_true(parser != NULL);
ParserAndElementInfo parserAndElementInfos = {
g_parser,
parser,
info,
};
XML_SetStartElementHandler(g_parser, counting_start_element_handler);
XML_SetUserData(g_parser, &parserAndElementInfos);
if (_XML_Parse_SINGLE_BYTES(g_parser, text, (int)strlen(text), XML_TRUE)
XML_SetStartElementHandler(parser, counting_start_element_handler);
XML_SetUserData(parser, &parserAndElementInfos);
if (_XML_Parse_SINGLE_BYTES(parser, text, (int)strlen(text), XML_TRUE)
== XML_STATUS_ERROR)
xml_failure(g_parser);
xml_failure(parser);
XML_ParserFree(parser);
}
END_TEST