[an error occurred while processing this directive]

Test Module User Specifications


Purpose

The Test module is a command-driven test program for testing the Table and TableIterator modules. The Test module is designed to be easily modified for testing other kinds of modules. Modification instructions are given in the Test Module Implementation Specifications.

User Model

The Test program can be used for interactive or batch testing of the Table module. To use the program interactively the user gives the following command to the operating system command interpreter:
    Test
Interactive mode is normally used for debugging and early testing of the module.

To use the program in batch mode the user gives the following command to the operating system command interpreter:

    Test filename
where filename is the name of a file that contains testing commands. Batch mode is normally used for final testing of the module. Batch testing input files should be retained for regression testing of the module.

Commands

In both modes, each line of text is recognized as a command. The program breaks up command lines into words, which are consecutive sequences of non-white characters, separated by sequences of white characters. The first word is interpreted as the name of the command. More words may be required to provide arguments to the command. The command name can be any prefix of a full command name as long as it is not a prefix of two or more command names.

Blank lines and lines that begin with a white character are treated as commands with an empty string for the command name. These lines are ignored by the program, allowing batch command files to be laid out with a more readable style.

The Test program recognizes two kinds of commands: control commands and module testing commands.

Control commands
The control commands are commands that can be used for testing any kind of module. They provide the capabilities of switching between batch and interactive mode, inputting commands from a batch file, adding conspicuous comments, controling echoing for batch commands, listing the available commands, and terminating the test program. These commands are listed below with links to detailed descriptions.

Module testing commands
The Test program is designed for testing a single Table, called theTable, and a single TableIterator, called theTableIterator. Thus the user does not need to specify which Table or TableIterator that they are using. There is one command for each of the functions in the Table and TableIterator client interfaces, except for the freeTable and freeTableIterator functions - these functions cannot be properly tested with this kind of test harness. One additional command is provided for displaying the contents of theTable.

The tables below list the Table and TableIterator testing commands and the client interface functions that they test. The entries in both columns of the tables are links to detailed documentation.

Table testing commands
Command Name Function Tested
add add
remove remove
iskey isKey
ntable newTable
clear clear
data dataFor
niterator newTableIterator
print
TableIterator testing commands
Command Name Function Tested
more more
advance advance
ckey currentData
cdata currentKey
Table and TableIterator module modifications
These modules have been modified for easier testing in two ways. First, the data type has been changed to type int. Second, a compilation switch has been added to the source code files. When compiled with the -DDEBUG compiler option, precondition violation handling is modified so that the program does not terminate and the error messages are sent to stdout instead of stderr. This option should be used for testing.

Commands

Standard commands
theTable creation
theTable data access
theTable modification
theTableIterator creation
theTableIterator Positioning
theTableIterator current entry access
[an error occurred while processing this directive]