Design: 02.03.01/P01
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 1: Inquire element type and size, and content when a
structure is closed
CHARACTERISTICS: nnnn
OPERATOR SCRIPT: passive test.
DESIGN:
Define polyline points
xpts = .02, .05, .08, .11, .14
ypts = .17, .20, .23, .26, .29
<open structure> strid
position contents
1 <set character up vector> .24, .35
2 <set text alignment> left, half
3 <polyline> 5, xpts, ypts
4 <set character spacing> .05
5 <text> .16, .2, 'PHIGS Validation Tests'
<close structure>
Throughout use:
<inquire element type and size> to determine:
eltype = element type
intsz = number of integer array entries
rlsz = number of real array entries
strsz = number of string array entries
<inquire element content> to determine:
intsz = number of integer array entries
intar = array containing integer entries
rlsz = number of real array entries
rlar = array containing real entries
strsz = number of string array entries
lnstr = length of character string entries
strar = character string entries
TEST: #SR 5
"<Inquire element type and size> should return NIL as the
element type and 0 as the length of all array entry sizes
when the specified element position of the closed structure
is 0."
<inquire element type and size> strid, 0
pass/fail depending on (eltype = NIL and
intsz = 0 and
rlsz = 0 and
strsz = 0)
TEST: #SR 6
"<Inquire element content> should return 0 as the length of
all arrays associated with the data record when the
specified element position of the closed structure is 0."
<inquire element content> strid, 0
pass/fail depending on (intsz = 0 and
rlsz = 0 and
strsz = 0)
TEST: #SR 4
"<Inquire element type and size> should return polyline as
the element type and an integer array entry size of 1, real
array entry size of 10, and a string array entry size of 0
for the specified element of the closed structure."
<inquire element type and size> strid, 3
pass/fail depending on (eltype = polyline and
intsz = 1 and
rlsz = 10 and
strsz = 0)
TEST: #SR 6
"<Inquire element content> should return the appropriate
information contained in the data record associated with
polyline, the specified element of the closed structure."
<inquire element content> strid, 3
pass/fail depending on (intsz = 1 and
intar(1) = 5 and
rlsz = 10 and
rlar = xpts, ypts and
strsz = 0)
END PROGRAM 1