Design: 09.01.01.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 7 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
the 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 archive file after initializing to test if function
115,116, 120,121,123,124,126 generates error 7 and/or 404; close
phigs to test if those functions generate error 7 and/or 404:
ignoring function, function requires state (PHOP, *, *, AROP).

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

arid = 11
stid = 101
stlist = (101, 102)
pathod = TOPFIRST
pathdp = 1
<close archive file> arid : signals error
TEST: #SR 7
      "If <close archive file> signals an error because PHIGS is
       open but no archive file is open, it should not cause any
       other effect."
pass/fail depending on (system state = PHIGS-open and
                        archive state = closed)

<archive structures> arid, stlist : signals error
TEST: #SR 7
      "If <archive structures> signals an error because PHIGS is
       open but no archive file is open, it should not cause any
       other effect."
pass/fail depending on (system state = PHIGS-open and
                        archive state = closed)

<retrieve structure identifiers> with arid, stlist : signals error

<retrieve structures> with arid, stlist : signals error

<retrieve all structures> with arid : signals error
TEST: #SR 7
      "If <retrieve all structures> signals an error because PHIGS
       is open but no archive file is open, it should not cause
       any other effect."
pass/fail depending on (system state = PHIGS-open and
                        archive state = closed)

<retrieve paths to ancestors> wit arid, stid, pathod, pathdp,
   reppth : signals error
TEST: #SR 7
      "If <retrieve paths to ancestors> signals an error because
       PHIGS is open but no archive file is open, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        archive state = closed)

<delete structures from archive> with arid, stlist : signals error
TEST: #SR 7
      "If <delete structures from archive> signals an error because
       PHIGS is open but no archive file is open, it should not
       cause any other effect."
pass/fail depending on (system state = PHIGS-open and
                        archive state = closed)

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

TEST: #SR 7
      "If <close archive file> is called and PHIGS is open but no
       archive file is open, it should return error code 007 and/or  404,
       function identifier  115, 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 <archive structures> is called and PHIGS is open but no
       archive file is open, it should return error code 007 and/or  404,
       function identifier  116, 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 <retrieve structure identifiers> is called and PHIGS is open
       but no archive file is open, it should return error code
       007 and/or  404, function identifier  120, 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 <retrieve structures> is called and PHIGS is open but no
       archive file is open, it should return error code 007 and/or
       404, function identifier  121, 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 <retrieve all structures> is called and PHIGS is open but
       no archive file is open, it should return error code  007 and/or
       404, function identifier  123, 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 <retrieve paths to ancestors> is called and PHIGS is open but
       no archive file is open, it should return error code
       007 and/or  404, function identifier  124, 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 <delete structures from archive> is called and PHIGS is open but
       no archive file is open, it should return error code  007 and/or
       404, function identifier  126, and the current error file
       identifier to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

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

<close PHIGS>

<close archive file> arid : signals error
TEST: #SR 7
      "If <close archive file> signals an error because PHIGS is
       closed, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-closed)

<archive structures> arid, stlist : signals error
TEST: #SR 7
      "If <archive structures> signals an error because PHIGS is
       closed, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-closed)

<retrieve structure identifiers> with arid, stlist : signals error

<retrieve structures> with arid, stlist : signals error

<retrieve all structures> with arid : signals error

<retrieve paths to ancestors> with arid, stid, pathod, pathdp,
   reppth : signals error
TEST: #SR 7
      "If <retrieve paths to ancestors> signals an error because
       PHIGS is closed, it should not cause any other effect."
pass/fail depending on (system state = PHIGS-closed)

<delete structures from archive> with arid, stlist : signals error
TEST: #SR 7
      "If <delete structures from archive> 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 7
      "If <close archive file> is called and PHIGS is closed, it should
       return error code  007 and/or  404 and function identifier
       115 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 7
      "If <archive structures> is called and PHIGS is closed, it should
       return error code  007 and/or  404 and function identifier
       116 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 7
      "If <retrieve structure identifiers> is called and PHIGS is closed,
       it should return error code  007 and/or  404 and
       function identifier  120 to the user defined error
       handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 7
      "If <retrieve structures> is called and  PHIGS is closed, it
       should return error code  007 and/or  404 and function identifier
       121 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)

TEST: #SR 7
      "If <retrieve all structures> is called and PHIGS is closed, it
       should return error code  007 and/or  404 and function
       identifier  123 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)


TEST: #SR 7
      "If <retrieve paths to ancestors> is called and PHIGS is closed,
       it should return error code  007 and/or 404 and function
       identifier  124 to the user defined error handler."
pass/fail depending on (next entry in error table = expected values)


TEST: #SR 7
      "If <delete structures from archive> is called and PHIGS is closed,
       it should return error code  007 and/or  404 and
       function identifier  126 to the user defined error
       handler."
pass/fail depending on (next entry in error table = expected values)

END PROGRAM 7