Design: 09.01.03.01/P17

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 17: Error 118 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.

Set one of the components of the colour specification out of range for every
valid colour model to test if function 69 generates error 118: ignoring
function, one of the components of the colour specification is out of range.

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

<open workstation> wkid
Use <inquire colour model facilities> to determine:
   nclmod = number of colour models
   lclmod(1:nclmod) = list of available colour models

for ix = 1 to nclmod
   <set colour model> to lclmod(ix)
   spec1 = {0.5,0.5,0.5}
   <set colour representation> with wkid,index=2,spec1
   col = {-0.5,0.,1.}
   <set colour representation> wkid, index=2, col: signals error
   Use <inquire colour specification> with index=2 to get:
      spec2 = components of colour specification
TEST: #SR 17
      "If <set colour representation> signals an error because one of the
       components of the colour specification is out of range, it should
       not cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = open and
                        spec1 = spec2)

   <set colour representation> wkid, 2, 0., 1.5, 0.5: signals error

   <set colour representation> wkid, 2, 0., 0.5,  -1.: signals error

next ix
<close workstation> wkid

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

for ix = 1 to nclmod

TEST: #SR 17
      "If <set colour representation> is called and one of the components of
       the colour specification is out of range, it should return error
       code  118, function identifier  068, 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 17
      "If <set colour representation> is called and one of the components of
       the colour specification is out of range, it should return error
       code  118, function identifier  068, 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 17
      "If <set colour representation> is called and one of the components of
       the colour specification is out of range, it should return error
       code  118, function identifier  068, 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 17