diff options
-rw-r--r-- | ChangeLog | 7 | ||||
-rw-r--r-- | doc/posix-functions/mbrtowc.texi | 2 | ||||
-rw-r--r-- | tests/test-mbrtowc.c | 2 | ||||
-rwxr-xr-x | tests/test-mbrtowc5.sh | 7 |
4 files changed, 15 insertions, 3 deletions
@@ -1,5 +1,12 @@ 2023-03-30 Bruno Haible <bruno@clisp.org> + mbrtowc tests: Add comment. + * tests/test-mbrtowc.c: Add comment. + * tests/test-mbrtowc5.sh: Use symmetric coding style. + * doc/posix-functions/mbrtowc.texi: Update. + +2023-03-30 Bruno Haible <bruno@clisp.org> + stdlib tests: Check behaviour of C locale. * tests/test-stdlib.c (main): Check MB_CUR_MAX. diff --git a/doc/posix-functions/mbrtowc.texi b/doc/posix-functions/mbrtowc.texi index d663d11bd8..bcba3f4c53 100644 --- a/doc/posix-functions/mbrtowc.texi +++ b/doc/posix-functions/mbrtowc.texi @@ -14,7 +14,7 @@ Minix 3.1.8, HP-UX 11.00, IRIX 6.5, mingw. @item In the C or POSIX locales, this function can return @code{(size_t) -1} and set @code{errno} to @code{EILSEQ}: -glibc 2.23. +glibc 2.35. @item This function returns 0 instead of @code{(size_t) -2} when the input is empty: diff --git a/tests/test-mbrtowc.c b/tests/test-mbrtowc.c index 1fdf039c42..cf43011cad 100644 --- a/tests/test-mbrtowc.c +++ b/tests/test-mbrtowc.c @@ -367,6 +367,8 @@ main (int argc, char *argv[]) wc = (wchar_t) 0xBADFACE; ret = mbrtowc (&wc, buf, 1, &state); + /* POSIX:2018 says: "In the POSIX locale an [EILSEQ] error + cannot occur since all byte values are valid characters." */ ASSERT (ret == 1); if (c < 0x80) /* c is an ASCII character. */ diff --git a/tests/test-mbrtowc5.sh b/tests/test-mbrtowc5.sh index 490496de2b..4c6c6fe868 100755 --- a/tests/test-mbrtowc5.sh +++ b/tests/test-mbrtowc5.sh @@ -1,6 +1,9 @@ #!/bin/sh + # Test whether the POSIX locale has encoding errors. LC_ALL=C \ -${CHECKER} ./test-mbrtowc${EXEEXT} 5 || exit +${CHECKER} ./test-mbrtowc${EXEEXT} 5 || exit 1 LC_ALL=POSIX \ -${CHECKER} ./test-mbrtowc${EXEEXT} 5 +${CHECKER} ./test-mbrtowc${EXEEXT} 5 || exit 1 + +exit 0 |