]> Savannah Git Hosting - gnulib.git/commitdiff
Fix a test crash.
authorBruno Haible <bruno@clisp.org>
Sun, 16 Oct 2016 18:09:16 +0000 (20:09 +0200)
committerBruno Haible <bruno@clisp.org>
Sun, 16 Oct 2016 18:12:51 +0000 (20:12 +0200)
* tests/test-duplocale.c (main): Skip the test if the 'newlocale' call
fails.

ChangeLog
tests/test-duplocale.c

index c272e81aa62abe96abf79b2df8bab8c6ab1e94c2..4fcfdaf308419af956e2e1c860a24debf635e852 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2016-10-16  Bruno Haible  <bruno@clisp.org>
+
+       Fix a test crash.
+       * tests/test-duplocale.c (main): Skip the test if the 'newlocale' call
+       fails.
+
 2016-10-16  Pádraig Brady  <P@draigBrady.com>
 
        test-limits-h: suppress -Woverlength-strings
index 498e31d65e5125494e7e6555e040213c76074a47..667b3e2d1dd4deff791a6e34bd2312d2ee1eafe5 100644 (file)
@@ -72,6 +72,11 @@ main ()
 
   /* Use a per-thread locale.  */
   perthread = newlocale (LC_ALL_MASK, "es_ES.UTF-8", NULL);
+  if (perthread == NULL)
+    {
+      fprintf (stderr, "Skipping test: Spanish Unicode locale is not installed\n");
+      return 77;
+    }
   uselocale (perthread);
 
   /* Save the locale in a locale_t object again.  */