]> git.sur5r.net Git - cc65/blob - test/ref/charconst.c
remote TABs in doc/ and test/
[cc65] / test / ref / charconst.c
1 /*
2   !!DESCRIPTION!! check if character constants are translated correctly
3   !!ORIGIN!!      cc65 bug report
4   !!LICENCE!!     Public Domain
5 */
6
7 #include "common.h"
8 #include <limits.h>
9 #include <ctype.h>
10
11 void backslash(unsigned char c)
12 {
13     printf("%c : ",c);
14
15     switch (c)
16     {
17         case 'b':
18                 c = '\b';
19         case 'f':
20                 c = '\f';
21         case 'n':
22                 c = '\n';
23         case 'r':
24                 c = '\r';
25         case 't':
26                 c = '\t';
27         case 'v':
28     #ifndef NO_BACKSLASH_V
29         c = '\v';
30     #else
31         c = 0x0b;
32     #endif
33         }
34
35     if(!isprint(c))
36     {
37         printf("ok.\n");
38     }
39     else
40     {
41         printf("failed.\n");
42     }
43 }
44
45 void testbackslash(void)
46 {
47         backslash('b');
48         backslash('f');
49         backslash('n');
50         backslash('r');
51         backslash('t');
52         backslash('v');
53 }
54
55 int main(void)
56 {
57         testbackslash();
58
59         return 0;
60 }