]> granicus.if.org Git - vim/commitdiff
patch 8.2.0234: message test fails on SunOS v8.2.0234
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Feb 2020 16:14:46 +0000 (17:14 +0100)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Feb 2020 16:14:46 +0000 (17:14 +0100)
Problem:    Message test fails on SunOS.
Solution:   Adjust expectation for printf "%p". (Ozaki Kiichi, closes #5595)

src/message_test.c
src/version.c

index 3397a9cb475ebee39348086166a6b4fc87dc2184..7f6540b310105a7264218cf5cef333f944f639d4 100644 (file)
@@ -240,14 +240,26 @@ test_vim_snprintf(void)
 
        // %p format is not tested in vim script tests Test_printf*()
        // as it only makes sense in C code.
+       // NOTE: SunOS libc doesn't use the prefix "0x" on %p.
+#ifdef SUN_SYSTEM
+# define PREFIX_LEN  0
+# define PREFIX_STR1 ""
+# define PREFIX_STR2 "00"
+#else
+# define PREFIX_LEN  2
+# define PREFIX_STR1 "0x"
+# define PREFIX_STR2 "0x"
+#endif
        n = vim_snprintf(buf, bsize, "%p", ptr);
-       assert(n == 10);
-       assert(bsize == 0 || STRNCMP(buf, "0x87654321", bsize_int) == 0);
+       assert(n == 8 + PREFIX_LEN);
+       assert(bsize == 0
+                    || STRNCMP(buf, PREFIX_STR1 "87654321", bsize_int) == 0);
        assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0');
 
        n = vim_snprintf(buf, bsize, fmt_012p, ptr);
        assert(n == 12);
-       assert(bsize == 0 || STRNCMP(buf, "0x0087654321", bsize_int) == 0);
+       assert(bsize == 0
+                  || STRNCMP(buf, PREFIX_STR2 "0087654321", bsize_int) == 0);
        assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0');
 
        free(buf);
index 99c63569d14871fabf0064023c7b7a22dfed1ebf..e1c6e319bf0f537d4752a2e45a35fbd56de657d3 100644 (file)
@@ -742,6 +742,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    234,
 /**/
     233,
 /**/