Merge from vendor branch LESS:
[dragonfly.git] / contrib / gperf / tests / jstest1.gperf
1 abstract
2 boolean
3 break
4 byte
5 case
6 catch
7 char
8 class
9 const
10 continue
11 default
12 do
13 double
14 else
15 extends
16 false
17 final
18 finally
19 float
20 for
21 function
22 goto
23 if
24 implements
25 import
26 in
27 instanceof
28 int
29 interface
30 long
31 native
32 new
33 null
34 package
35 private
36 protected
37 public
38 return
39 short
40 static
41 super
42 switch
43 synchronized
44 this
45 throw
46 throws
47 transient
48 true
49 try
50 var
51 void
52 while
53 with
54 %%
55 #include <stdlib.h>
56 #include <string.h>
57 #if defined(__STDC__) || defined(__cplusplus)
58 #define CONST const
59 #else
60 #define CONST
61 #endif
62 static CONST char* testdata[] = {
63   "bogus",
64   "abstract",
65   "boolean",
66   "break",
67   "byte",
68   "case",
69   "catch",
70   "char",
71   "class",
72   "const",
73   "continue",
74   "default",
75   "do",
76   "double",
77   "else",
78   "extends",
79   "false",
80   "final",
81   "finally",
82   "float",
83   "for",
84   "function",
85   "goto",
86   "if",
87   "implements",
88   "import",
89   "in",
90   "instanceof",
91   "int",
92   "interface",
93   "long",
94   "native",
95   "new",
96   "null",
97   "package",
98   "private",
99   "protected",
100   "public",
101   "return",
102   "short",
103   "static",
104   "super",
105   "switch",
106   "synchronized",
107   "this",
108   "throw",
109   "throws",
110   "transient",
111   "true",
112   "try",
113   "var",
114   "void",
115   "while",
116   "with"
117 };
118 int main ()
119 {
120   int i;
121   for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++)
122     {
123 #ifdef CPLUSPLUS_TEST
124       CONST char * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i]));
125 #else
126       CONST char * resword = in_word_set(testdata[i],strlen(testdata[i]));
127 #endif
128       if (i > 0)
129         {
130           if (!resword)
131             exit (1);
132           if (strcmp(testdata[i],resword))
133             exit (1);
134         }
135       else
136         {
137           if (resword)
138             exit (1);
139         }
140     }
141   return 0;
142 }