Design: 09.01.04.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 157 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.

Setting workstation viewport limits to the values out of display space to test
if functions 88,89 generate error 157: ignoring function, the workstation
viewport is not within display space.

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

<open workstation> wkid
Use <inquire display space size 3> to determine:
   dx3,dy3,dz3 = maximum display space size in device display coordinate units
Use <inquire display space size> to determine:
   dx2,dy2 = maximum display space size in device display coordinate units

xx = dx3/2
yy = dy3/2
zz = dz3/2
<set workstation viewport 3> with viewport limits = {0.,xx,0.,yy,0.,zz}
<set workstation viewport 3> with viewport limits =
      {-0.1,dx3,0.,dy3, 0.,dz3}: signals error
Use <inquire workstation transformation 3> to get:
     current viewport limits: xmin1,xmax1,ymin1,ymax1,zmin1,zmax1
TEST: #SR 7
      "If <set workstation viewport 3> signals an error because the specified
       workstation viewport is not within display space, it should not cause
       any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstation state = open  and
                        xmin1=0. and xmax1=xx and ymin1=0. and ymax1=yy
                        and zmin1=0 and zmax1=zz)

<set workstation viewport 3> with viewport limits =
      {0.,dx3,0.,dy3+0.1,0.,dz3}: signals error

<set workstatioin viewport 3> with viewport limits =
      {0.,dx3,0.,dy3,-0.1,dz3+0.1}: signals error

<set workstation viewport> with viewport limits =
      {-0.1,dx2,0.,dy2}: signals error

<set workstation viewport> with viewport limits =
      {0.,dx2,0.,dy2+0,1}: signals error

xx=dx2/2
yy=dy2/2
<set workstation viewport> with window limits = {0.,xx,0.,yy}
<set workstaiton viewport> with window limits =
      {-0.1,dx2,0.,dy2+0.1}: signals error
Use <inquire workstation transformation> to get:
     viewport limits: xmin1,xmax1,ymin1,ymax1
TEST: #SR 7
      "If <set workstation viewport> signals an error because the specified
       workstation viewport is not within display space, it should not cause
       any other effect."
pass/fail depending on (system state = PHIGS-open and
                        workstaton state = open   and
                        xmin1=0. and xmax1=xx and ymin1=0. and ymax=yy)

<close workstation> wkid

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

TEST: #SR 7
      "If <set workstation viewport 3> is called and the specified
       workstation viewport is not within display space, it should
       return error code  157, function identifier  088,
       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 3> is called and the specified
       workstation viewport is not within display space, it should
       return error code  157, function identifier  088,
       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 3> is called and the specified
       workstation viewport is not within display space, it should
       return error code  157, function identifier  088,
       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 viewport is not within display space, it should
       return error code  157, 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 7
      "If <set workstation viewport> is called and the specified
       workstation viewport is not within display space, it should
       return error code  157, 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 7
      "If <set workstation viewport> is called and the specified
       workstation viewport is not within display space, it should
       return error code  157, 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 7