Design: 04.03.03/P02

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 2: Set and inquire HLHSR mode

CHARACTERISTICS: ynnn

OPERATOR SCRIPT: passive test.

DESIGN:

<inquire HLHSR facilities> to determine
  nummod = number of available HLHSR modes
  lstmod = list of HLHSR modes
<inquire HLHSR mode> to determine
  orgmod = current HLHSR mode, original

val = 0
try to find HLHSR mode distinct from original mode
for each hrmd in lstmod
   if hrmd not= orgmod then
      val = hrmd
      go to next
   endif
loop

next:
<set display update state> to WAIT, UWOR to allow
   testing of hlhsr update status.

<set HLHSR mode> to val
<inquire HLHSR mode> to determine
   update = HLHSR update state
   reqmod = requested HLHSR mode
   curmod = current HLHSR mode

TEST: #SR 4 5
      "The requested HLHSR mode should be returned as set."
pass/fail depending on (reqmod = val)

<inquire dynamics of workstation attributes> to determine
   dynmod = dynamic modification entry for HLHSR mode

(Surface should be empty)
<inquire display update state> to determine
   surfmt = display surface empty

if surfmt not= EMPTY then
   message about unexpected state
   goto non_empty_test
endif

if (dynmod = IMM) then
   TEST: #SR 5 6
         "If the dynamic modification entry for HLHSR mode is IMM
          and the display surface is EMPTY, then new values
          should be set for current HLHSR mode and the HLHSR update
          state should be NOTPENDING."
else
   TEST: #SR 5 6
         "If the dynamic modification entry for HLHSR mode is not
          IMM and the display surface is EMPTY, then new values
          should be set for current HLHSR mode and the HLHSR update
          state should be NOTPENDING."
endif
pass/fail depending on (update = NOTPENDING and
                        curmod = val)

Cause surface to be NOT EMPTY:
<open structure>
<polyline>
<close structure>
<post structure>

<set HLHSR mode> to orgmod
<update workstation> to force orgmod to be current
  and screen to be non-empty

(Surface should be non-empty)
<inquire display update state> to determine
   surfmt = display surface empty

if surfmt not= NOTEMPTY then
   message about unexpected state
   goto done
endif

<set HLHSR mode> to val
<inquire HLHSR mode> to determine
   update = HLHSR update state
   reqmod = requested HLHSR mode
   curmod = current HLHSR mode

non_empty_test:

if (dynmod = IMM) then
   TEST: #SR 5 6
         "If the dynamic modification entry for HLHSR mode is IMM
          and the display surface is not EMPTY, then new values
          should be set for current HLHSR mode and the HLHSR update
          state should be NOTPENDING."
   pass/fail depending on (update = NOTPENDING and
                           curmod = val)
else
   if (reqmod not= curmod) then
      TEST: #SR 5 7
            "If the current HLHSR mode differs from that
             requested by <set HLHSR mode>, then the current
             HLHSR mode should be unchanged and the HLHSR update
             state should be PENDING."
      pass/fail depending on (update = PENDING and
                              curmod = orgmod)
   endif
endif

done:

END PROGRAM 2