diff options
author | Bruno Haible <bruno@clisp.org> | 2023-03-30 13:20:29 +0200 |
---|---|---|
committer | Bruno Haible <bruno@clisp.org> | 2023-03-30 17:57:36 +0200 |
commit | 60745587a2e0073df7fe4cb1ec462f423c8f2bb2 (patch) | |
tree | b0cd34b200537c43bf5e0c671c7279d0778bdb57 /tests | |
parent | 4993fb36f8c9d1a18b33285a941ae3ed2aa54c59 (diff) | |
download | gnulib-60745587a2e0073df7fe4cb1ec462f423c8f2bb2.tar.gz |
mbrtowc tests: Add comment.
* tests/test-mbrtowc.c: Add comment.
* tests/test-mbrtowc5.sh: Use symmetric coding style.
* doc/posix-functions/mbrtowc.texi: Update.
Diffstat (limited to 'tests')
-rw-r--r-- | tests/test-mbrtowc.c | 2 | ||||
-rwxr-xr-x | tests/test-mbrtowc5.sh | 7 |
2 files changed, 7 insertions, 2 deletions
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 |