Design: 02.02.04/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: Empty structure

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

Use <inquire structure status> throughout to determine
    ststin = structure status indicator

strid  = 90
stridc = 100
strido = 110
labl1  = 1
labl2  = 2
labl3  = 3
labl4  = 4
labl5  = 5
labl6  = 6
labl7  = 7
labl8  = 8
labl9  = 9
labl10 = 10

create structure network:

          90
         /  \
        /    \
      100   110

<open structure> with stridc
fill structure with elements:
<label> with labl1
<label> with labl2
<label> with labl4
<label> with labl3
<label> with labl4
<label> with labl6
<label> with labl5
<label> with labl6
<label> with labl8
<label> with labl7
<label> with labl8
<label> with labl10
<close structure>

<open structure> with strido
fill structure with elements:
<label> with labl1
<label> with labl2
<label> with labl4
<label> with labl3
<label> with labl4
<label> with labl6
<label> with labl5
<label> with labl6
<label> with labl8
<label> with labl7
<label> with labl8
<label> with labl10
<close structure>

<open structure> with strid
execute structure strido, stridc into strid:
<execute structure> with stridc
<execute structure> with strido
<close structure>

TEST: #SR 8 9
      "<Empty structure> should delete all the elements of a
       specified closed structure, but the structure itself
       should still exist."
<empty structure> with stridc
<inquire structure status> with stridc to set ststin
pass/fail depending on (ststin = EMPTY)

TEST: #SR 10
      "After using <empty structure> on a specified closed
       structure, references to the now empty closed structure
       should remain intact."
pass/fail depending on
  (current structure content of strid = execute structure: 100,
                                        execute structure: 110)

TEST: #SR 8 9
      "<Empty structure> should delete all the elements of a
       specified open structure, but the structure itself should
       still exist."
<open structure> with strido
<empty structure> with strido
<inquire structure status> with strido to set ststin
pass/fail depending on (ststin = EMPTY)

TEST: #SR 10
      "After using <empty structure> on a specified open
       structure, references to the now empty open structure
       should remain intact."
pass/fail depending on
  (current structure content of strid = execute structure: 100,
                                        execute structure: 110)

TEST: #SR 11
      "If <empty structure> is used on a specified open
       structure, the element pointer should be set to 0."
pass/fail depending on (current element position = 0)

END PROGRAM 4