Design: 02.02.04/P05

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 5: Deleting structure elements in REPLACE edit mode

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

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

<open structure> for strid

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
<label> with labl9
<label> with labl10
<label> with labl2
<label> with labl1
<label> with labl2
<label> with labl4

<set edit mode> to REPLACE

elepos = 9
TEST: #SR 1
      "When the edit mode is REPLACE, <delete element> should
       delete the element pointed to by the element pointer."
<set element pointer> to elepos
<delete element>
pass/fail depending on
  (current structure content = labels: 1, 2, 4, 3, 4, 6, 5, 6, 7,
                                       8, 10, 9, 10, 2, 1, 2, 4)

TEST: #SR 7
      "When the edit mode is REPLACE, following <delete element>,
       the element pointer should be positioned at the element
       immediately preceding the deleted structure element."
pass/fail depending on (current element pointer position = 8)

elpos1 = 2
elpos2 = 6
TEST: #SR 3
      "When the edit mode is REPLACE, <delete element range>
       should delete all structure elements between and including
       the lower element position and the higher element position."
<delete element range> elpos1, elpos2
pass/fail depending on
  (current structure content = labels: 1, 5, 6, 7, 8, 10, 9, 10,
                                       2, 1, 2, 4)

TEST: #SR 7
      "When the edit mode is REPLACE, following <delete element
       range>, the element pointer should be positioned at the
       element immediately preceding the deleted group elements."
pass/fail depending on (current element pointer position = 1)

elepos = 0
TEST: #SR 5 6
      "When the edit mode is REPLACE, <delete elements between
       labels> should delete elements between but not including
       the occurences of two specified labels."
<set element pointer> to elepos
<delete elements between labels> with labl10, labl10
pass/fail depending on
  (current structure content = labels: 1, 5, 6, 7, 8, 10, 10, 2,
                                       1, 2, 4)

TEST: #SR 7
      "When the edit mode is REPLACE, following <delete elements
       between labels>, the element pointer should be positioned
       at the element immediately preceding the deleted group elements."
pass/fail depending on (current element pointer position = 6)

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

END PROGRAM 5