Design: 02.01.02.01/P02
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 2: Structure deletion with an open structure
CHARACTERISTICS: nnnn
OPERATOR SCRIPT: passive test
DESIGN:
Use <open structure> and <execute structure> to set up the CSS
as follows:
100
/ \
1 / \ 2
/ \
105 110
/ \
1/ \2
/ \
115 120
The nodes of the graph (100 and above) represent structures, and the
labelled edges are references to invoke (lower) structures. The
labels (1-2) represent the element position of the <execute structure>
function within the calling structure.
TEST: #SR 5
"Deleting an open root structure should cause the structure to
exist in the CSS as an open structure."
delstr = 100
<open structure> delstr
<delete structure> delstr
use <inquire open structure> to determine
stype = the structure status open or close
strid = structure id
if (stype <> open or
strid <> delstr) then
fail
else
pass
<close structure>
endif
TEST: #SR 5
"Deleting an open root structure should cause the structure to
exist in the CSS as an empty structure."
use <inquire structure status> on strid to determine
strsti = structure status identifier
pass/fail depending on (strsti = empty)
TEST: #SR 2
"Deleting an open root structure should cause the deletion of
all references made to that structure contained in other
structures."
examine the contents of the CSS for the existing structure identifiers
and the associated element references
pass/fail depending on (CSS contents =
100, 105, 110
| | / \
0| 0| 1/ \2
| | / \
115 120 )
TEST: #SR 5
"Deleting a non-root structure should cause the structure to
exist in the CSS as an open structure."
delstr = 115
<open structure> delstr
<delete structure> delstr
use <inquire open structure> to determine
stype = the structure status open or close
strid = structure id
if (stype <> open or
strid <> delstr) then
fail
else
pass
<close structure>
endif
TEST: #SR 5
"Deleting a non-root structure should cause the structure to
exist in the CSS as an empty structure."
use <inquire structure status> on strid to determine
strsti = structure status identifier
pass/fail depending on (strsti = empty)
TEST: #SR 2
"Deleting a non-root structure should cause the deletion of
all references made to that structure contained in other
structures."
examine the contents of the CSS for the existing structure identifiers
and the associated element references
pass/fail depending on (CSS contents =
100, 105, 115, 110
| | | |
0| 0| 0| 1|
| | | |
120 )
END PROGRAM 2