OpenCores
URL https://opencores.org/ocsvn/openrisc_2011-10-31/openrisc_2011-10-31/trunk

Subversion Repositories openrisc_2011-10-31

[/] [openrisc/] [tags/] [gnu-src/] [newlib-1.18.0/] [newlib-1.18.0-or32-1.0rc1/] [newlib/] [testsuite/] [newlib.wctype/] [tiswctype.c] - Blame information for rev 345

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 207 jeremybenn
#include <wctype.h>
2
#include <newlib.h>
3
#include "check.h"
4
 
5
int main()
6
{
7
  wctype_t x;
8
 
9
  x = wctype ("alpha");
10
  CHECK (x != 0);
11
  CHECK (iswctype (L'a', x) && isalpha ('a'));
12
 
13
  x = wctype ("alnum");
14
  CHECK (x != 0);
15
  CHECK (iswctype (L'0', x) && isalnum ('0'));
16
 
17
  x = wctype ("blank");
18
  CHECK (x != 0);
19
  CHECK (iswctype (L' ', x) && isblank (' '));
20
 
21
  x = wctype ("cntrl");
22
  CHECK (x != 0);
23
  CHECK (iswctype (L'\n', x) && iscntrl ('\n'));
24
 
25
  x = wctype ("digit");
26
  CHECK (x != 0);
27
  CHECK (iswctype (L'7', x) && isdigit ('7'));
28
 
29
  x = wctype ("graph");
30
  CHECK (x != 0);
31
  CHECK (iswctype (L'!', x) && isgraph ('!'));
32
 
33
  x = wctype ("lower");
34
  CHECK (x != 0);
35
  CHECK (iswctype (L'k', x) && islower ('k'));
36
 
37
  x = wctype ("print");
38
  CHECK (x != 0);
39
  CHECK (iswctype (L'@', x) && isprint ('@'));
40
 
41
  x = wctype ("punct");
42
  CHECK (x != 0);
43
  CHECK (iswctype (L'.', x) && ispunct ('.'));
44
 
45
  x = wctype ("space");
46
  CHECK (x != 0);
47
  CHECK (iswctype (L'\t', x) && isspace ('\t'));
48
 
49
  x = wctype ("upper");
50
  CHECK (x != 0);
51
  CHECK (iswctype (L'T', x) && isupper ('T'));
52
 
53
  x = wctype ("xdigit");
54
  CHECK (x != 0);
55
  CHECK (iswctype (L'B', x) && isxdigit ('B'));
56
 
57
  x = wctype ("unknown");
58
  CHECK (x == 0);
59
 
60
  exit (0);
61
}

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.