]> Savannah Git Hosting - gnulib.git/commitdiff
localename-tests: port to NetBSD 7
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 Jan 2017 22:14:43 +0000 (14:14 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 6 Jan 2017 22:14:57 +0000 (14:14 -0800)
Problem reported by Nelson H. F. Beebe.
* tests/test-localename.c:
Test newlocale and uselocale only if both exist.

ChangeLog
tests/test-localename.c

index 73db88a71a85b7e0936b89035fc23dfdfaca282a..25db030a81498f24f56bfd027164402abbb3136c 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2017-01-06  Paul Eggert  <eggert@cs.ucla.edu>
 
+       localename-tests: port to NetBSD 7
+       Problem reported by Nelson H. F. Beebe.
+       * tests/test-localename.c:
+       Test newlocale and uselocale only if both exist.
+
        glob, intprops, xalloc: work around Clang bug
        Work around LLVM bug 16404, which is still not fixed.
        https://llvm.org/bugs/show_bug.cgi?id=16404
index f38d30d100aa61efa0867278a1c172c9d9e53280..994192ce21c4ede9dd360d6029d6e01c55c88c21 100644 (file)
@@ -27,7 +27,7 @@
 #include "macros.h"
 
 
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
 
 static struct { int cat; int mask; const char *string; } const categories[] =
   {
@@ -70,7 +70,7 @@ test_locale_name (void)
 
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   uselocale (LC_GLOBAL_LOCALE);
 #endif
 
@@ -172,7 +172,7 @@ test_locale_name (void)
       ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
     }
 
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   /* Check that gl_locale_name considers the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
@@ -232,7 +232,7 @@ test_locale_name_thread (void)
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
 
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   /* Check that gl_locale_name_thread returns NULL when no thread locale is
      set.  */
   uselocale (LC_GLOBAL_LOCALE);
@@ -487,7 +487,7 @@ test_locale_name_posix (void)
 
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   uselocale (LC_GLOBAL_LOCALE);
 #endif
 
@@ -592,7 +592,7 @@ test_locale_name_posix (void)
       ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
     }
 
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   /* Check that gl_locale_name_posix ignores the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
@@ -621,7 +621,7 @@ test_locale_name_environ (void)
 
   /* Get into a defined state,  */
   setlocale (LC_ALL, "en_US.UTF-8");
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   uselocale (LC_GLOBAL_LOCALE);
 #endif
 
@@ -706,7 +706,7 @@ test_locale_name_environ (void)
   name = gl_locale_name_environ (LC_MESSAGES, "LC_MESSAGES");
   ASSERT (strcmp (name, "fr_FR.UTF-8") == 0);
 
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   /* Check that gl_locale_name_environ ignores the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);
@@ -741,7 +741,7 @@ test_locale_name_default (void)
   ASSERT (strcmp (name, "C") == 0);
 #endif
 
-#if HAVE_NEWLOCALE
+#if HAVE_NEWLOCALE && HAVE_USELOCALE
   /* Check that gl_locale_name_default ignores the thread locale.  */
   {
     locale_t locale = newlocale (LC_ALL_MASK, "fr_FR.UTF-8", NULL);