Design: 04.02.01.01/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: Appearance of individual attributes

CHARACTERISTICS: ynny

OPERATOR SCRIPT:

MANDATORY LINETYPES: This screen should display examples of each
of the mandatory linetypes actually supported by the
implementation.  You should not consider whether all 4 are
present, but simply whether each linestyle is recognizable from
the verbal description.  Enter a list of integers which identify
the linetypes in the same order as they appear in the prompt.

UNSUPPORTED LINETYPES: This screen should display several solid
lines and one non-solid.  Identify the non-solid line.

NON-MANDATORY REGISTERED LINETYPES: This screen displays a sample
of supported registered linetypes (at most 8).  For each
displayed line, look up its linetype identifier in the ISO
register and verify that the actual appearance of the line agrees
with the ISO specification.

IMPLEMENTOR DEFINED LINETYPES: This screen displays a sample of
implementor defined linetypes (at most 8).  For each displayed
line, look up its linetype identifier in the implementor's
documentation and verify that the actual appearance of the line
agrees with the specification.

COMPLETE DOCUMENTATION FOR IMPLEMENTOR LINETYPES: No associated
picture.  Verify that all the entries in the list of available
linetypes for this workstation type are documented by the
implementor.  The list may be a subset of the documented
linetypes.

VARIOUS LINEWIDTH SCALE FACTORS: Several numbered pairs of
rectangles are drawn.  Compare the vertical sizes for each pair.
One pair should have the same size for both members.  Although
the program tries to line up the bottom of the rectangles, there
is no requirement that they be aligned, so judge only according
to size.

POSITIVE LINEWIDTH BELOW MINIMUM: as above, for VARIOUS LINEWIDTH
SCALE FACTORS.

NEGATIVE LINEWIDTH: as above, for VARIOUS LINEWIDTH SCALE
FACTORS.

POSITIVE LINEWIDTH ABOVE MAXIMUM: as above, for VARIOUS LINEWIDTH
SCALE FACTORS.

DEFINED POLYLINE COLOR INDICES: All lines but one are drawn in
the background color.  Identify the single line drawn in the
default foreground color.

UNDEFINED POLYLINE COLOR INDICES: A star is drawn with several
horizontal lines beneath it.  Normally, all of these will be the
same color as the star.  Count up and report the number of lines
which match the star in color.

DESIGN:

use <inquire polyline facilities> to determine:
  numlt  = number of available linetypes
  lavslt = list of available standard linetypes
  lavrlt = list of available registered (non-mandatory) linetypes
  lavilt = list of available implementor-defined linetypes
           (may be derived directly from linetype value, if reported
            number of linetypes < 0)
  numlw  = number of available line-widths
  nomlw  = nominal line-width (DC)
  minlw,maxlw = minimum,maximum line-width (DC)

*** *** ***   1. linetype

Use default background color=0, foreground=1

Display in random order all linetypes in lavslt

TEST: #SR 3 4 5 6 8
      "The mandatory linetypes (1-4) should be recognizable from
       their standard description."

OPQA/MANDATORY LINETYPES: List, in order, the numeric labels for
  linetypes: solid, dotted, dashed, dotted-dashed.

pass/fail depending on (all displayed linetypes correctly identified)

lunsup = list of (mostly) unsupported linetypes, contains:
  a negative unsupported type, if available (< minimum in lavilt)
  0, if not in lavilt
  a positive unsupported type (> maximum in lavrlt)
  1,
  2,3, or 4 if supported (the only non-solid one)

if (2,3,4 not available) then
   goto end_solid
endif

Display in random order linetypes from lunsup

TEST: #SR 3 4 5 6 7 8
      "Unavailable linetypes should be displayed as linetype
       number 1."

OPQA/UNSUPPORTED LINETYPES: which line is NOT solid?
pass/fail depending on (the non-solid linetype (2,3, or 4) selected)

end_solid:

regdx = size of lavrlt
if regdx < 1 skip to neg_type

if regdx < 9
   lindis = lines to be displayed = all linetypes in lavrlt
else
   lindis = lines to be displayed = 8 linetypes randomly selected
                                    from lavrlt
endif

display in order and label all linetypes in lindis

TEST: #SR 3 4 5 6 9
      "The registered non-mandatory linetypes (> 4) should
       agree with their registered description."

OPQA/NON-MANDATORY REGISTERED LINETYPES: Is each linetype
  depicted according to its numeric identifier's specification in
  the ISO register?
pass/fail depending on (operator responds "yes")

neg_type:

impdx = size of lavilt
if impdx < 1 goto end_linetype

if impdx< 9
   lindis = lines to be displayed = all linetypes in lavilt
else
   lindis = lines to be displayed = 8 linetypes randomly selected
                                    from lavilt
endif

display in order and label all linetypes in lindis

TEST: #SR 3 4 5 6 10
      "Implementor-defined linetypes (< 1) should agree with the
       descriptions supplied by the implementor."

OPQA/IMPLEMENTOR DEFINED LINETYPES: Is each linetype depicted
  according to its numeric identifier's specification in the
  implementor documentation?
pass/fail depending on (operator responds "yes")

if (impdx <= 8 or numlt < 0) then
   either all implementor linetypes already shown or
   linetype appearance derived directly from value - skip test
   goto end_linetype
endif

TEST: #SR 10
      "All reported implementor-defined linetypes available for a
       given workstation type should be documented by the
       implementor."

OPQA/COMPLETE DOCUMENTATION FOR IMPLEMENTOR LINETYPES: Are all
  these reportedly available linetypes documented by the
  implementor <lavilt> ?
pass/fail depending on (operator responds "yes")

end_linetype:

*** *** ***   2. line-width

from dialog common:
  wcpdc  = WC unit / DC unit
  qvis   = minimum distinguishable length in DC-units

Are there at least two visually distinguishable line-widths?
if (numlw = 1)              or
   (maxlw <= 1.02 * minlw)  or
   (maxlw-minlw < qvis)    then
   only one distinguishable:
   tstlw1 = first linewidth to be tested = maxlw
   tstlw2 =  last linewidth to be tested = tstlw1
   mult = 2
else
   tstlw1 = first linewidth to be tested = minlw
   tstlw2 =  last linewidth to be tested = maxlw
   if (numlw = 0) then
      continuous range of linewidths available - take 4 geometric steps
      mult = 0.9999 * ((tstlw2/tstlw1) ** 0.25)
   else
      discrete set of linewidths available - test min/max only
      mult = 0.9999 * (tstlw2/tstlw1)
   endif
endif

numpas = 0 = number of tests passed so far
thislw = tstlw1

loop thru various linewidths
next_lw:
OPQA/VARIOUS LINEWIDTH SCALE FACTORS: invoke SHOWLW subroutine to
  test requested line width = thislw
        expected line width = thislw
if abort indicated
   if (numpas < 2) then
      message about linewidth too big for the screen
      goto min_max_coerce
   else
      goto do_test_msg
   endif
elseif failure indicated
   numpas = 0
   goto do_tst_msg
endif

numpas = numpas+1
set up for next linewidth to be tested:
thislw = thislw * mult
if thislw <= tstlw2 goto next_lw

do_tst_msg:

TEST: #SR 3 13 14 15
      "Available linewidth scale factors should control the
       realized thickness of a polyline."
pass/fail depending on (numpas > 0)

min_max_coerce:

TEST: #SR 3 13 14 16
      "A requested positive linewidth scale factor below the
       minimum available should be realized as the minimum."
OPQA/POSITIVE LINEWIDTH BELOW MINIMUM: invoke subroutine SHOWLW
  to test requested line width = minlw/2
           expected line width = minlw
pass/fail depending on return code from SHOWLW

TEST: #SR 3 13 14 16
      "A requested negative linewidth scale factor should be
       realized as the minimum."
OPQA/NEGATIVE LINEWIDTH: invoke subroutine SHOWLW to test
  requested line width = -maxlw-100
   expected line width = minlw
pass/fail depending on return code from SHOWLW

OPQA/POSITIVE LINEWIDTH ABOVE MAXIMUM: invoke subroutine SHOWLW
  to test requested line width = maxlw*2
           expected line width = maxlw
if abort indicated
   message about marker size too big for the screen
else
   TEST: #SR 3 13 14 16
         "A requested linewidth scale factor above the maximum
          available should be realized as the maximum."
   pass/fail depending on return code from SHOWLW
endif

*** *** ***   3. polyline color index

TEST: #SR 3 19 20 21
      "A defined polyline color index should cause the addressed
       entry in the color table to be used when rendering a
       polyline."

bckcol = background color = realized color spec for entry #0
forcol = foreground color = realized color spec for entry #1

szcolt = maximum size of color table (including entry #0)
numlin = number of lines to be drawn = min(8, szcolt)
lncol  = random permutation of #0,#1, and numlin-2 random choices
         from entries #2 to #szcolt-1
visdx = from lncol, randomly select an entry to be made visible
        but not the one that contains 0, since this may not be
        re-settable.

for ix = 1 to numlin
   set entry lncol(ix) to bckcol
   draw line #ix with polyline colour index = lncol(ix), and label it
next ix

set entry lncol(visdx) to forcol

OPQA/DEFINED POLYLINE COLOR INDICES: which line is visible?
pass/fail depending on (response = line colored by visdx)

end_def_col:

TEST: #SR 3 19 20 22
      "An undefined polyline color index should cause entry
       number 1 in the color table to be used when rendering a
       polyline."

set entry #1 in color table opposite from BCKCOL
set entry #1 different from FORCOL - make sure undefined default
  to *current* color-rep of #1, not just a predefined color.

u1,u2,u3 = 3 undefined, positive color indices - all greater
  than maximum defined entry in color table
explct = number of explicit lines of color #1 = random integer
   from 0 to 4

draw star with color #1

display interleaved:
  three lines of color u1,u2,u3,
  explct lines of color #1

OPQA/UNDEFINED POLYLINE COLOR INDICES: How many of the horizontal
  lines are the same color as the star?
pass/fail depending on response = 3+explct

END PROGRAM 2