[Expat-checkins] expat/tests runtests.c,1.20,1.21

fdrake@users.sourceforge.net fdrake@users.sourceforge.net
Fri Jun 28 06:36:03 2002


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

Modified Files:
	runtests.c 
Log Message:
Add a regression test that might tickle SF bug #422239.  See comments
for more information.


Index: runtests.c
===================================================================
RCS file: /cvsroot/expat/expat/tests/runtests.c,v
retrieving revision 1.20
retrieving revision 1.21
diff -u -d -r1.20 -r1.21
--- runtests.c	22 May 2002 20:22:25 -0000	1.20
+++ runtests.c	28 Jun 2002 13:35:44 -0000	1.21
@@ -262,6 +262,28 @@
 }
 END_TEST
 
+/* Regression test for SF bug #422239 (maybe).
+   It's not clear that this reproduces enough of the context
+   of the reported bug.
+*/
+START_TEST(test_line_count)
+{
+    char *text =
+        "<e>\n"
+        "  <e/>\n"
+        "</e>";
+    int lineno;
+    if (!XML_Parse(parser, text, strlen(text), 1))
+        xml_failure(parser);
+    lineno = XML_GetCurrentLineNumber(parser);
+    if (lineno != 3) {
+        char buffer[100];
+        sprintf(buffer, "expected 3 lines, saw %d", lineno);
+        fail(buffer);
+    }
+}
+END_TEST
+
 
 /*
  * Attribute tests.
@@ -495,6 +517,7 @@
     tcase_add_test(tc_chars, test_french_charref_decimal);
     tcase_add_test(tc_chars, test_french_latin1);
     tcase_add_test(tc_chars, test_french_utf8);
+    tcase_add_test(tc_chars, test_line_count);
 
     suite_add_tcase(s, tc_attrs);
     tcase_add_checked_fixture(tc_attrs, basic_setup, basic_teardown);