]> Savannah Git Hosting - gnulib.git/commitdiff
mbrtowc tests: Add comment.
authorBruno Haible <bruno@clisp.org>
Thu, 30 Mar 2023 11:20:29 +0000 (13:20 +0200)
committerBruno Haible <bruno@clisp.org>
Thu, 30 Mar 2023 15:57:36 +0000 (17:57 +0200)
* tests/test-mbrtowc.c: Add comment.
* tests/test-mbrtowc5.sh: Use symmetric coding style.
* doc/posix-functions/mbrtowc.texi: Update.

ChangeLog
doc/posix-functions/mbrtowc.texi
tests/test-mbrtowc.c
tests/test-mbrtowc5.sh

index ba75036c75bc00dc8c49286377a919370957d80e..a118bfc9507d7062e5c66f181fc29c12610576e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+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.
index d663d11bd88ce959737d52e5006c1d23eca5717c..bcba3f4c531c080f908db33f0249d185eab81a11 100644 (file)
@@ -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:
index 1fdf039c428c28fe8738ea241434d3e16282b462..cf43011cadc22ac9dccbffc6fb5e4c114d146cfc 100644 (file)
@@ -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.  */
index 490496de2b69d97a55141cfcea6717541bb12818..4c6c6fe868e05829458ca894091d866079770990 100755 (executable)
@@ -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