mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-18 02:55:43 +00:00
Thread the proper file name and line number to make determination of
which test is failing easier.
This commit is contained in:
parent
e39c6e2237
commit
7fd8181a4a
1 changed files with 13 additions and 5 deletions
|
@ -40,7 +40,7 @@ _xml_failure(XML_Parser parser, const char *file, int line)
|
|||
XML_GetCurrentLineNumber(parser),
|
||||
XML_GetCurrentColumnNumber(parser),
|
||||
file, line);
|
||||
fail(buffer);
|
||||
_fail_unless(0, file, line, buffer);
|
||||
}
|
||||
|
||||
#define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__)
|
||||
|
@ -199,7 +199,8 @@ accumulate_attribute(void *userData, const XML_Char *name,
|
|||
|
||||
|
||||
static void
|
||||
run_character_check(XML_Char *text, XML_Char *expected)
|
||||
_run_character_check(XML_Char *text, XML_Char *expected,
|
||||
const char *file, int line)
|
||||
{
|
||||
CharData storage;
|
||||
|
||||
|
@ -207,12 +208,16 @@ run_character_check(XML_Char *text, XML_Char *expected)
|
|||
XML_SetUserData(parser, &storage);
|
||||
XML_SetCharacterDataHandler(parser, accumulate_characters);
|
||||
if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
|
||||
xml_failure(parser);
|
||||
_xml_failure(parser, file, line);
|
||||
CharData_CheckXMLChars(&storage, expected);
|
||||
}
|
||||
|
||||
#define run_character_check(text, expected) \
|
||||
_run_character_check(text, expected, __FILE__, __LINE__)
|
||||
|
||||
static void
|
||||
run_attribute_check(XML_Char *text, XML_Char *expected)
|
||||
_run_attribute_check(XML_Char *text, XML_Char *expected,
|
||||
const char *file, int line)
|
||||
{
|
||||
CharData storage;
|
||||
|
||||
|
@ -220,10 +225,13 @@ run_attribute_check(XML_Char *text, XML_Char *expected)
|
|||
XML_SetUserData(parser, &storage);
|
||||
XML_SetStartElementHandler(parser, accumulate_attribute);
|
||||
if (XML_Parse(parser, text, strlen(text), 1) == XML_STATUS_ERROR)
|
||||
xml_failure(parser);
|
||||
_xml_failure(parser, file, line);
|
||||
CharData_CheckXMLChars(&storage, expected);
|
||||
}
|
||||
|
||||
#define run_attribute_check(text, expected) \
|
||||
_run_attribute_check(text, expected, __FILE__, __LINE__)
|
||||
|
||||
/* Regression test for SF bug #491986. */
|
||||
START_TEST(test_danish_latin1)
|
||||
{
|
||||
|
|
Loading…
Add table
Reference in a new issue