Design: 09.01.02.01/P07

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 7: Error 59 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 neither OUTPUT, OUTIN nor MO, test if functions 5,62,64,
66,70 generate error 59: ignoring function, the specified workstation
does not have output capability. If there is no workstation with the
category of neither OUTPUT, OUTIN nor MO, skip the test.

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

call MULTWS to get number of workstations with category of neither
OUTPUT, OUTIN, nor MO: nwknot
if (nwknot = 0)
     call INMSG ('There is no workstation with category of
                  OUTPUT, OUTIN or MO, this test is skipped.')
     return
endif

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

<open workstation> with owkid, oconid, owtype
<update workstation> with owkid: signals error

<set polyline representation> with owkid, 1, 1, 1.0, 1: signals error
<set text representation> with owkid, 1, 1, STRING, 1.0, 1.0, 0:
     signals error
<set edge representation> with owkid,1,OFF,1,1.0,0: signals error

inclusive set 2 = inset2 = {1,5,2}
exclusive set 2 = exset2 = {4}
<set invisibility filter> with owkid, inset2, exset2:
  signals error

<set colour model> with owkid, RGB: signals error
<open structure> 101
<post structure> with owkid, 100, 0.5: signals error
TEST: #SR 9
      "If <post structure> signals an error because the workstation
       type does not have output capability, it should not cause any
       other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = open and
                        structure state = open)
<close structure>
<close workstation> owkid

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

TEST: #SR 9
      "If <update workstation> is called and the workstation type
       does not have output capability, it should return error code
       059, 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 9
      "If <set polyline representation> is called and the
       workstation type does not have output capability, it should
       return error code 059, function identifier 062, 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 9
      "If <set text representation> is called and the workstation
       type does not have output capability, it should return error
       code 059, function identifier 064, 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 9
      "If <set edge representation> is called and the workstation
       type does not have output capability, it should return error
       code 059, function identifier 066, 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 9
      "If <set invisibility filter> is called and the workstation
       type does not have output capability, it should return error
       code 059, 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 9
      "If <set colour model> is called and the workstation type
       does not have output capability, it should return error code
       059, function identifier 071, 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 9
      "If <post structure> is called and the workstation type does
       not have output capability, it should return error code 059,
       function identifier 111, 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 7