]>
Commit | Line | Data |
---|---|---|
89f29a07 UD |
1 | #include <ctype.h> |
2 | #include <locale.h> | |
3 | #include <stdio.h> | |
4 | #include <stdlib.h> | |
5 | ||
6 | ||
af85385f | 7 | static int do_test (locale_t l); |
89f29a07 UD |
8 | |
9 | int | |
10 | main (void) | |
11 | { | |
f6056d40 RM |
12 | locale_t l; |
13 | locale_t l2; | |
89f29a07 UD |
14 | int result; |
15 | ||
f6056d40 | 16 | l = newlocale (1 << LC_ALL, "de_DE.ISO-8859-1", NULL); |
89f29a07 UD |
17 | if (l == NULL) |
18 | { | |
f6056d40 | 19 | printf ("newlocale failed: %m\n"); |
89f29a07 UD |
20 | exit (EXIT_FAILURE); |
21 | } | |
22 | puts ("Running tests of created locale"); | |
23 | result = do_test (l); | |
24 | ||
f6056d40 | 25 | l2 = duplocale (l); |
89f29a07 UD |
26 | if (l2 == NULL) |
27 | { | |
f6056d40 | 28 | printf ("duplocale failed: %m\n"); |
89f29a07 UD |
29 | exit (EXIT_FAILURE); |
30 | } | |
f6056d40 | 31 | freelocale (l); |
89f29a07 UD |
32 | puts ("Running tests of duplicated locale"); |
33 | result |= do_test (l2); | |
34 | ||
35 | return result; | |
36 | } | |
37 | ||
38 | ||
39 | Content-type: text/html ]>