summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorOssama Othman <ossama-othman@users.noreply.github.com>1999-04-24 23:22:13 +0000
committerOssama Othman <ossama-othman@users.noreply.github.com>1999-04-24 23:22:13 +0000
commite4e33898d9bc410f268e4c0da0dc7ca47bb2ed9f (patch)
tree7ee9db2497cc9aa4183e7dad493971b03670960c
parent7d6b0603202c12e3a263be5471053872023f8c0e (diff)
downloadATCD-e4e33898d9bc410f268e4c0da0dc7ca47bb2ed9f.tar.gz
* tests/test.cpp:
Minor spelling correction in comment * tests/test-6.exp: Updated with new expected gperf output.
-rw-r--r--apps/gperf/tests/test-6.exp170
-rw-r--r--apps/gperf/tests/test.cpp4
2 files changed, 90 insertions, 84 deletions
diff --git a/apps/gperf/tests/test-6.exp b/apps/gperf/tests/test-6.exp
index d571a77cf7c..2205ab7f481 100644
--- a/apps/gperf/tests/test-6.exp
+++ b/apps/gperf/tests/test-6.exp
@@ -1,84 +1,90 @@
--a Generate ANSI standard C output code, i.e., function prototypes.
--b Generate code for Linear Search.
--B Generate code for Binary Search.
--c Generate comparison code using strncmp rather than strcmp.
--C Make the contents of generated lookup tables constant, i.e., readonly.
--d Enables the debugging option (produces verbose output to the standard error).
--D Handle keywords that hash to duplicate values. This is useful
- for certain highly redundant keyword sets.
--e Allow user to provide a string containing delimiters used to separate
- keywords from their attributes. Default is ",\n"
--E Define constant values using an enum local to the lookup function
- rather than with defines
--f Generate the gen-perf.hash function ``fast.'' This decreases GPERF's
- running time at the cost of minimizing generated table-size.
- The numeric argument represents the number of times to iterate when
- resolving a collision. `0' means ``iterate by the number of keywords.''
--g Make generated routines use ``inline'' to remove function overhead.
--G Generate the static table of keywords as a static global variable,
- rather than hiding it inside of the lookup function (which is the
- default behavior).
--h Prints this mesage.
--H Allow user to specify name of generated hash function. Default
- is `hash'.
--i Provide an initial value for the associate values array. Default is 0.
--I Generate comparison code using case insensitive string comparison, e.g.,
- strncasecmp or strcasecmp.
- Setting this value larger helps inflate the size of the final table.
--j Affects the ``jump value,'' i.e., how far to advance the associated
- character value upon collisions. Must be an odd number, default is 5.
--J Skips '#include <string.h>' part in the output.
--k Allows selection of the key positions used in the hash function.
- The allowable choices range between 1-126, inclusive. The positions
- are separated by commas, ranges may be used, and key positions may
- occur in any order. Also, the meta-character '*' causes the generated
- hash function to consider ALL key positions, and $ indicates the
- ``final character'' of a key, e.g., $,1,2,4,6-10.
--K Allow use to select name of the keyword component in the keyword structure.
--l Compare key lengths before trying a string comparison. This helps
- cut down on the number of string comparisons made during the lookup.
--L Generates code in the language specified by the option's argument. Languages
- handled are currently C++ and C. The default is C.
--m Avoids the warning about identical hash values. This is valid
- only if the -D option is enabled.
--M Skips class definition in the output. This is valid only in C++ mode.
--n Do not include the length of the keyword when computing the hash function
--N Allow user to specify name of generated lookup function. Default
- name is `in_word_set.'
--o Reorders input keys by frequency of occurrence of the key sets.
- This should decrease the search time dramatically.
--O Optimize the generated lookup function by assuming that all input keywords
- are members of the keyset from the keyfile.
--p Changes the return value of the generated function ``in_word_set''
- from its default boolean value (i.e., 0 or 1), to type ``pointer
- to wordlist array'' This is most useful when the -t option, allowing
- user-defined structs, is used.
--r Utilizes randomness to initialize the associated values table.
--s Affects the size of the generated hash table. The numeric argument
- for this option indicates ``how many times larger or smaller'' the associated
- value range should be, in relationship to the number of keys, e.g. a value of 3
- means ``allow the maximum associated value to be about 3 times larger than the
- number of input keys.'' Conversely, a value of -3 means ``make the maximum
- associated value about 3 times smaller than the number of input keys.
- A larger table should decrease the time required for an unsuccessful search,
- at the expense of extra table space. Default value is 1.
--S Causes the generated C code to use a switch statement scheme, rather
- than an array lookup table. This can lead to a reduction in both
- time and space requirements for some keyfiles. The argument to
- this option determines how many switch statements are generated.
- A value of 1 generates 1 switch containing all the elements, a value of 2
- generates 2 tables with 1/2 the elements in each table, etc. This
- is useful since many C compilers cannot correctly generate code for
- large switch statements.
--t Allows the user to include a structured type declaration for
- generated code. Any text before %% is consider part of the type
- declaration. Key words and additional fields may follow this, one
- group of fields per line.
--T Prevents the transfer of the type declaration to the output file.
- Use this option if the type is already defined elsewhere.
--v Prints out the current version number and exits with a value of 0
--V Exits silently with a value of 0.
--Z Allow user to specify name of generated C++ class. Default
- name is `Perfect_Hash.'
+-a Generate ANSI standard C output code, i.e., function prototypes.
+-b Generate code for Linear Search.
+-B Generate code for Binary Search.
+-c Generate comparison code using strncmp rather than strcmp.
+-C Make the contents of generated lookup tables constant, i.e., readonly.
+-d Enables the debugging option (produces verbose output to the standard
+ error).
+-D Handle keywords that hash to duplicate values. This is useful
+ for certain highly redundant keyword sets.
+-e Allow user to provide a string containing delimiters used to separate
+ keywords from their attributes. Default is ",\n"
+-E Define constant values using an enum local to the lookup function
+ rather than with defines
+-f Generate the gen-perf.hash function ``fast.'' This decreases GPERF's
+ running time at the cost of minimizing generated table-size.
+ The numeric argument represents the number of times to iterate when
+ resolving a collision. `0' means ``iterate by the number of keywords.''
+-F Provided expression will be used to assign default values in keyword
+ table, i.e., the fill value. Default is "".
+-g Make generated routines use ``inline'' to remove function overhead.
+-G Generate the static table of keywords as a static global variable,
+ rather than hiding it inside of the lookup function (which is the
+ default behavior).
+-h Prints this message.
+-H Allow user to specify name of generated hash function. Default
+ is `hash'.
+-i Provide an initial value for the associate values array. Default is 0.
+-I Generate comparison code using case insensitive string comparison, e.g.,
+ strncasecmp or strcasecmp.
+ Setting this value larger helps inflate the size of the final table.
+-j Affects the ``jump value,'' i.e., how far to advance the associated
+ character value upon collisions. Must be an odd number, default is 5.
+-J Skips '#include <string.h>' part in the output.
+-k Allows selection of the key positions used in the hash function.
+ The allowable choices range between 1-126, inclusive. The positions
+ are separated by commas, ranges may be used, and key positions may
+ occur in any order. Also, the meta-character '*' causes the generated
+ hash function to consider ALL key positions, and $ indicates the
+ ``final character'' of a key, e.g., $,1,2,4,6-10.
+-K Allow use to select name of the keyword component in the keyword
+ structure.
+-l Compare key lengths before trying a string comparison. This helps
+ cut down on the number of string comparisons made during the lookup.
+-L Generates code in the language specified by the option's argument.
+ Languages handled are currently C++ and C. The default is C.
+-m Avoids the warning about identical hash values. This is valid
+ only if the -D option is enabled.
+-M Skips class definition in the output. This is valid only in C++ mode.
+-n Do not include the length of the keyword when computing the hash
+ function.
+-N Allow user to specify name of generated lookup function. Default
+ name is `in_word_set.'
+-o Reorders input keys by frequency of occurrence of the key sets.
+ This should decrease the search time dramatically.
+-O Optimize the generated lookup function by assuming that all input
+ keywords are members of the keyset from the keyfile.
+-p Changes the return value of the generated function ``in_word_set''
+ from its default boolean value (i.e., 0 or 1), to type ``pointer
+ to wordlist array'' This is most useful when the -t option, allowing
+ user-defined structs, is used.
+-r Utilizes randomness to initialize the associated values table.
+-s Affects the size of the generated hash table. The numeric argument
+ for this option indicates ``how many times larger or smaller'' the
+ associated value range should be, in relationship to the number of
+ keys, e.g. a value of 3 means ``allow the maximum associated value
+ to be about 3 times larger than the number of input keys.''
+ Conversely, a value of -3 means ``make the maximum associated
+ value about 3 times smaller than the number of input keys. A
+ larger table should decrease the time required for an unsuccessful
+ search, at the expense of extra table space. Default value is 1.
+-S Causes the generated C code to use a switch statement scheme, rather
+ than an array lookup table. This can lead to a reduction in both
+ time and space requirements for some keyfiles. The argument to
+ this option determines how many switch statements are generated.
+ A value of 1 generates 1 switch containing all the elements, a value
+ of 2 generates 2 tables with 1/2 the elements in each table, etc.
+ This is useful since many C compilers cannot correctly generate code
+ for large switch statements.
+-t Allows the user to include a structured type declaration for
+ generated code. Any text before %% is consider part of the type
+ declaration. Key words and additional fields may follow this, one
+ group of fields per line.
+-T Prevents the transfer of the type declaration to the output file.
+ Use this option if the type is already defined elsewhere.
+-v Prints out the current version number and exits with a value of 0
+-V Exits silently with a value of 0.
+-Z Allow user to specify name of generated C++ class. Default
+ name is `Perfect_Hash.'
Usage: ../src/gperf [-abBcCdDef[num]gGhH<hashname>i<init>IjJk<keys>K<keyname>lL<language>mMnN<function name>oOprs<size>S<switches>tTvVZ<class name>].
(type ../src/gperf -h for help)
diff --git a/apps/gperf/tests/test.cpp b/apps/gperf/tests/test.cpp
index c43287836ab..de57616492c 100644
--- a/apps/gperf/tests/test.cpp
+++ b/apps/gperf/tests/test.cpp
@@ -1,6 +1,6 @@
-// $Id: test.cpp 1.1 10/18/96
+// $Id$
-// Tests the generated perfect has function.
+// Tests the generated perfect hash function.
// The -v option prints diagnostics as to whether a word is in the set
// or not. Without -v the program is useful for timing.