From 7fd8181a4a1c85d520f387dbbc1881edb2c90c02 Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Sat, 25 Jan 2003 04:57:44 +0000 Subject: [PATCH] Thread the proper file name and line number to make determination of which test is failing easier. --- expat/tests/runtests.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 0d11e6be..437ad3eb 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -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) { -- 2.40.0