Design: 04.02.01.01/P03
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 3: Combinations 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.
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:
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)
call DISCOL to set distinct foreground colors in color table.
*** *** *** 1. linetype
call NDLW to set linewidth to a non-default value, preferably
half the distance between lines to be displayed
Display in random order all linetypes in lavslt,
with colors drawn randomly from foreground colors
TEST: #SR 3 4 5 6 8
"The mandatory linetypes (1-4) should be recognizable from
their standard description, even when a non-default
linewidth or color is used."
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
call NDLW to set linewidth to a non-default value, preferably
half the distance between lines to be displayed
Display in random order linetypes from lunsup,
with colors drawn randomly from foreground colors
TEST: #SR 3 4 5 6 7 8
"Unavailable linetypes should be displayed as linetype
number 1, even when a non-default linewidth or color is
used."
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
call NDLW to set linewidth to a non-default value, preferably
half the distance between lines to be displayed
Display in order and label all linetypes in lindis,
with colors drawn randomly from foreground colors
TEST: #SR 3 4 5 6 9
"The registered non-mandatory linetypes (> 4) should
agree with their registered description, even when a
non-default linewidth or color is used."
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
call NDLW to set linewidth to a non-default value, preferably
half the distance between lines to be displayed
Display in order and label all linetypes in lindis,
with colors drawn randomly from foreground colors
TEST: #SR 3 4 5 6 10
"Implementor-defined linetypes (< 1) should agree with the
descriptions supplied by the implementor, even when a
non-default linewidth or color is used."
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")
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:
ndlnst = randomly selected linestyle
plcol = randomly selected color index
OPQA/VARIOUS LINEWIDTH SCALE FACTORS: invoke SHOWLW subroutine to
test requested line width = thislw
expected line width = thislw
linestyle = ndlnst
color index = plcol
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, even when a non-default
linetype or color is used."
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, even
when a non-default linetype or color is used."
ndlnst = randomly selected linestyle
plcol = randomly selected color index
OPQA/POSITIVE LINEWIDTH BELOW MINIMUM: invoke subroutine SHOWLW
to test requested line width = minlw/2
expected line width = minlw
linestyle = ndlnst
color index = plcol
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, even when a non-default linetype
or color is used."
ndlnst = randomly selected linestyle
plcol = randomly selected color index
OPQA/NEGATIVE LINEWIDTH: invoke subroutine SHOWLW to test
requested line width = -maxlw-100
expected line width = minlw
linestyle = ndlnst
color index = plcol
pass/fail depending on return code from SHOWLW
ndlnst = randomly selected linestyle
plcol = randomly selected color index
OPQA/POSITIVE LINEWIDTH ABOVE MAXIMUM: invoke subroutine SHOWLW
to test requested line width = maxlw*2
expected line width = maxlw
linestyle = ndlnst
color index = plcol
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, even when a
non-default linetype or color is used."
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, even when a non-default linetype or linewidth is
used."
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.
call NDLW to set linewidth to a non-default value, preferably
half the distance between lines to be displayed
for ix = 1 to numlin
set entry lncol(ix) to bckcol
draw line #ix with polyline colour index = lncol(ix), and label it,
using linetype = random choice from lavslt,lavrlt,lavilt
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, even when a non-default linetype or linewidth is
used."
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
call NDLW to set linewidth to a non-default value, preferably
half the distance between lines to be displayed
display interleaved:
three lines of color u1,u2,u3,
explct lines of color #1, for each using linetype = random
choice from lavslt,lavrlt,lavilt
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 3