]> Savannah Git Hosting - gnulib.git/commitdiff
btoc32 tests: Renumber tests.
authorBruno Haible <bruno@clisp.org>
Sat, 29 Jul 2023 19:44:56 +0000 (21:44 +0200)
committerBruno Haible <bruno@clisp.org>
Sat, 29 Jul 2023 19:44:56 +0000 (21:44 +0200)
* tests/test-btoc32-*.sh: Renamed 1 -> 2 -> 3 -> 1.
* tests/test-btoc32.c: Update.

ChangeLog
tests/test-btoc32-1.sh
tests/test-btoc32-2.sh
tests/test-btoc32-3.sh
tests/test-btoc32.c

index a46ceef2b123767da15cba63c070fa58b0f2d504..55188989db58823f21d448829cfa404df1fda0ee 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2023-07-29  Bruno Haible  <bruno@clisp.org>
 
+       btoc32 tests: Renumber tests.
+       * tests/test-btoc32-*.sh: Renamed 1 -> 2 -> 3 -> 1.
+       * tests/test-btoc32.c: Update.
+
        btowc tests: Renumber tests.
        * tests/test-btowc*.sh: Renamed 1 -> 2 -> 3 -> 1.
        * tests/test-btowc.c: Update.
index 42a479845ffa292f62b64a1784da3d06c085e880..25caea64d5f96f115cc1d1fbcf19e44050c9da04 100755 (executable)
@@ -1,15 +1,9 @@
 #!/bin/sh
 
-# Test in an ISO-8859-1 or ISO-8859-15 locale.
-: "${LOCALE_FR=fr_FR}"
-if test $LOCALE_FR = none; then
-  if test -f /usr/bin/localedef; then
-    echo "Skipping test: no traditional french locale is installed"
-  else
-    echo "Skipping test: no traditional french locale is supported"
-  fi
-  exit 77
-fi
+# Test whether the POSIX locale has encoding errors.
+LC_ALL=C \
+${CHECKER} ./test-btoc32${EXEEXT} 1 || exit 1
+LC_ALL=POSIX \
+${CHECKER} ./test-btoc32${EXEEXT} 1 || exit 1
 
-LC_ALL=$LOCALE_FR \
-${CHECKER} ./test-btoc32${EXEEXT} 1
+exit 0
index 3a7b267ee741a867bb37383379dccdd1187ec0ca..ba52767bd2a581bc1399035e72ae3528611ad959 100755 (executable)
@@ -1,15 +1,15 @@
 #!/bin/sh
 
-# Test whether a specific UTF-8 locale is installed.
-: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
-if test $LOCALE_FR_UTF8 = none; then
+# Test in an ISO-8859-1 or ISO-8859-15 locale.
+: "${LOCALE_FR=fr_FR}"
+if test $LOCALE_FR = none; then
   if test -f /usr/bin/localedef; then
-    echo "Skipping test: no french Unicode locale is installed"
+    echo "Skipping test: no traditional french locale is installed"
   else
-    echo "Skipping test: no french Unicode locale is supported"
+    echo "Skipping test: no traditional french locale is supported"
   fi
   exit 77
 fi
 
-LC_ALL=$LOCALE_FR_UTF8 \
+LC_ALL=$LOCALE_FR \
 ${CHECKER} ./test-btoc32${EXEEXT} 2
index 422c3daed510f569a7bfb4943e153a67066b0582..8c6b180369d1780391b2862a6964feb6a2e903e5 100755 (executable)
@@ -1,9 +1,15 @@
 #!/bin/sh
 
-# Test whether the POSIX locale has encoding errors.
-LC_ALL=C \
-${CHECKER} ./test-btoc32${EXEEXT} 3 || exit 1
-LC_ALL=POSIX \
-${CHECKER} ./test-btoc32${EXEEXT} 3 || exit 1
+# Test whether a specific UTF-8 locale is installed.
+: "${LOCALE_FR_UTF8=fr_FR.UTF-8}"
+if test $LOCALE_FR_UTF8 = none; then
+  if test -f /usr/bin/localedef; then
+    echo "Skipping test: no french Unicode locale is installed"
+  else
+    echo "Skipping test: no french Unicode locale is supported"
+  fi
+  exit 77
+fi
 
-exit 0
+LC_ALL=$LOCALE_FR_UTF8 \
+${CHECKER} ./test-btoc32${EXEEXT} 3
index a2c48dde6f03abc70a5c445663a9a8649566dffb..57ec1ebfa6195ee9f507a7ffcf1128cd4535f8a7 100644 (file)
@@ -45,30 +45,14 @@ main (int argc, char *argv[])
      "C" locale.  Furthermore, when you attempt to set the "C" or "POSIX"
      locale via setlocale(), what you get is a "C" locale with UTF-8 encoding,
      that is, effectively the "C.UTF-8" locale.  */
-  if (argc > 1 && strcmp (argv[1], "3") == 0 && MB_CUR_MAX > 1)
-    argv[1] = "2";
+  if (argc > 1 && strcmp (argv[1], "1") == 0 && MB_CUR_MAX > 1)
+    argv[1] = "3";
 #endif
 
   if (argc > 1)
     switch (argv[1][0])
       {
       case '1':
-        /* Locale encoding is ISO-8859-1 or ISO-8859-15.  */
-        for (c = 0; c < 0x80; c++)
-          ASSERT (btoc32 (c) == c);
-        for (c = 0xA0; c < 0x100; c++)
-          ASSERT (btoc32 (c) != WEOF);
-        return 0;
-
-      case '2':
-        /* Locale encoding is UTF-8.  */
-        for (c = 0; c < 0x80; c++)
-          ASSERT (btoc32 (c) == c);
-        for (c = 0x80; c < 0x100; c++)
-          ASSERT (btoc32 (c) == WEOF);
-        return 0;
-
-      case '3':
         /* C or POSIX locale.  */
         for (c = 0; c < 0x100; c++)
           if (c != 0)
@@ -88,6 +72,22 @@ main (int argc, char *argv[])
                 ASSERT (wc == c || wc == 0xDF00 + c);
             }
         return 0;
+
+      case '2':
+        /* Locale encoding is ISO-8859-1 or ISO-8859-15.  */
+        for (c = 0; c < 0x80; c++)
+          ASSERT (btoc32 (c) == c);
+        for (c = 0xA0; c < 0x100; c++)
+          ASSERT (btoc32 (c) != WEOF);
+        return 0;
+
+      case '3':
+        /* Locale encoding is UTF-8.  */
+        for (c = 0; c < 0x80; c++)
+          ASSERT (btoc32 (c) == c);
+        for (c = 0x80; c < 0x100; c++)
+          ASSERT (btoc32 (c) == WEOF);
+        return 0;
       }
 
   return 1;