1 /* Copyright (c) 2002 Jeff Johnston <jjohnstn@redhat.com> */
2 #include <wctype.h>
3 #include <newlib.h>
4 #include "check.h"
5
main(void)6 int main(void)
7 {
8 wctype_t x;
9
10 x = wctype ("alpha");
11 CHECK (x != 0);
12 CHECK (iswctype (L'a', x) && iswalpha (L'a'));
13
14 x = wctype ("alnum");
15 CHECK (x != 0);
16 CHECK (iswctype (L'0', x) && iswalnum (L'0'));
17
18 x = wctype ("blank");
19 CHECK (x != 0);
20 CHECK (iswctype (L' ', x) && iswblank (L' '));
21
22 x = wctype ("cntrl");
23 CHECK (x != 0);
24 CHECK (iswctype (L'\n', x) && iswcntrl (L'\n'));
25
26 x = wctype ("digit");
27 CHECK (x != 0);
28 CHECK (iswctype (L'7', x) && iswdigit (L'7'));
29
30 x = wctype ("graph");
31 CHECK (x != 0);
32 CHECK (iswctype (L'!', x) && iswgraph (L'!'));
33
34 x = wctype ("lower");
35 CHECK (x != 0);
36 CHECK (iswctype (L'k', x) && iswlower (L'k'));
37
38 x = wctype ("print");
39 CHECK (x != 0);
40 CHECK (iswctype (L'@', x) && iswprint (L'@'));
41
42 x = wctype ("punct");
43 CHECK (x != 0);
44 CHECK (iswctype (L'.', x) && iswpunct (L'.'));
45
46 x = wctype ("space");
47 CHECK (x != 0);
48 CHECK (iswctype (L'\t', x) && iswspace (L'\t'));
49
50 x = wctype ("upper");
51 CHECK (x != 0);
52 CHECK (iswctype (L'T', x) && iswupper (L'T'));
53
54 x = wctype ("xdigit");
55 CHECK (x != 0);
56 CHECK (iswctype (L'B', x) && iswxdigit (L'B'));
57
58 x = wctype ("unknown");
59 CHECK (x == 0);
60
61 exit (0);
62 }
63