Design: 02.03.02/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: Element search with varying types of structures
CHARACTERISTICS: nnnn
OPERATOR SCRIPT: passive test.
DESIGN:
stride = 10
strido = 20
stridc = 30
<polyline 3>, <polymarker 3> parameters:
n = 4
xval = 0.0001, 99.99, -1.3e20, 1.3e13
yval = -99.99, 0.0, .0015, 5.0
zval = .5e10, 1.2, -5.0, 0.0
<text 3> parameters:
xpos = 0.0001
ypos = -99.99
zpos = .5e10
xvec = 1.0, .3
yvec = 2.5, -1.6e13
zvec = 0.003, 999.0
chrstr = 'This is a TEXT_3 character string for <element search>.'
<set text font> parameters:
font = -2
<set character height> parameters:
charht = .5
<set individual asf> parameters:
attrid = POLYLINE
asfval = BUNDLED
<execute structure> parameters:
stridx = 30
<label> parameters:
labl1 = 1
<set pick identifier> parameters:
pkid = 5
create structure stride:
<open structure> for stride
<close structure>
create structure stridc:
<open structure> for stridc
fill structure with element types:
POSITION CONTENTS
-------- --------
1 <set pick identifier> with pkid
2 <label> with labl1
3 <execute structure> with stridx
4 <set individual asf> with attrid, asfval
5 <set character height> with charht
6 <set text font> with font
7 <text 3> with xpos, ypos, zpox, xvec, yvec, zvec,
chrstr
8 <polymarker 3> with n, xval, yval, zval
9 <polyline 3> with n, xval, yval, zval
<close structure>
create structure strido:
<open structure> for strido
fill structure with element types:
POSITION CONTENTS
-------- --------
1 <polyline 3> with n, xval, yval, zval
2 <polymarker 3> with n, xval, yval, zval
3 <text 3> with xpos, ypos, zpos, xvec, yvec, zvec,
chrstr
4 <set text font> with font
5 <set character height> with charht
6 <set individual asf> with attrid, asfval
7 <execute structure> with stridx
8 <label> with labl1
9 <set pick identifier> with pkid
selpos = 0
dir = FORWARD
elinc = POLYLINE_3, SET_CHARACTER_HEIGHT, LABEL
elexc = POLYMARKER_3
TEST: #SR 1 2 6 9
"When using <element search> with an empty structure and
searching for non-NIL elements, the search should be
unsuccessful and the status indicator should return the
value FAILURE."
<element search> with stride, selpos, dir, elinc, elexc
pass/fail depending on
(errind = 0 and
statid = FAILURE)
selpos = 93
dir = BACKWARD
elinc = ALL
elexc = POLYMARKER_3
TEST: #SR 1 2 3 4 5 7 8
"When using <element search> with an empty structure and
searching for a NIL element, the search should find the
element at position #0."
<element search> with stride, selpos, dir, elinc, elexc
pass/fail depending on
(errind = 0 and
statid = SUCCESS and
felpos = 0)
selpos = 0
dir = FORWARD
elinc = POLYMARKER_3, SET_TEXT_FONT, LABEL, SET_PICK_IDENTIFIER
elexc = POLYMARKER_3, SET_TEXT_FONT, EXECUTE_STRUCTURE
TEST: #SR 1 2 3 6 8
"When using <element search> with an open structure, an
element should qualify for selection if and only if its
type belongs to the inclusion set and does not belong to
the exclusion set."
<element search> with strido, selpos, dir, elinc, elexc
pass/fail depending on
(errind = 0 and
statid = SUCCESS and
felpos = 8)
selpos = 9
dir = BACKWARD
elinc = POLYLINE_3, TEXT_3, POLYMARKER_3
elexc = POLYLINE_3, POLYMARKER_3
TEST: #SR 1 2 3 6 8
"When using <element search> with a closed structure, an
element should qualify for selection if and only if its
type belongs to the inclusion set and does not belong to
the exclusion set."
<element search> with stridc, selpos, dir, elinc, elexc
pass/fail depending on
(errind = 0 and
statid = SUCCESS and
felpos = 7)
<close structure>
END PROGRAM 2