From 00893e79fc62966067af1a106567db96bd170338 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sun, 3 Mar 2024 19:11:32 +0100 Subject: New upstream version 1.2 --- tests/test-wcrtomb-w32.c | 42 +++++++++++++++++++++--------------------- 1 file changed, 21 insertions(+), 21 deletions(-) (limited to 'tests/test-wcrtomb-w32.c') diff --git a/tests/test-wcrtomb-w32.c b/tests/test-wcrtomb-w32.c index 67fa5a31..4be9a0df 100644 --- a/tests/test-wcrtomb-w32.c +++ b/tests/test-wcrtomb-w32.c @@ -1,5 +1,5 @@ /* Test of conversion of wide character to multibyte character. - Copyright (C) 2008-2022 Free Software Foundation, Inc. + Copyright (C) 2008-2024 Free Software Foundation, Inc. This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -184,6 +184,26 @@ test_one_locale (const char *name, int codepage) } return 0; + case 65001: + /* Locale encoding is CP65001 = UTF-8. */ + if (strcmp (locale_charset (), "UTF-8") != 0) + return 77; + { + /* Convert "B\303\274\303\237er": "Büßer" */ + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00FC, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\303\274", 2) == 0); + ASSERT (buf[2] == 'x'); + + memset (buf, 'x', 8); + ret = wcrtomb (buf, 0x00DF, NULL); + ASSERT (ret == 2); + ASSERT (memcmp (buf, "\303\237", 2) == 0); + ASSERT (buf[2] == 'x'); + } + return 0; + case 932: /* Locale encoding is CP932, similar to Shift_JIS. */ { @@ -276,26 +296,6 @@ test_one_locale (const char *name, int codepage) } return 0; - case 65001: - /* Locale encoding is CP65001 = UTF-8. */ - if (strcmp (locale_charset (), "UTF-8") != 0) - return 77; - { - /* Convert "B\303\274\303\237er": "Büßer" */ - memset (buf, 'x', 8); - ret = wcrtomb (buf, 0x00FC, NULL); - ASSERT (ret == 2); - ASSERT (memcmp (buf, "\303\274", 2) == 0); - ASSERT (buf[2] == 'x'); - - memset (buf, 'x', 8); - ret = wcrtomb (buf, 0x00DF, NULL); - ASSERT (ret == 2); - ASSERT (memcmp (buf, "\303\237", 2) == 0); - ASSERT (buf[2] == 'x'); - } - return 0; - default: return 1; } -- cgit v1.2.3