Design: 06.02.02/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: Initialization of WSL view table
CHARACTERISTICS: ynnn
OPERATOR SCRIPT: passive test.
DESIGN:
msgsuf = message suffix = "opening workstation."
check_table:
<open workstation>
<Inquire list of view indices> to determine
ldvi = list of defined indices in the view table
ndvi = number of defined indices in the view table
TEST: #SR 8 18 19
"List of view indices should be in consecutive
ascending order, starting with zero, after " + msgsuf
for ivw = 1 to ndvi
if (ivwth entry in ldvi not= ivw-1) then
fail
goto end_order
endif
next ivw
pass
end_order:
<Inquire view facilities> to determine
npvw = number of predefined views
<inquire workstation state table lengths> to determine
maxvw = maximum size of the view table
TEST: #SR 4 9
"There should be at least as many defined view indices as
predefined view entries, after " + msgsuf
pass/fail depending on (ndvi >= npvw)
TEST: #SR 10 12
"The number of defined view indices should be the same
as the maximum table length, after " + msgsuf
pass/fail depending on (ndvi = maxvw)
TEST: #SR 6 9 17
"For each WDT predefined view, the corresponding WSL
requested and current view table entry should have the
same values, after " + msgsuf
for ivwdx = 0 to npvw-1
<Inquire predefined view representation> to determine
wdtval = set of values from WDT for index=ivwdx
if inquire fails then
fail
message about inquire-WDT failure
goto end_correspond
endif
<Inquire view representation> to determine
rqwsl = set of requested values from WSL for index=ivwdx
cuwsl = set of current values from WSL for index=ivwdx
if inquire fails then
fail
message about inquire-WSL failure
goto end_correspond
endif
if (rqval = wdtval and
cuval = wdtval) then
OK so far
else
fail
goto end_correspond
endif
next ivwdx
pass
end_correspond:
TEST: #SR 10 17
"Each WSL requested and current view table entry for which
there is no corresponding WDT predefined entry should have
the same values as entry #0, after " + msgsuf
<Inquire view representation> to determine
ent0 = set of values from WSL for index=0
for ivwdx = npvw to ndvi-1
<Inquire view representation> to determine
rqwsl = set of requested values from WSL for index=ivwdx
cuwsl = set of current values from WSL for index=ivwdx
if inquire fails then
fail
message about inquire-WSL failure
goto end_no_correspond
endif
if (rqval = ent0 and
cuval = ent0) then
OK so far
else
fail
goto end_no_correspond
endif
next ivwdx
pass
end_no_correspond:
TEST: #SR 11 24
"The view transformation update state for each entry in
the WSL view table should be NOTPENDING after " + msgsuf
for ivwdx = 0 to ndvi-1
<Inquire view representation> to determine
vwtupd = view transformation update state
if inquire fails then
fail
goto end_notpend
endif
if (vwtupd not= NOTPENDING) then
fail
goto end_notpend
endif
next ivwdx
pass
end_notpend:
alter view table:
for view #1:
add 1.0 to orientation matrix, mapping matrix
new clip limits = old_limits / 2 + 0.1
new clip indicator = reverse of old
change order of entries in view table
make view #2 higher priority than view #0
<close workstation>
if (msgsuf = "opening workstation.") then
msgsuf = "re-opening workstation."
goto check_table
endif
END PROGRAM 3