Design: 09.01.01.01/P05

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 5: Error 5 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
te 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.

Not open structure after initializing to test if functions
8,13,17,24,29,34, 37,57,59,61,75,79,92,97,101 generate error 5;
then close phigs to test if functions
11,15,19,27,33,35,48,58,60,72,76,91,93,98 generate error 5:
ignoring function, function requires state (PHOP,*,STOP,*)

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

n = 2
pxa = (0., 0.5)
pya = (0., 0.5)
pza = (0., 0.5)
<polyline3> with (n, pxa, pya, pza) : signals error
TEST: #SR 5
      "If <polyline 3> signals an error because PHIGS is open but no
       structure is open, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        structure state = closed)

<text> with (0.5, 0.5, 'text') : signals error

pxa = (0.,0.5,0.5,0.)
pya = (0.,0.,0.5,0.5)
<fill area> with (n, pxa, pya) : signals error

<set polyline index> to 1 : signals error

<set linetype> to solid line : signals error

<set polymarker colour index> to 1 : signals error

<set character expansion factor> to 1.0 : signals error

<set edge flag> to 1 : signals error

nameset(1)=1
<add names to set> with nameset : signals error

<set individual asf> to polyline and individual : signals error

xfrmt = identity matrix
<set local transformation> with xfrmt and REPLACE : signals error

op = PMCREP
n = 1
halfsp = (0.52, 0., -1., 0., 0.48, 0., 1., 0.)
<set modelling clipping volume> with op, n, halfsp : signals error

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

<copy all elements from structure> : signals error
TEST: #SR 5
      "If <copy all elements from structure> signals an error
       because PHIGS is open but no structure is open, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        structure state = closed)

<delete element> : signals error
TEST: #SR 5
      "If <delete element> signals an error because PHIGS is open
       but no structure is open, it should not cause any other
       effect."
pass/fail depending on (system state = PHIGS-open and
                        structure state = closed)

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

TEST: #SR 5
      "If <polyline 3> is called and PHIGS is open but no structure
       is open, it should return error code  005, function identifier
       008, 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 5
      "If <text> is called and PHIGS is open but no structure is open,
       it should return error code  005, function identifier  013,
       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 5
      "If <fill area> is called and PHIGS is open but no structure is
       open, it should return error code  005, function identifier
       017, 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 5
      "If <set polyline index> is called and PHIGS is open but no structure
       is open,  it should return error code  005, function
       identifier  024, 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 5
      "If <set linetype> is called and PHIGS is open but no structure is
       open, it should return error code  005, function
       identifier  029, 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 5
      "If <set polymarker colour index> is called and PHIGS is open but
       no structure is open, it should return error code  005,
       function identifier  034, 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 5
      "If <set character expansion factor> is called and PHIGS is open
       but no structure is open, it should return error code  005,
       function identifier  037, 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 5
      "If <set edge flag> is called and PHIGS is open but no structure
       is open, it should return error code  005, function identifier
       052, 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 5
      "If <add names to set> is called and PHIGS is open but no structure
       is open, it should return error code  005, function identifier
       059, 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 5
      "If <set individual asf> is called and PHIGS is open but no structure
       is open, it should return error code  005, function
       identifier  061, 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 5
      "If <set local transformation> is called and PHIGS is open but no
       structure is open, it should return error code 005, function
       identifier  075, 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 5
      "If <set modelling clipping volume> is called and PHIGS is open but
       no structure is open, it should return error code  005,
       function identifier  079, 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 5
      "If <execute structure> is called and PHIGS is open but no structure
       is open, it should return error code  005, function
       identifier  092, 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 5
      "If <copy all elements from structure> is called and PHIGS is open
       but no structure is open, it should return error code  005,
       function identifier  097, 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 5
      "If <delete element> is called and PHIGS is open but no structure
       is open, it should return error code  005, function
       identifier  101, 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>

n = 2
pxa = (0.5, 0.5)
pya = (0.5, 0.5)
<polymarker> with n, pxa, pya : signals error
TEST: #SR 5
      "If <polymarker> signals an error because PHIGS is closed, it
       should not cause any other effect."
pass/fail depending on (system state = PHIGS-closed)

<annotation text relative> with (0.5, 0.5, 0.1, 0.1, 'text') : signals error

npl = 2
ixa = (3,3)
pxa = (0.,0.4,0.2,0.2,0.4,0.)
pya = (0.,0.,0.2,0.3,0.5,0.5)
<fill area set> with (npl, ixa, pxa, pya) : signals error

<set interior index> to 1: signals error

<set marker size scale factor> to 1.0 : signals error

<set text font> to 1 : signals error

<set annotation style> to unconnected : signals error

<set pattern reference point> to 0., 0. : signals error

<remove names from set> with nameset : signals error

<set hlhsr identifier> to 1 : signals error

<set global transformation> with mat : signals error

<close structure> : signals error

<label> 99 : signals error

<set element pointer> to 10 : signals error
TEST: #SR 5
      "If <set element pointer> 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 5
      "If <polymarker> is called and PHIGS is closed,
       it should return error code  005 and function identifier  011
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <annotation text relative> is called and PHIGS is closed,
       it should return error code  005 and function identifier  015
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <fill area set> is called and PHIGS is closed, it should
       return error code  005 and function identifier 019 to the user
       defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <set interior index> is called and PHIGS is closed,
       it  should return error code  005 and function identifier  027
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <set marker size scale factor> is called and PHIGS is closed,
       it should return error code  005 and function identifier  033
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <set text font> is called and PHIGS is closed, it
       should return error code  005 and function identifier 035 to the user
       defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <set annotation style> is called and PHIGS is closed, it
       should return error code  005 and function identifier  048 to the
       user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <set pattern reference point> is called and PHIGS is closed,
       it should return error code  005 and function identifier  058
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 5
      "If <remove names from set> is called and PHIGS is closed, it
       should return error code  005 and function identifier  060 to the
       user defined error handler."
pass/fail depending on (next entry in error table = expected values)

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

TEST: #SR 5
      "If <set global transformation> is called and PHIGS is closed,
       it should return error code  005 and function identifier  077
       to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

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

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

TEST: #SR 5
      "If <set element pointer> is called and PHIGS is closed, it
       should return error code  005 and function identifier  098 to the
       user defined error handler."
pass/fail depending on (next entry in error table = expected values)

END PROGRAM 5