Design: 09.01.01.01/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: Error 3 handled by user

CHARACTERISTICS: nnnn

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.

close workstation after initializing to test if functions
3,4,5,63,65,70,73,86,88,112 generate error 3 and/or 54; then close
phigs to test if functions 3,4,5,6,62,66,69,71,84,87,89,111,113
generate error 3 and/or 54: ignoring function, function requires
state (PHOP,WSOP,*,*).

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

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

<redraw all structures> with WKID, PCONDI : signals error
TEST: #SR 3
      "If <redraw all structures> signals an error because PHIGS is
       open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<update workstation> with WKID, PPOSTP : signals error
TEST: #SR 3
      "If <update workstation> signals an error because PHIGS is
       open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<set polymarker representation> with (WKID, 1,1,1.0,1) : signals error
TEST: #SR 3
      "If <set polymarker representation> signals an error because
       PHIGS is open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<set interior representation> with (WKID, 1, hollow, 1, 1) : signals error
TEST: #SR 3
      "If <set interior representation> signals an error because
       PHIGS is open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

inclusive set = {2,3,5}
exclusive set = {6}
<set invisibility filter> with inclusive set and exclusive set : signals error
TEST: #SR 3
      "If <set invisibility filter> signals an error because PHIGS
       is open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<set hlhsr mode> with WKID, 1 : signals error
TEST: #SR 3
      "If <set hlhsr mode> signals an error because PHIGS is open
       but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<set workstation window> with WKID, 0., 1., 0., 1. : signals error
TEST: #SR 3
      "If <set workstation window> signals an error because PHIGS is
       open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<set workstation viewport> with WKID, 0., 1., 0., 1. : signals error
TEST: #SR 3
      "If <set workstation viewport> signals an error because PHIGS
       is open but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

<unpost structure> 101 : signals error
TEST: #SR 3
      "If <unpost structure> signals an error because PHIGS is open
       but all workstations are closed, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = closed)

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

TEST: #SR 3
      "If <close workstation> is called and PHIGS is open but all
       workstations are closed, it should return error code  003 and/or  054,
       function identifier  003, 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 3
      "If <redraw all structures> is called and PHIGS is open but all
       workstations are closed, it should return error code  003 and/or  054,
       function identifier  004, 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 3
      "If <update workstation> is called and PHIGS is open but all
       workstations are closed, it should return error code  003 and/or  054,
       function identifier  005, 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 3
      "If <set polymarker representation> is called and PHIGS is open
       but all workstations are closed, it should return error code  003
       and/or  054, function identifier  063, 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 3
      "If <set interior representation> is called and PHIGS is open
       but all workstations are closed,  it should return error code
       003 and/or  054, function identifier  065, 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 3
      "If <set invisibility filter> is called and PHIGS is open but all
       workstations are closed, it should return error code  003 and/or
       054, function identifier  070, 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 3
      "If <set hlhsr mode> is called and PHIGS is open but all workstations
       are closed, it should return error code  003 and/or  054,
       function identifier  073, 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 3
      "If <set workstation window> is called and PHIGS is open but all
       workstations are closed, it should return
       error code  003 and/or  054, function identifier  087, 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 3
      "If <set workstation viewport> is called and PHIGS is open
       but all workstations are closed, it should return error code
       003 and/or 054, function identifier  089, 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 3
      "If <unpost structure> is called and PHIGS is open but all
       workstations are closed, it should return error code  003
       and/or  054, function identifier  112, 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 workstation>  : signals error
TEST: #SR 3
      "If <close workstation> signals an error because PHIGS is
       closed, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-closed)

<redraw all structures> with WKID, PCONDI : signals error

<update workstation> with WKID, PPOSTP : signals error

defmod = rndint(PASAP, PBNIG, PBNIL, PASTI, PWAITD)
modmod = rndint(PNIVE, PUWOR, PUQUM)
<set display update state> with WKID, defmod, modmod : signals error

<set polyline representation> with (WKID, 1, 1, 1.0, 0) : signals error

<set edge representation> with (WKID, 1, ON, 1, 1.0, 0) : signals error

inclusion set = {2,3,5}
exclusion set = {6}
<set highlighting filter> with WKID, inclusion set, exclusion set
   : signals error

<set colour model> with WKID, PRGB : signals error

xfrmt = identity matrix
limt = (0.,1.), (0.,1.)
<set view representation> with (WKID, 1, xfrmt, xfrmt, limt,
   PCLIP) : signals error

<set workstation window> with WKID, 0., 1., 0., 1. : signals error

<set workstation viewport> with WKID, 0., 1., 0., 1. : signals error

<post structure> with WKID, 101,stid, prioty : signals error

<unpost all structures> with WKID : signals error

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

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

TEST: #SR 3
      "If <redraw all structures> is called and PHIGS is closed, it
       should return error code  003 and/or  054 and function identifier
       004 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <update workstation> is called and PHIGS is closed, it
       should return error code  003 and/or  054 and function identifier
       005 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set display update state> is called and PHIGS is closed,
       it should return error code  003 and/or  054 and function
       identifier  006 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set polyline representation> is called and PHIGS is closed,
       it should return error code  003 and/or  054 and function
       identifier  062 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set edge representation> is called and PHIGS is closed, it
       should return error code  003 and/or  054 and function
       identifier  066 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set highlighting filter> is called and PHIGS is closed, it
       should return error code  003 and/or  054 and function
       identifier  069 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set colour model> is called and PHIGS is closed, it should
       return error code  003 and/or  054 and function identifier
       071 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set view representation> is called and PHIGS is closed, it
       should return error code  003 and/or  054 and function
       identifier  084 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set workstation window> is called and PHIGS is closed, it
       should return error code  003 and/or  054 and function identifier
       087 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <set workstation viewport> is called and PHIGS is closed,
       it should return error code  003 and/or  054 and function
       identifier  089 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <post structure> is called and PHIGS is closed, it should
       return error code  003 and/or  054 and function identifier  111 to
       the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 3
      "If <unpost all structures> is called and PHIGS is closed, it should
       return error code  003 and/or  054 and function identifier
       113 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

END PROGRAM 3