Design: 09.01.01.01/P04

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 4: Error 4 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.
When phigs is closed, the error file identifier is not checked.

Open workstation, open structure or open archive file after
initializing to test if function <close phigs> generates error 4;
then close phigs to test if <close phigs> generates error 4:
ignoring function, function requires state (PHOP, WSCL, STCL,
ARCL).

*** *** ***  Generate errors; test absence of side effects  *** *** ***

<open workstation> with WKID, CONID, WTYPE
<close phigs> : signals error
TEST: #SR 4
      "If <close phigs> signals an error because PHIGS is open and a
       workstation is open, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = open)
<close workstation>

<open structure>
<close phigs> : signals error
TEST: #SR 4
      "If <close phigs> signals an error because PHIGS is open and a
       structure is open, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-open  and
                        workstation state = closed and
                        structure state = open)
<close structure>

<open archive file>
<close phigs> : signals error
TEST: #SR 4
      "If <close phigs> signals an error because PHIGS is open and
       an archive file is open, it should not cause any other
       effect."
pass/fail depending on (system state = PHIGS-open  and
                        workstation state = closed and
                        structure state = closed and
                        archive state = open)
<close archive file>

*** *** ***  Results of user-defined error handling  *** *** ***

TEST: #SR 4
      "If <close phigs> is called and PHIGS is open and a workstation
       is open, it should return error code  004,
       function identifier 001, and the current error file identifier
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 4
      "If <close phigs> is called and PHIGS is open and a structure
       is open, it should return error code  004,
       function identifier 001, and the current error file identifier
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 4
      "If <close phigs> is called and PHIGS is open and an archive file
       is open, it should return error code  004, function identifier
       001, and the current error file identifier to the user
       defined error handler."
pass/fail depending on (next entry in error table = expected values)

*** *** *** Generate errors; test absence of side effects  *** *** ***

<close phigs>

<close phigs> : signals error
TEST: #SR 4
      "If <close phigs> signals an error because PHIGS is closed, it
       should not cause any other effect."
pass/fail depending on (system state = PHIGS-closed)

*** *** ***  Results of user-defined error handling  *** *** ***

TEST: #SR 4
      "If <close phigs> is called and PHIGS is closed, it should
       return error code  004 and function identifier  001 to the user
       defined error handler."
pass/fail depending on (next entry in error table = expected values)

END PROGRAM 4