diff options
author | kris <kris@FreeBSD.org> | 2000-03-25 07:45:29 +0000 |
---|---|---|
committer | kris <kris@FreeBSD.org> | 2000-03-25 07:45:29 +0000 |
commit | 533744c77137b94ed05e2ca445ba97d71c79ee5f (patch) | |
tree | fa102ad70fa8d5585900bf7e1872826b467f5d2e /contrib/gperf/tests/jstest1.gperf | |
parent | 6cfe3ae61b383acc12d75bc595be2ab185d5586c (diff) | |
download | FreeBSD-src-533744c77137b94ed05e2ca445ba97d71c79ee5f.zip FreeBSD-src-533744c77137b94ed05e2ca445ba97d71c79ee5f.tar.gz |
Virgin import of gperf v2.7
Diffstat (limited to 'contrib/gperf/tests/jstest1.gperf')
-rw-r--r-- | contrib/gperf/tests/jstest1.gperf | 142 |
1 files changed, 142 insertions, 0 deletions
diff --git a/contrib/gperf/tests/jstest1.gperf b/contrib/gperf/tests/jstest1.gperf new file mode 100644 index 0000000..f6696b1 --- /dev/null +++ b/contrib/gperf/tests/jstest1.gperf @@ -0,0 +1,142 @@ +abstract +boolean +break +byte +case +catch +char +class +const +continue +default +do +double +else +extends +false +final +finally +float +for +function +goto +if +implements +import +in +instanceof +int +interface +long +native +new +null +package +private +protected +public +return +short +static +super +switch +synchronized +this +throw +throws +transient +true +try +var +void +while +with +%% +#include <stdlib.h> +#include <string.h> +#if defined(__STDC__) || defined(__cplusplus) +#define CONST const +#else +#define CONST +#endif +static CONST char* testdata[] = { + "bogus", + "abstract", + "boolean", + "break", + "byte", + "case", + "catch", + "char", + "class", + "const", + "continue", + "default", + "do", + "double", + "else", + "extends", + "false", + "final", + "finally", + "float", + "for", + "function", + "goto", + "if", + "implements", + "import", + "in", + "instanceof", + "int", + "interface", + "long", + "native", + "new", + "null", + "package", + "private", + "protected", + "public", + "return", + "short", + "static", + "super", + "switch", + "synchronized", + "this", + "throw", + "throws", + "transient", + "true", + "try", + "var", + "void", + "while", + "with" +}; +int main () +{ + int i; + for (i = 0; i < sizeof(testdata)/sizeof(testdata[0]); i++) + { +#ifdef CPLUSPLUS_TEST + CONST char * resword = Perfect_Hash::in_word_set(testdata[i],strlen(testdata[i])); +#else + CONST char * resword = in_word_set(testdata[i],strlen(testdata[i])); +#endif + if (i > 0) + { + if (!resword) + exit (1); + if (strcmp(testdata[i],resword)) + exit (1); + } + else + { + if (resword) + exit (1); + } + } + return 0; +} |