1abstract 2boolean 3break 4byte 5case 6catch 7char 8class 9const 10continue 11default 12do 13double 14else 15extends 16false 17final 18finally 19float 20for 21function 22goto 23if 24implements 25import 26in 27instanceof 28int 29interface 30long 31native 32new 33null 34package 35private 36protected 37public 38return 39short 40static 41super 42switch 43synchronized 44this 45throw 46throws 47transient 48true 49try 50var 51void 52while 53with 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 62static 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}; 118int 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} 143