summary refs log tree commit diff
path: root/string
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>2013-07-17 10:26:58 +0200
committerAndreas Schwab <schwab@suse.de>2013-08-27 12:21:12 +0200
commit45b8acccaf43ec06d31413c75a8f1737ae3ff0e2 (patch)
tree1ad302dba87a6937959803853a32924f6f7f4a6b /string
parent5d228a436a8257f082e84671bf8c89b79a2c3853 (diff)
downloadglibc-45b8acccaf43ec06d31413c75a8f1737ae3ff0e2.tar.gz
glibc-45b8acccaf43ec06d31413c75a8f1737ae3ff0e2.tar.xz
glibc-45b8acccaf43ec06d31413c75a8f1737ae3ff0e2.zip
Fix missing declaration of LC_CTYPE nonascii-case element
Diffstat (limited to 'string')
-rw-r--r--string/Makefile4
-rw-r--r--string/test-strcasecmp.c26
-rw-r--r--string/test-strncasecmp.c26
3 files changed, 48 insertions, 8 deletions
diff --git a/string/Makefile b/string/Makefile
index 0237edd735..aaad74355a 100644
--- a/string/Makefile
+++ b/string/Makefile
@@ -65,6 +65,10 @@ noinl-tester-ENV = LANGUAGE=C
 tst-strxfrm-ENV = LOCPATH=$(common-objpfx)localedata
 tst-strxfrm2-ENV = LOCPATH=$(common-objpfx)localedata
 bug-strcoll1-ENV = LOCPATH=$(common-objpfx)localedata
+test-strcasecmp-ENV = LOCPATH=$(common-objpfx)localedata
+test-strncasecmp-ENV = LOCPATH=$(common-objpfx)localedata
+test-strcasecmp-ifunc-ENV = LOCPATH=$(common-objpfx)localedata
+test-strncasecmp-ifunc-ENV = LOCPATH=$(common-objpfx)localedata
 CFLAGS-inl-tester.c = -fno-builtin
 CFLAGS-noinl-tester.c = -fno-builtin
 CFLAGS-tst-strlen.c = -fno-builtin
diff --git a/string/test-strcasecmp.c b/string/test-strcasecmp.c
index f32150198f..bdfcccaa12 100644
--- a/string/test-strcasecmp.c
+++ b/string/test-strcasecmp.c
@@ -17,6 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <locale.h>
 #include <ctype.h>
 #define TEST_MAIN
 #define TEST_NAME "strcasecmp"
@@ -206,14 +207,18 @@ do_random_tests (void)
     }
 }
 
-int
-test_main (void)
+static void
+test_locale (const char *locale)
 {
   size_t i;
 
-  test_init ();
+  if (setlocale (LC_CTYPE, locale) == NULL)
+    {
+      error (0, 0, "cannot set locale \"%s\"", locale);
+      ret = 1;
+    }
 
-  printf ("%23s", "");
+  printf ("%-23s", locale);
   FOR_EACH_IMPL (impl, 0)
     printf ("\t%s", impl->name);
   putchar ('\n');
@@ -246,6 +251,19 @@ test_main (void)
     }
 
   do_random_tests ();
+}
+
+int
+test_main (void)
+{
+  test_init ();
+
+  test_locale ("C");
+  test_locale ("en_US.ISO-8859-1");
+  test_locale ("en_US.UTF-8");
+  test_locale ("tr_TR.ISO-8859-9");
+  test_locale ("tr_TR.UTF-8");
+
   return ret;
 }
 
diff --git a/string/test-strncasecmp.c b/string/test-strncasecmp.c
index 4eedd3d022..00eca4a26f 100644
--- a/string/test-strncasecmp.c
+++ b/string/test-strncasecmp.c
@@ -17,6 +17,7 @@
    License along with the GNU C Library; if not, see
    <http://www.gnu.org/licenses/>.  */
 
+#include <locale.h>
 #include <ctype.h>
 #define TEST_MAIN
 #define TEST_NAME "strncasecmp"
@@ -256,17 +257,21 @@ bz14195 (void)
     check_result (impl, empty_string, "", 5, 0);
 }
 
-int
-test_main (void)
+static void
+test_locale (const char *locale)
 {
   size_t i;
 
-  test_init ();
+  if (setlocale (LC_CTYPE, locale) == NULL)
+    {
+      error (0, 0, "cannot set locale \"%s\"", locale);
+      ret = 1;
+    }
 
   bz12205 ();
   bz14195 ();
 
-  printf ("%23s", "");
+  printf ("%23s", locale);
   FOR_EACH_IMPL (impl, 0)
     printf ("\t%s", impl->name);
   putchar ('\n');
@@ -329,6 +334,19 @@ test_main (void)
     }
 
   do_random_tests ();
+}
+
+int
+test_main (void)
+{
+  test_init ();
+
+  test_locale ("C");
+  test_locale ("en_US.ISO-8859-1");
+  test_locale ("en_US.UTF-8");
+  test_locale ("tr_TR.ISO-8859-9");
+  test_locale ("tr_TR.UTF-8");
+
   return ret;
 }