Design: 09.01.02.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 57 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.

Check the category of all accessible workstations. For all workstations
with category of MI, test if functions 84, 85, 87 and 89 generate
error 57: ignoring function, the specified workstation is
of category MI. If there is no workstation with the category of MI,
skip the test.

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

call MULTWS to get number of workstations with category MI: nwkmi
if (nwkmi = 0)
   informational message: There is no accessible workstation with
       category of MI, the test is skipped.
   return
endif

call MULTWS to get an MI workstation:
   workstation identifier: owkid
   connection identifier:  oconid
   workstation type:       owtype

rotmt2 = identity matrix
mapmt2 = identity matrix
limit2 = {0.,1.,0.,1.}

<open workstation> with owkid,  oconid, owtype
<set view representation> with owkid,1,rotmt2,mapmt2,limit2,0:
        signals error
TEST: #SR 7
      "If <set view representation> signals an error because the specified
       workstation is of category MI, it should not cause any other
       effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = open)

<set view transformation input priority> with owkid, 1, 1, higher:
        signals error
<set workstation window> with owkid, limit: signals error
limit2 = {0.,1.,0.,1.}
<set workstation viewport> with owkid, limit2: signals error
<close workstation> owkid

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

TEST: #SR 7
      "If <set view representation> is called and the specified
       workstation is of category MI, it should return error code
       057, function identifier 084, 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 7
      "If <set view transformation input priority> is called and
       the specified workstation is of category MI, it should
       return error code 057, function identifier 085, 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 7
      "If <set workstation window> is called and the specified
       workstation is of category MI, it should return error code
       057, 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 7
      "If <set workstation viewport> is called and the specified
       workstation is of category MI, it should return error code
       057, 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)

END PROGRAM 5