Design: 02.03.01/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: Inquire element type and size, and content when a
structure is open
CHARACTERISTICS: nnnn
OPERATOR SCRIPT: passive test.
DESIGN:
<open structure> strid
position contents
1 <set character up vector> .24, .35
2 <set text alignment> left, half
3 <set character height> .4
4 <set character spacing> .05
5 <text> .16, .2, 'PHIGS Validation Tests'
Throughout use:
<inquire [current] 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 [current] 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
*** *** *** *** specified element = text *** *** *** ***
TEST: #SR 1
"<Inquire current element type and size> should return
text as the element type and an integer array entry size
of 0, real array entry size of 2, and a string array entry
size of 1 when the element pointer is positioned at the
last element."
<inquire current element type and size>
pass/fail depending on (eltype = text and
intsz = 0 and
rlsz = 2 and
strsz = 1)
TEST: #SR 3
"<Inquire current element content> should return the
appropriate information contained in the data record
associated with text when the element pointer is
positioned at the last element."
<inquire current element content>
pass/fail depending on (intsz = 0 and
rlsz = 2 and
rlar(1) = .16 and
rlar(2) = .2 and
strsz = 1 and
lnstr(1) = 22 and
strar(1) = 'PHIGS Validation Tests')
Make sure <inquire element type and size> is independent of
element pointer:
<set element pointer> 3
TEST: #SR 4
"<Inquire element type and size> should return text as the
element type and an integer array entry size of 0, real
array entry size of 2, and a string array entry size of 1
with text as the specified element of the open structure."
<inquire element type and size> strid, 5
pass/fail depending on (eltype = text and
intsz = 0 and
rlsz = 2 and
strsz = 1)
TEST: #SR 6
"<Inquire element content> should return the appropriate
information contained in the data record associated
with text as the specified element of the open structure."
<inquire element content> strid, 5
pass/fail depending on (intsz = 0 and
rlsz = 2 and
rlar(1) = .16 and
rlar(2) = .2 and
strsz = 1 and
lnstr(1) = 22 and
strar(1) = 'PHIGS Validation Tests')
*** *** *** *** specified element = character height *** *** *** ***
TEST: #SR 1
"<Inquire current element type and size> should return
character height as the element type and an integer array
entry size of 0, real array entry size of 1, and a string
array entry size of 0 when the element pointer indicates a
character height element."
<inquire current element type and size>
pass/fail depending on (eltype = character height and
intsz = 0 and
rlsz = 1 and
strsz = 0)
TEST: #SR 3
"<Inquire current element content> should return the
appropriate information contained in the data record
associated with character height when indicated by
the element pointer."
<inquire current element content>
pass/fail depending on (intsz = 0 and
rlsz = 1 and
rlar(1) = .4 and
strsz = 0)
Make sure <inquire element type and size> is independent of
element pointer:
<set element pointer> 0
TEST: #SR 4
"<Inquire element type and size> should return character height
as the element type and an integer array entry size of 0, real
array entry size of 1, and a string array entry size of 0 with
character height as the specified element of the open structure."
<inquire element type and size> strid, 3
pass/fail depending on (eltype = character height and
intsz = 0 and
rlsz = 1 and
strsz = 0)
TEST: #SR 6
"<Inquire element content> should return the appropriate
information contained in the data record associated with
character height as the specified element of the open
structure."
<inquire element content> strid, 3
pass/fail depending on (intsz = 0 and
rlsz = 1 and
rlar(1) = .4 and
strsz = 0)
*** *** *** *** specified element = NIL *** *** *** ***
TEST: #SR 2
"<Inquire current element type and size> should return NIL
as the element type and 0 as the length of all array entry
sizes when the element pointer is 0."
<inquire current element type and size>
pass/fail depending on (eltype = NIL and
intsz = 0 and
rlsz = 0 and
strsz = 0)
TEST: #SR 3
"<Inquire current element content> should return 0 as the
length of all array entry sizes associated with the data
record when the element pointer is 0."
<inquire current element content>
pass/fail depending on (intsz = 0 and
rlsz = 0 and
strsz = 0)
Make sure <inquire element type and size> is independent of
element pointer:
<set element pointer> 77
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 open 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 open structure is 0."
<inquire element content> strid, 0
pass/fail depending on (intsz = 0 and
rlsz = 0 and
strsz = 0)
<close structure>
END PROGRAM 2