]> granicus.if.org Git - libexpat/commitdiff
Split long string in test_nsalloc_long_namespace()
authorRhodri James <rhodri@kynesim.co.uk>
Tue, 29 Aug 2017 15:08:09 +0000 (16:08 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 29 Aug 2017 21:21:52 +0000 (23:21 +0200)
C99 compilers are only obliged to cope with 4095 character strings
literals.  Split the parse string so that it is under this limit.

expat/tests/runtests.c

index 66c892815d5e19eea0d3c1f8ecd8638bd705ac7c..850c7ba8c8d5ce46e89bcd7972b9d48b9a44774f 100644 (file)
@@ -11085,7 +11085,7 @@ END_TEST
 
 START_TEST(test_nsalloc_long_namespace)
 {
-    const char *text =
+    const char *text1 =
         "<"
         /* 64 characters per line */
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
@@ -11121,7 +11121,8 @@ START_TEST(test_nsalloc_long_namespace)
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
-        "='http://example.org/'>\n"
+        "='http://example.org/'>\n";
+    const char *text2 =
         "<"
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
         "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789AZ"
@@ -11180,7 +11181,9 @@ START_TEST(test_nsalloc_long_namespace)
 
     for (i = 0; i < max_alloc_count; i++) {
         allocation_count = i;
-        if (_XML_Parse_SINGLE_BYTES(parser, text, strlen(text),
+        if (_XML_Parse_SINGLE_BYTES(parser, text1, strlen(text1),
+                                    XML_FALSE) != XML_STATUS_ERROR &&
+            _XML_Parse_SINGLE_BYTES(parser, text2, strlen(text2),
                                     XML_TRUE) != XML_STATUS_ERROR)
             break;
         /* See comment in test_nsalloc_xmlns() */