Design: 11.02/P04
This is an abstract, language-independent design. Grim
details may be found in the
corresponding source code.
You may return to the
documentation
for the module containing this program design, or to the
entire hierarchical table of
topics covered by the PVT.
PROGRAM 4: Check prototypes and typedefs in phigs.h
CHARACTERISTICS: nnnn
OPERATOR SCRIPT: See description of process in P02, above.
DESIGN:
open phigs.hpns for input
open std_phigs.hpns for input
futrec = file-under-test record = blank
next_refrec:
read refrec = reference record from std_phigs.hpns,
at EOF end program
if refrec is a function declaration then
TEST: #SR 1 12
"The phigs.h file should contain a correct declaration
for " + functionname + "."
else
TEST: #SR 1 11
"The phigs.h file should contain a correct declaration
for " + typename + "."
endif
rec_compare:
if (futrec-name < refrec-name) then
read futrec from phigs.hpns
at EOF goto no_more_fut
goto rec_compare
elseif (futrec-name > refrec-name) then
fail
informational message: no declaration found for refrec-name
goto next_refrec
endif
got name match between futrec and refrec
adjust comparison length for "typedef enum" or for partially
implementation dependent types
pass/fail depending on (futrec = refrec) for required length
goto next_refrec
no_more_fut:
fail
informational message: No more declarations in phigs.h
END PROGRAM 4