/* 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
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. */
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);
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");
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");
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. */