[Expat-checkins] CVS: expat/tests runtests.c,1.17,1.18

Fred L. Drake fdrake@users.sourceforge.net
Sat May 4 14:48:02 2002


Update of /cvsroot/expat/expat/tests
In directory usw-pr-cvs1:/tmp/cvs-serv20182/tests

Modified Files:
	runtests.c 
Log Message:
xml_failure():  Pass the relevant XML_Parser into the function so it is
    useful when parsing external entities as well as the document entity.

All callers have been updated.


Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** runtests.c	25 Apr 2002 04:04:42 -0000	1.17
--- runtests.c	4 May 2002 21:47:46 -0000	1.18
***************
*** 32,36 ****
   */
  static void
! _xml_failure(const char *file, int line)
  {
      char buffer[1024];
--- 32,36 ----
   */
  static void
! _xml_failure(XML_Parser parser, const char *file, int line)
  {
      char buffer[1024];
***************
*** 44,48 ****
  }
  
! #define xml_failure() _xml_failure(__FILE__, __LINE__)
  
  
--- 44,48 ----
  }
  
! #define xml_failure(parser) _xml_failure((parser), __FILE__, __LINE__)
  
  
***************
*** 59,63 ****
          fail("Parser did not report error on NUL-byte.");
      if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
!         xml_failure();
  }
  END_TEST
--- 59,63 ----
          fail("Parser did not report error on NUL-byte.");
      if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
!         xml_failure(parser);
  }
  END_TEST
***************
*** 72,76 ****
          fail("Parser did not report error on NUL-byte.");
      if (XML_GetErrorCode(parser) != XML_ERROR_BAD_CHAR_REF)
!         xml_failure();
  }
  END_TEST
--- 72,76 ----
          fail("Parser did not report error on NUL-byte.");
      if (XML_GetErrorCode(parser) != XML_ERROR_BAD_CHAR_REF)
!         xml_failure(parser);
  }
  END_TEST
***************
*** 82,86 ****
  
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure();
  }
  END_TEST
--- 82,86 ----
  
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure(parser);
  }
  END_TEST
***************
*** 91,95 ****
  
      if (!XML_Parse(parser, text, sizeof(text) - 1, 1))
!         xml_failure();
  }
  END_TEST
--- 91,95 ----
  
      if (!XML_Parse(parser, text, sizeof(text) - 1, 1))
!         xml_failure(parser);
  }
  END_TEST
***************
*** 100,104 ****
  
      if (!XML_Parse(parser, text, sizeof(text) - 1, 1))
!         xml_failure();
  }
  END_TEST
--- 100,104 ----
  
      if (!XML_Parse(parser, text, sizeof(text) - 1, 1))
!         xml_failure(parser);
  }
  END_TEST
***************
*** 131,135 ****
      XML_SetCharacterDataHandler(parser, accumulate_characters);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure();
      CharData_CheckXMLChars(&storage, expected);
  }
--- 131,135 ----
      XML_SetCharacterDataHandler(parser, accumulate_characters);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure(parser);
      CharData_CheckXMLChars(&storage, expected);
  }
***************
*** 144,148 ****
      XML_SetStartElementHandler(parser, accumulate_attribute);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure();
      CharData_CheckXMLChars(&storage, expected);
  }
--- 144,148 ----
      XML_SetStartElementHandler(parser, accumulate_attribute);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure(parser);
      CharData_CheckXMLChars(&storage, expected);
  }
***************
*** 221,225 ****
          }
          else if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
!             xml_failure();
      }
  }
--- 221,225 ----
          }
          else if (XML_GetErrorCode(parser) != XML_ERROR_INVALID_TOKEN)
!             xml_failure(parser);
      }
  }
***************
*** 240,244 ****
          "\000d\000o\000c\000>";
      if (!XML_Parse(parser, text, sizeof(text) - 1, 1))
!         xml_failure();
  }
  END_TEST
--- 240,244 ----
          "\000d\000o\000c\000>";
      if (!XML_Parse(parser, text, sizeof(text) - 1, 1))
!         xml_failure(parser);
  }
  END_TEST
***************
*** 370,374 ****
                                 check_attr_contains_normalized_whitespace);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure();
  }
  END_TEST
--- 370,374 ----
                                 check_attr_contains_normalized_whitespace);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure(parser);
  }
  END_TEST
***************
*** 388,392 ****
      if (!XML_Parse(parser, text, strlen(text), 1)) {
          if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI)
!             xml_failure();
      }
      else {
--- 388,392 ----
      if (!XML_Parse(parser, text, strlen(text), 1)) {
          if (XML_GetErrorCode(parser) != XML_ERROR_MISPLACED_XML_PI)
!             xml_failure(parser);
      }
      else {
***************
*** 464,468 ****
      XML_SetElementHandler(parser, triplet_start_checker, triplet_end_checker);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure();
  }
  END_TEST
--- 464,468 ----
      XML_SetElementHandler(parser, triplet_start_checker, triplet_end_checker);
      if (!XML_Parse(parser, text, strlen(text), 1))
!         xml_failure(parser);
  }
  END_TEST