Design: 09.01.02.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: Error 53 handled by user
CHARACTERISTICS: ynnn
OPERATOR SCRIPT:
See OPERATOR SCRIPT for Program 1.
DESIGN:
Throughout this program, every time an error is signalled (as noted
by the tag "signals error"), the user-defined error handler saves
the error code, function identifier, and error file identifier in
an error table.
<open workstation> twice with same parameters to test if error 53 is
generated: ignoring function, workstation identifier already is in use.
*** *** *** Generate errors; test absence of side effects *** *** ***
nwkall = number of accessible workstations
ignok = true
for ix = 1, nwkall
<open workstation> on workstation #ix with owkid, oconid, owtype
<open workstation> with owkid, oconid, owtype: signals error
<inquire set of open workstations> to determine number and
identity of open workstation: numowk and opwkid
if (system state = PHIGS-open and workstation state = open and
numowk = 1 and opwkid = owkid) then
OK so far
else
ignok = false
endif
<close workstation> on workstation #ix with owkid
next ix
TEST: #SR 3
"If <open workstation> signals an error because the specified
workstation identifier is in use, it should not cause any
other effect."
pass/fail depending on (ignok)
*** *** *** Results of user-defined error handling *** *** ***
for ix = 1, nwkall
TEST: #SR 3
"If <open workstation> is called and the specified workstation
identifier is in use, it should return error code 053,
function identifier 002, and the current error file
identifier to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)
next ix
END PROGRAM 2