New module attribute 'Applicability'.
[gnulib.git] / tests / test-localename.c
index a417ace..e278e19 100644 (file)
@@ -1,5 +1,5 @@
 /* Test of gl_locale_name function.
-   Copyright (C) 2007 Free Software Foundation, Inc.
+   Copyright (C) 2007, 2008 Free Software Foundation, Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
 #include <stdlib.h>
 #include <string.h>
 
-#include "setenv.h"
-
 #define ASSERT(expr) \
-  do                                                                        \
-    {                                                                       \
-      if (!(expr))                                                          \
-        {                                                                   \
+  do                                                                         \
+    {                                                                        \
+      if (!(expr))                                                           \
+        {                                                                    \
           fprintf (stderr, "%s:%d: assertion failed\n", __FILE__, __LINE__); \
-          abort ();                                                         \
-        }                                                                   \
-    }                                                                       \
+          fflush (stderr);                                                   \
+          abort ();                                                          \
+        }                                                                    \
+    }                                                                        \
   while (0)
 
 int
@@ -53,9 +52,9 @@ main ()
   unsetenv ("LANG");
   setlocale (LC_ALL, "");
   ASSERT (strcmp (gl_locale_name (LC_MESSAGES, "LC_MESSAGES"),
-                 gl_locale_name_default ()) == 0);
+                  gl_locale_name_default ()) == 0);
   ASSERT (strcmp (gl_locale_name (LC_NUMERIC, "LC_NUMERIC"),
-                 gl_locale_name_default ()) == 0);
+                  gl_locale_name_default ()) == 0);
 
   /* Check that an empty environment variable is treated like an unset
      environment variable.  */
@@ -66,7 +65,7 @@ main ()
   unsetenv ("LANG");
   setlocale (LC_ALL, "");
   ASSERT (strcmp (gl_locale_name (LC_MESSAGES, "LC_MESSAGES"),
-                 gl_locale_name_default ()) == 0);
+                  gl_locale_name_default ()) == 0);
 
   unsetenv ("LC_ALL");
   setenv ("LC_CTYPE", "", 1);
@@ -74,7 +73,7 @@ main ()
   unsetenv ("LANG");
   setlocale (LC_ALL, "");
   ASSERT (strcmp (gl_locale_name (LC_MESSAGES, "LC_MESSAGES"),
-                 gl_locale_name_default ()) == 0);
+                  gl_locale_name_default ()) == 0);
 
   unsetenv ("LC_ALL");
   unsetenv ("LC_CTYPE");
@@ -82,7 +81,7 @@ main ()
   unsetenv ("LANG");
   setlocale (LC_ALL, "");
   ASSERT (strcmp (gl_locale_name (LC_MESSAGES, "LC_MESSAGES"),
-                 gl_locale_name_default ()) == 0);
+                  gl_locale_name_default ()) == 0);
 
   unsetenv ("LC_ALL");
   unsetenv ("LC_CTYPE");
@@ -90,7 +89,7 @@ main ()
   setenv ("LANG", "", 1);
   setlocale (LC_ALL, "");
   ASSERT (strcmp (gl_locale_name (LC_MESSAGES, "LC_MESSAGES"),
-                 gl_locale_name_default ()) == 0);
+                  gl_locale_name_default ()) == 0);
 
   /* Check that LC_ALL overrides the others, and LANG is overridden by the
      others.  */