0
0
mirror of https://github.com/vim/vim.git synced 2025-09-26 04:04:07 -04:00

patch 8.2.0234: message test fails on SunOS

Problem:    Message test fails on SunOS.
Solution:   Adjust expectation for printf "%p". (Ozaki Kiichi, closes #5595)
This commit is contained in:
Bram Moolenaar
2020-02-08 17:14:46 +01:00
parent 4f645c54ef
commit d5b9914938
2 changed files with 17 additions and 3 deletions

View File

@@ -240,14 +240,26 @@ test_vim_snprintf(void)
// %p format is not tested in vim script tests Test_printf*() // %p format is not tested in vim script tests Test_printf*()
// as it only makes sense in C code. // 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); n = vim_snprintf(buf, bsize, "%p", ptr);
assert(n == 10); assert(n == 8 + PREFIX_LEN);
assert(bsize == 0 || STRNCMP(buf, "0x87654321", bsize_int) == 0); assert(bsize == 0
|| STRNCMP(buf, PREFIX_STR1 "87654321", bsize_int) == 0);
assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0'); assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0');
n = vim_snprintf(buf, bsize, fmt_012p, ptr); n = vim_snprintf(buf, bsize, fmt_012p, ptr);
assert(n == 12); 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'); assert(bsize == 0 || buf[MIN(n, bsize_int)] == '\0');
free(buf); free(buf);

View File

@@ -742,6 +742,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
234,
/**/ /**/
233, 233,
/**/ /**/