* tests/test-c32rtomb.sh: Renamed 1 -> 2 -> 3 -> 4 -> 5 -> 1.
* tests/test-c32rtomb.c: Update.
* tests/test-c32rtomb-w32-*.sh: Renamed 1 -> 2 -> 3 -> 5 -> 7 -> 4 -> 6 -> 8.
* tests/test-c32rtomb-w32.c: Update.
* modules/c32rtomb-tests: Update.
2023-07-29 Bruno Haible <bruno@clisp.org>
+ c32rtomb tests: Renumber tests.
+ * tests/test-c32rtomb.sh: Renamed 1 -> 2 -> 3 -> 4 -> 5 -> 1.
+ * tests/test-c32rtomb.c: Update.
+ * tests/test-c32rtomb-w32-*.sh: Renamed 1 -> 2 -> 3 -> 5 -> 7 -> 4 -> 6
+ -> 8.
+ * tests/test-c32rtomb-w32.c: Update.
+ * modules/c32rtomb-tests: Update.
+
btoc32 tests: Renumber tests.
* tests/test-btoc32-*.sh: Renamed 1 -> 2 -> 3 -> 1.
* tests/test-btoc32.c: Update.
Files:
tests/test-c32rtomb.sh
tests/test-c32rtomb.c
-tests/test-c32rtomb-w32-1.sh
tests/test-c32rtomb-w32-2.sh
tests/test-c32rtomb-w32-3.sh
tests/test-c32rtomb-w32-4.sh
tests/test-c32rtomb-w32-5.sh
tests/test-c32rtomb-w32-6.sh
tests/test-c32rtomb-w32-7.sh
+tests/test-c32rtomb-w32-8.sh
tests/test-c32rtomb-w32.c
tests/signature.h
tests/macros.h
Makefile.am:
TESTS += \
test-c32rtomb.sh \
- test-c32rtomb-w32-1.sh test-c32rtomb-w32-2.sh test-c32rtomb-w32-3.sh \
- test-c32rtomb-w32-4.sh test-c32rtomb-w32-5.sh test-c32rtomb-w32-6.sh \
- test-c32rtomb-w32-7.sh
+ test-c32rtomb-w32-2.sh test-c32rtomb-w32-3.sh test-c32rtomb-w32-4.sh \
+ test-c32rtomb-w32-5.sh test-c32rtomb-w32-6.sh test-c32rtomb-w32-7.sh \
+ test-c32rtomb-w32-8.sh
TESTS_ENVIRONMENT += \
LOCALE_FR='@LOCALE_FR@' \
LOCALE_FR_UTF8='@LOCALE_FR_UTF8@' \
+++ /dev/null
-#!/bin/sh
-
-# Test a CP1252 locale.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} French_France 1252
#!/bin/sh
-# Test a CP1256 locale.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
+# Test a CP1252 locale.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} French_France 1252
#!/bin/sh
-# Test a CP932 locale.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} Japanese_Japan 932
+# Test a CP1256 locale.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} "Arabic_Saudi Arabia" 1256
#!/bin/sh
-# Test a CP950 locale.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} Chinese_Taiwan 950
+# Test some UTF-8 locales.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001
#!/bin/sh
-# Test a CP936 locale.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} Chinese_China 936
+# Test a CP932 locale.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} Japanese_Japan 932
#!/bin/sh
-# Test a GB18030 locale.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} Chinese_China 54936
+# Test a CP950 locale.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} Chinese_Taiwan 950
#!/bin/sh
-# Test some UTF-8 locales.
-${CHECKER} ./test-c32rtomb-w32${EXEEXT} French_France Japanese_Japan Chinese_Taiwan Chinese_China 65001
+# Test a CP936 locale.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} Chinese_China 936
--- /dev/null
+#!/bin/sh
+
+# Test a GB18030 locale.
+${CHECKER} ./test-c32rtomb-w32${EXEEXT} Chinese_China 54936
}
return 0;
+ case 65001:
+ /* Locale encoding is CP65001 = UTF-8. */
+ if (strcmp (locale_charset (), "UTF-8") != 0)
+ return 77;
+ {
+ /* Convert "s\303\274\303\237\360\237\230\213!"; "süß😋!" */
+ memset (buf, 'x', 8);
+ ret = c32rtomb (buf, 0x00FC, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\303\274", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = c32rtomb (buf, 0x00DF, NULL);
+ ASSERT (ret == 2);
+ ASSERT (memcmp (buf, "\303\237", 2) == 0);
+ ASSERT (buf[2] == 'x');
+
+ memset (buf, 'x', 8);
+ ret = c32rtomb (buf, 0x1F60B, NULL);
+ ASSERT (ret == 4);
+ ASSERT (memcmp (buf, "\360\237\230\213", 4) == 0);
+ ASSERT (buf[4] == 'x');
+ }
+ return 0;
+
case 932:
/* Locale encoding is CP932, similar to Shift_JIS. */
{
}
return 0;
- case 65001:
- /* Locale encoding is CP65001 = UTF-8. */
- if (strcmp (locale_charset (), "UTF-8") != 0)
- return 77;
- {
- /* Convert "s\303\274\303\237\360\237\230\213!"; "süß😋!" */
- memset (buf, 'x', 8);
- ret = c32rtomb (buf, 0x00FC, NULL);
- ASSERT (ret == 2);
- ASSERT (memcmp (buf, "\303\274", 2) == 0);
- ASSERT (buf[2] == 'x');
-
- memset (buf, 'x', 8);
- ret = c32rtomb (buf, 0x00DF, NULL);
- ASSERT (ret == 2);
- ASSERT (memcmp (buf, "\303\237", 2) == 0);
- ASSERT (buf[2] == 'x');
-
- memset (buf, 'x', 8);
- ret = c32rtomb (buf, 0x1F60B, NULL);
- ASSERT (ret == 4);
- ASSERT (memcmp (buf, "\360\237\230\213", 4) == 0);
- ASSERT (buf[4] == 'x');
- }
- return 0;
-
default:
return 1;
}
switch (argv[1][0])
{
case '1':
+ /* C locale; tested above. */
+ return 0;
+
+ case '2':
/* Locale encoding is ISO-8859-1 or ISO-8859-15. */
{
const char input[] = "B\374\337er"; /* "Büßer" */
}
return 0;
- case '2':
+ case '3':
/* Locale encoding is UTF-8. */
{
const char input[] = "s\303\274\303\237\360\237\230\213!"; /* "süß😋!" */
}
return 0;
- case '3':
+ case '4':
/* Locale encoding is EUC-JP. */
{
const char input[] = "<\306\374\313\334\270\354>"; /* "<日本語>" */
}
return 0;
- case '4':
+ case '5':
/* Locale encoding is GB18030. */
#if GL_CHAR32_T_IS_UNICODE && (defined __NetBSD__ || defined __sun)
fputs ("Skipping test: The GB18030 converter in this system's iconv is broken.\n", stderr);
check_character (input + 7, 4);
}
return 0;
-
- case '5':
- /* C locale; tested above. */
- return 0;
}
return 1;
#!/bin/sh
+# Test in the POSIX locale.
+LC_ALL=C ${CHECKER} ./test-c32rtomb${EXEEXT} 1 || exit 1
+LC_ALL=POSIX ${CHECKER} ./test-c32rtomb${EXEEXT} 1 || exit 1
+
# Test in an ISO-8859-1 or ISO-8859-15 locale.
: "${LOCALE_FR=fr_FR}"
if test $LOCALE_FR != none; then
LC_ALL=$LOCALE_FR \
- ${CHECKER} ./test-c32rtomb${EXEEXT} 1 \
+ ${CHECKER} ./test-c32rtomb${EXEEXT} 2 \
|| exit 1
fi
: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
if test $LOCALE_FR_UTF8 != none; then
LC_ALL=$LOCALE_FR_UTF8 \
- ${CHECKER} ./test-c32rtomb${EXEEXT} 2 \
+ ${CHECKER} ./test-c32rtomb${EXEEXT} 3 \
|| exit 1
fi
: "${LOCALE_JA=ja_JP}"
if test $LOCALE_JA != none; then
LC_ALL=$LOCALE_JA \
- ${CHECKER} ./test-c32rtomb${EXEEXT} 3 \
+ ${CHECKER} ./test-c32rtomb${EXEEXT} 4 \
|| exit 1
fi
: "${LOCALE_ZH_CN=zh_CN.GB18030}"
if test $LOCALE_ZH_CN != none; then
LC_ALL=$LOCALE_ZH_CN \
- ${CHECKER} ./test-c32rtomb${EXEEXT} 4
+ ${CHECKER} ./test-c32rtomb${EXEEXT} 5
case $? in
0 | 77) ;;
*) exit 1 ;;
esac
fi
-# Test in the POSIX locale.
-LC_ALL=C ${CHECKER} ./test-c32rtomb${EXEEXT} 5 || exit 1
-LC_ALL=POSIX ${CHECKER} ./test-c32rtomb${EXEEXT} 5 || exit 1
-
exit 0