From c74d7bca16d42960fc1c25a0d3d1d39aeca3b7a3 Mon Sep 17 00:00:00 2001 From: "Fred L. Drake, Jr." Date: Fri, 28 Jun 2002 13:35:44 +0000 Subject: [PATCH] Add a regression test that might tickle SF bug #422239. See comments for more information. --- expat/tests/runtests.c | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 1403a445..50346cbe 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -262,6 +262,28 @@ START_TEST(test_latin1_umlauts) } 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 = + "\n" + " \n" + ""; + 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 @@ make_basic_suite(void) 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); -- 2.40.0