glibc/localedata/tst-setlocale.c
2000-12-01 00:15:38 +00:00

26 lines
578 B
C

/* Test case by Jakub Jelinek <jakub@redhat.com>. */
#include <locale.h>
#include <stdio.h>
#include <string.h>
int
main (void)
{
char q[30];
char *s;
setlocale (LC_ALL, "");
printf ("after setlocale (LC_ALL, \"\"): %s\n", setlocale(LC_NUMERIC, NULL));
strcpy (q, "de_DE.UTF-8");
setlocale (LC_NUMERIC, q);
printf ("after setlocale (LC_NUMERIC, \"%s\"): %s\n",
q, setlocale(LC_NUMERIC, NULL));
strcpy (q, "de_DE.ISO-8859-1");
s = setlocale (LC_NUMERIC, NULL);
printf ("after overwriting string: %s\n", s);
return strcmp (s, "de_DE.UTF-8") != 0;
}