mirror of
https://github.com/libexpat/libexpat.git
synced 2025-04-15 00:38:15 +00:00
Extend coverage of byte information function tests
This commit is contained in:
parent
2dbc5c800b
commit
a0eca419bd
1 changed files with 16 additions and 0 deletions
|
@ -2224,6 +2224,21 @@ START_TEST(test_byte_info_at_end)
|
|||
}
|
||||
END_TEST
|
||||
|
||||
/* Test position information from errors */
|
||||
START_TEST(test_byte_info_at_error)
|
||||
{
|
||||
const char *text = "<doc></wombat></doc>";
|
||||
|
||||
if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
|
||||
XML_TRUE) == XML_STATUS_OK)
|
||||
fail("Syntax error not faulted");
|
||||
if (XML_GetCurrentByteCount(parser) != 0)
|
||||
fail("Error byte count incorrect");
|
||||
if (XML_GetCurrentByteIndex(parser) != 7)
|
||||
fail("Error byte index incorrect");
|
||||
}
|
||||
END_TEST
|
||||
|
||||
|
||||
/*
|
||||
* Namespaces tests.
|
||||
|
@ -3302,6 +3317,7 @@ make_suite(void)
|
|||
tcase_add_test(tc_basic, test_get_buffer_1);
|
||||
tcase_add_test(tc_basic, test_get_buffer_2);
|
||||
tcase_add_test(tc_basic, test_byte_info_at_end);
|
||||
tcase_add_test(tc_basic, test_byte_info_at_error);
|
||||
|
||||
suite_add_tcase(s, tc_namespace);
|
||||
tcase_add_checked_fixture(tc_namespace,
|
||||
|
|
Loading…
Add table
Reference in a new issue