From d697e270383598b63dd813ebaaf4e687a2901fad Mon Sep 17 00:00:00 2001 From: Rhodri James Date: Wed, 15 Mar 2017 12:33:03 +0000 Subject: [PATCH] Review 2017-03-13: replace magic number with appropriate string len --- expat/tests/runtests.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index 79fbe522..10e781cf 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -3673,19 +3673,23 @@ START_TEST(test_byte_info_at_end) END_TEST /* Test position information from errors */ +#define PRE_ERROR_STR "" START_TEST(test_byte_info_at_error) { - const char *text = ""; + const char *text = PRE_ERROR_STR POST_ERROR_STR; 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) + if (XML_GetCurrentByteIndex(parser) != strlen(PRE_ERROR_STR)) fail("Error byte index incorrect"); } END_TEST +#undef PRE_ERROR_STR +#undef POST_ERROR_STR /* Test position information in handler */ static void -- 2.40.0