Design: 05.03/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: Effects of posting on the structure state list and
workstation state list
CHARACTERISTICS: ynnn
OPERATOR SCRIPT: passive test.
DESIGN:
*** *** *** *** *** Initialization *** *** *** *** ***
setup:
Use <inquire phigs facilities> to determine:
simopw = maximum number of simultaneously open workstations
accout = number of accessible workstations with output capabilities
acwkid = array containing the specified workstation identifiers
numwks = min (3, accout, simopw) = number of workstations open
table setup:
stvswk = all -1's, indicating unposted = 4 rows x 3 column array
indicating what structures (rows) are expected to be
posted to what workstations (columns).
stinwk = 4 rows x 3 column array indicating what structures
(rows) are initially posted to what workstations
(columns).
open workstations:
do iwk = 1 to numwks
get information for acwkid(iwk)
<open workstation> acwkid(iwk)
loop
TEST: #SR 11 14
"Immediately after opening a workstation, its list of
posted structures should be empty."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
structure setup:
numstr = 4 = number of structures
strid = array containing the specified structure identifiers
create structures:
do istr = 1 to numstr
for each structure -
1: <open structure> strid(istr)
2: <execute structure> strid(istr)
3: <empty structure> strid(istr)
4: <close structure>
<open structure> strid(istr)
loop
TEST: #SR 10 13
"Immediately after a structure is created, its list of
workstations to which posted should be empty."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 10 14
"Immediately after a structure is created, no list of
posted structures should contain it."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
*** *** *** *** *** Posting *** *** *** *** ***
Loop posts structures as follows:
structure workstations to which posted
--------- ----------------------------
1 all
2 first and last
3 all but the last
4 all but the first
do iwk = 1 to numwks
do istr = 1 to numstr
if ((istr = 1) or
(istr = 2 and (iwk = 1 or iwk = numstr)) or
(istr = 3 and iwk not= numstr) or
(istr = 4 and iwk not= 1) ) then
stinwk (istr, iwk) = 1, to be posted
stvswk (istr, iwk) = 1, to be posted
endif
loop
loop
post structures to workstations, according to stinwk
TEST: #SR 1 13
"<Post structure> should add the workstation identifier to
the list of workstations to which posted of the specified
structure."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 2 14
"<Post structure> should add the structure identifier to
the list of posted structures of the specified
workstation."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
Re-post 2nd structure to 1st workstation, with different priority = dp
TEST: #SR 4 13
"<Post structure> should leave unchanged the list of
workstations to which posted of the specified structure when
that structure has already been posted to the specified
workstation."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 4 14
"<Post structure> should leave unchanged the list of posted
structures of the specified workstation when the specified
structure has already been posted to that workstation."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
TEST: #SR 4 14
"<Post structure> should change the relevant display priority in
the list of posted structures when the specified structure has
already been posted to the specified workstation."
<inquire list of posted structures> for 2nd structure, 1st workstation
to determine new priority = np
pass/fail depending on (np = dp)
*** *** *** *** Unposting a non-existent structure *** *** *** ***
<unpost structure> acwkid(1), structure #99
TEST: #SR 7 13
"Unposting a non-existent structure should have no effect
on any list of workstations to which posted."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 7 14
"Unposting a non-existent structure should have no effect
on any list of posted structures."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
TEST: #SR 7
"Unposting a non-existent structure should not create the
specified structure."
pass/fail depending on (structure #99 does not exist)
*** *** *** *** Unposting an unposted existent structure *** *** *** ***
<empty structure> 99
<unpost structure> acwkid(1), structure #99
TEST: #SR 7 13
"Unposting an unposted structure should have no effect
on any list of workstations to which posted."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 7 14
"Unposting an unposted structure should have no effect
on any list of posted structures."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
*** *** *** Unposting individual structures *** *** ***
unpost every other posting:
upsw = false
do istr = 1 to numstr
do iwk = 1 to numwks
if (stvswk(istr, iwk) = 1) then
upsw = not upsw
if (upsw) then
<unpost structure> acwkid(iwk), strid(istr)
stvswk(istr, iwk) = -1
endif
endif
loop
loop
TEST: #SR 5 13
"<Unpost structure> should remove the workstation
identifier from the list of workstations to which posted
of the specified structure."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 6 14
"<Unpost structure> should remove the structure identifier
from the list of posted structures of the specified
workstation."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
*** *** *** Unposting all structures *** *** ***
post structures to workstations, according to stinwk
stvswk = stinwk
<unpost all structures> acwkid(1)
do istr = 1 to numstr
stvswk(istr, 1) = -1
loop
TEST: #SR 8 13
"<Unpost all structures> should remove the workstation
identifier from the list of workstations to which posted
in all the structure state lists."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
TEST: #SR 9 14
"<Unpost all structures> should remove all structure
identifiers from the list of posted structures of
the specified workstation."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
*** *** *** *** *** Close workstation *** *** *** *** ***
post structures to workstations, according to stinwk
stvswk = stinwk
<close workstation> acwkid(1)
do istr = 1 to numstr
stvswk(istr, 1) = -1
loop
TEST: #SR 12 13
"<Close workstation> should remove the workstation
identifier from the list of workstations to which posted
in all the structure state lists."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
*** *** *** *** *** Re-opening workstation *** *** *** *** ***
<open workstation> acwkid(1)
TEST: #SR 11 14
"Immediately after re-opening a workstation, its list of
posted structures should be empty."
pass/fail depending on
(list of posted structures for all workstations
equivalent to expected status in stvswk)
TEST: #SR 11 13
"Immediately after re-opening a workstation, no list of
workstations to which posted should contain it."
pass/fail depending on
(list of workstations to which posted for all structures
equivalent to expected status in stvswk)
<close structure>
close all workstations
END PROGRAM 1