Design: 05.01.02/P01

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 1: Characteristics of workstations

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

TEST: #SR 5 7
      "The number of available workstation types should be
       reported as at least 1."

<inquire list of available workstation types> to determine
   laty   = list of available types
if (inquire is in error or laty is empty) then
   fail
   goto end_gtype
else
   pass
endif

TEST: #SR 1 2 3 5
      "The result of <inquire workstation category> using a
       generic workstation type should be either a valid category
       or error 51."
for each gtype = generic type in laty
    <inquire workstation category> using gtype to determine
       wkcat = workstation category
    if ((errind = 51) or
        (errind = 0 and wkcat = OUTPUT or INPUT or OUTIN or MO or MI)) then
       OK so far - do nothing
    else
       fail
       msg about bad gtype
       goto end_gtype
    endif
next gtype
pass

end_gtype:

laccwk = list of accessible workstations
   owkid  = workstation identifier for iwk'th workstation in laccwk
   oconid = connection identifier for iwk'th workstation in laccwk
   owtype = workstation type for iwk'th workstation in laccwk

typeok = true  = list of available workstation types
                 contains all generic types
gnonly = true  = list of available workstation types
                 contains only generic types
conok  = true  = connection identifiers ok
catok  = true  = <inquire workstation category> returns a
                 valid category
inqok  = true  = <inquire workstation connection and type>
                 works
clasok = true  = workstation classifications ok
gotone = false = got one OUTIN workstation

for each iwk in laccwk
   if (owtype(iwk) not in laty) then
      typeok = false
   endif

   <open workstation> owkid(iwk)

   <inquire workstation connection and type> to determine
      specon = connection identifier
      specwt = specific workstation type

   if (inquire does not report error) then
      if (specon not= oconid(iwk)) then
         conok = false
         message about operator supplied oconid(iwk) not= specon
      endif

      if (specwt contained in laty) then
         gnonly = false
      endif
   else
      inqok = false
   endif

   <inquire workstation category> using specwt to determine
      specat = workstation category
   if (inquire reports error or
       specat not one of OUTPUT, INPUT, OUTIN, MO, or MI) then
      catok = false
   endif

   if (specat = OUTPUT or OUTIN) then
      <inquire workstation classification> to determine
         wclass = workstation classification
      if (inquire reports error or
          wclass not one of VECTOR, RASTER, or OTHER) then
         clasok = false
      endif
   endif

   if (specat = OUTIN) then
      gotone = true
   endif

   <close workstation> owkid(iwk)
next iwk

TEST: #SR 5 6
      "The generic workstation type of each accessible workstation
       should be in the list of available workstation types."
pass/fail depending on (typeok)

TEST: #SR 5 6 8
      "The list of available workstation types should contain
       only generic types."
pass/fail depending on (gnonly)

TEST: #SR 8
      "<Inquire workstation connection and type> should report the
       same connection identifier as used in <open workstation>."
pass/fail depending on (conok)

TEST: #SR 8
      "<Inquire workstation connection and type> should report a
       connection identifier and specific type for any open
       workstation."
pass/fail depending on (inqok)

TEST: #SR 2 3
      "The reported category for any workstation type should be
       either OUTPUT, INPUT, OUTIN, MO, or MI."
pass/fail depending on (catok)

TEST: #SR 9 10
      "The reported workstation classification for workstations of
       category OUTPUT or OUTIN should be either VECTOR, RASTER, or
       OTHER."
pass/fail depending on (clasok)

TEST: #SR 2 3 4
      "There should be at least one workstation of category OUTIN."
pass/fail depending on (gotone)

END PROGRAM 1