mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-05 13:14:59 +00:00
tests: Migrate test_attributes off of g_parser
This commit is contained in:
parent
1968906b22
commit
f001f38aed
1 changed files with 10 additions and 5 deletions
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue