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