To: vim_dev@googlegroups.com Subject: Patch 8.2.0234 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.2.0234 Problem: Message test fails on SunOS. Solution: Adjust expectation for printf "%p". (Ozaki Kiichi, closes #5595) Files: src/message_test.c *** ../vim-8.2.0233/src/message_test.c 2020-01-14 22:01:38.866994004 +0100 --- src/message_test.c 2020-02-08 16:58:12.139260686 +0100 *************** *** 240,253 **** // %p format is not tested in vim script tests Test_printf*() // as it only makes sense in C code. n = vim_snprintf(buf, bsize, "%p", ptr); ! assert(n == 10); ! assert(bsize == 0 || STRNCMP(buf, "0x87654321", 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 || buf[MIN(n, bsize_int)] == '\0'); free(buf); --- 240,265 ---- // %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 == 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, PREFIX_STR2 "0087654321", bsize_int) == 0); assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0'); free(buf); *** ../vim-8.2.0233/src/version.c 2020-02-08 16:39:45.427835657 +0100 --- src/version.c 2020-02-08 16:57:06.819526802 +0100 *************** *** 744,745 **** --- 744,747 ---- { /* Add new patch number below this line */ + /**/ + 234, /**/ -- Never overestimate a man's ability to underestimate a woman. /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///