7 static int do_test (__locale_t l
);
16 l
= __newlocale (1 << LC_ALL
, "de_DE.ISO-8859-1", NULL
);
19 printf ("__newlocale failed: %m\n");
22 puts ("Running tests of created locale");
28 printf ("__duplocale failed: %m\n");
32 puts ("Running tests of duplicated locale");
33 result
|= do_test (l2
);
39 static const char str
[] = "0123456789abcdef ABCDEF ghijklmnopqrstuvwxyzäÄöÖüÜ";
40 static const char exd
[] = "11111111110000000000000000000000000000000000000000";
41 static const char exa
[] = "00000000001111110111111011111111111111111111111111";
42 static const char exx
[] = "11111111111111110111111000000000000000000000000000";
46 do_test (__locale_t l
)
51 #define DO_TEST(TEST, RES) \
52 for (n = 0; n < sizeof (str) - 1; ++n) \
53 if ('0' + (TEST (str[n], l) != 0) != RES[n]) \
55 printf ("%s(%c) failed\n", #TEST, str[n]); \
59 DO_TEST (__isdigit_l
, exd
);
60 DO_TEST (__isalpha_l
, exa
);
61 DO_TEST (__isxdigit_l
, exx
);