Design: 02.01.03.03/P03

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 3: Effects of <change structure identifier and references>
           on the element pointer

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

The following is the "standard" CSS network for module 02.01.03.
This CSS network will be used throughout to test the resulting
state of the CSS after execution of the <change structure
identifier and references> function.  Before each test case the CSS
state is completely reset.


                  100
                  /  \
                 /    \
               1/      \2
               /        \
              /          \
          101              102     120   130      140
           |              / | \     |    /|        |
           |2            /  |  \    |   / |       1|
           |           1/  2|  5\  2|  /3 |5       |
           |           /    |    \  | /   |        |
          103         /     |     \ |/    |       142
                   104     105     106   107
                   | |       |     |    / /\
                  2| |5     /|\    |   / /  \
                   | |    1/ | \2 1| 1/ /4   \5
                   109    /  |  \  | / /      \
                         /   |   \ |/ /       113
                       110   |    108
                             |     |
                             |     |2
                             |3    |
                             |     |
                             |    111
                             |   / |
                             | 1/  |
                             | /  3|
                             |/    |
                            114   115

Structure 111 in the CSS is set up as follows:

                                111
                                 |
       -----------------------------------------------------------
      |         | |         |      |      |     \  |  /         | |
      |1       2| |10       |3     |4     |5    6\ |8/11       7| |9
      |         | |         |      |      |       \|/           | |
     114        940        115    942    916      947           955

The nodes on the graph numbered 114 and 115 represent the
structure elements associated with <execute structure>.  The nodes
between (900 and 999) represent the structure elements associated
with <label> .  The arcs (1-11) represent the position of the
<execute structure> or <label> element within the structure.


TEST: #SR 4
      "If the original and resulting identifier are the same and the
       common structure is open and empty after execution of <change
       structure identifier and references> then the element pointer
       should be at zero."

comstr = 142
<open structure> comstr
<change structure identifier and references> comstr, comstr
pass/fail depending on (element pointer = 0)
<close structure>

TEST: #SR 4
      "If the original and resulting identifier are the same and the
       common structure is open and not empty after execution of
       <change structure identifier and references> then the element
       pointer should remain at its current position."

set edit mode to REPLACE
comstr = 111
<open structure> comstr
set element pointer to 4
<change structure identifier and references> comstr, comstr
pass/fail depending on (element pointer = 4)
<close structure>

TEST: #SR 5
      "If the original and resulting identifiers differ and the original
       structure is open after execution of <change structure identifier
       and references> then the open structure should be empty and the
       element pointer set to zero."

orgid = 111
resid = 130
set edit mode to INSERT
<open structure> orgid
set element pointer to 3
<change structure identifier and references> orgid, resid
pass/fail depending on (element pointer = 0)
<close structure>

TEST: #SR 6
      "If the original and resulting identifiers differ, the original
       structure does not exist and the resulting structure is open after
       execution of <change structure identifier and references> then
       the element pointer of the open structure should be set to zero."

orgid = 300
resid = 111
<open structure> resid
<change structure identifier and references> orgid, resid
pass/fail depending on (element pointer = 0)
<close structure>

TEST: #SR 6
      "If the original and resulting identifiers differ, the original
       structure does exist and is empty, and the resulting structure
       is open after execution of <change structure identifier and
       references> then the element pointer of the open structure
       should be set to zero."

orgid = 142
resid = 111
<open structure> resid
set element pointer to 2
<change structure identifier and references> orgid, resid
pass/fail depending on (element pointer = 0)
<close structure>

TEST: #SR 6
      "If the original and resulting identifiers differ, the original
       structure does exist and is not empty, and the resulting structure
       is open after execution of <change structure identifier and
       references> then the element pointer of the open structure
       should be set to the last element."

orgid = 111
resid = 104
<open structure> resid
set element pointer to 3
<change structure identifier and references> orgid, resid
pass/fail depending on (element pointer = 11)
<close structure>

END PROGRAM 3