changeset 39260:dbcb0cf93c71

mbrtowc tests: Fix regression on glibc. Reported by Bernhard Voelker. * tests/test-mbrtowc.c (main): Fix expected value of wc.
author Bruno Haible <bruno@clisp.org>
date Sun, 25 Feb 2018 01:56:35 +0100
parents 07d8af8dde81
children c18e05f31581
files ChangeLog tests/test-mbrtowc.c
diffstat 2 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog	Sat Feb 24 08:55:16 2018 -0800
+++ b/ChangeLog	Sun Feb 25 01:56:35 2018 +0100
@@ -1,3 +1,9 @@
+2018-02-24  Bruno Haible  <bruno@clisp.org>
+
+	mbrtowc tests: Fix regression on glibc.
+	Reported by Bernhard Voelker.
+	* tests/test-mbrtowc.c (main): Fix expected value of wc.
+
 2018-02-24  Bruno Haible  <bruno@clisp.org>
 
 	striconveha, uniconv/*: Avoid test failures on musl libc.
--- a/tests/test-mbrtowc.c	Sat Feb 24 08:55:16 2018 -0800
+++ b/tests/test-mbrtowc.c	Sun Feb 25 01:56:35 2018 +0100
@@ -111,7 +111,7 @@
                locale.
                On most platforms, the bytes 0x80..0xFF map to U+0080..U+00FF.
                But on musl libc, the bytes 0x80..0xFF map to U+DF80..U+DFFF.  */
-            ASSERT (wc == btowc (c));
+            ASSERT (wc == (btowc (c) == WEOF ? c : btowc (c)));
           ASSERT (mbsinit (&state));
           ret = mbrtowc (NULL, buf, 1, &state);
           ASSERT (ret == 1);