Design: 04.02.03.01/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: Element creation and inquiring

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

Use <inquire current element content> throughout to determine:
    celval = current element value as set by program
    recval = auxiliary element values implied by the standard's
             representation conventions.

Use <inquire current element type and size> throughout to determine:
    celsiz = current element size

*** *** *** *** ***   Text font   *** *** *** *** ***
<set text font>:
    text_font = 33

TEST: #SR 9 12
      "<Inquire current element type and size> should return
       text font as the type of the created element and
       the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = text font and
    celsiz = values specified by the standard)

TEST: #SR 10 12
      "<Inquire current element content> should return the standard
       representation for the text font value."
<inquire current element content> for current element representation
pass/fail depending on
  (celval = 33 and
   recval = auxiliary values specified by the standard)

*** *** *** *** ***   Text precision   *** *** *** *** ***
<set text precision>:
    text_precision = STROKE

TEST: #SR 9 25
      "<Inquire current element type and size> should return
       text precision as the type of the created element
       and the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = text precision and
    celsiz = values specified by the standard)

TEST: #SR 10 25 26
      "<Inquire current element content> should return the standard
       representation for all valid text precision values."

for txprec = STRING, CHAR, and STROKE
   <set text precision> with text_precision = txprec
   <inquire current element content> for current element representation
   if (celval = txprec and
       recval = auxiliary values specified by the standard)
       OK so far
   else
      fail
      informative message on txprec
      goto doneprec
   endif
next txprec

pass

doneprec:

*** *** *** *** ***   Character expansion   *** *** *** *** ***
<set character expansion>:
    character_expansion = 0.40

TEST: #SR 9 34
      "<Inquire current element type and size> should return
       character expansion as the type of the created element
       and the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = character expansion and
    celsiz = values specified by the standard)

TEST: #SR 10 34
      "<Inquire current element content> should return the standard
       representation for the character expansion value."
<inquire current element content> for current element representation
pass/fail depending on
  (celval = 0.40 and
   recval = auxiliary values specified by the standard)

*** *** *** *** ***   Character spacing   *** *** *** *** ***
<set character spacing>:
    character_spacing = 0.25

TEST: #SR 9 40
      "<Inquire current element type and size> should return
       character spacing as the type of the created element
       and the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = character spacing and
    celsiz = values specified by the standard)

TEST: #SR 10 40
      "<Inquire current element content> should return the standard
       representation for the character spacing value."
<inquire current element content> for current element representation
pass/fail depending on
  (celval = 0.25 and
   recval = auxiliary values specified by the standard)

*** *** *** *** ***   Text colour index   *** *** *** *** ***
<set text colour index>:
    text_colour_index = 2

TEST: #SR 9 46
      "<Inquire current element type and size> should return
       text colour index as the type of the created element
       and the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = text colour index and
    celsiz = values specified by the standard)

TEST: #SR 10 46
      "<Inquire current element content> should return the standard
       representation for the text colour index value."
<inquire current element content> for current element representation
pass/fail depending on
  (celval = 2 and
   recval = auxiliary values specified by the standard)

*** *** *** *** ***   Character height   *** *** *** *** ***
<set character height>:
    character_height = 0.35

TEST: #SR 9 52
      "<Inquire current element type and size> should return
       character height as the type of the created element
       and the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = character height and
    celsiz = values specified by the standard)

TEST: #SR 10 52
      "<Inquire current element content> should return the standard
       representation for the character height value."
<inquire current element content> for current element representation
pass/fail depending on
  (celval = 0.35 and
   recval = auxiliary values specified by the standard)

*** *** *** *** ***   Character up vector   *** *** *** *** ***
<set character up vector>:
    character_up_vector_x_component = 0.25
    character_up_vector_y_component = 0.13

TEST: #SR 9 79
      "<Inquire current element type and size> should return
       character up vector as the type of the created element
       and the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = character up vector and
    celsiz = values specified by the standard)

TEST: #SR 10 79
      "<Inquire current element content> should return the standard
       representation for the character up vector value."
<inquire current element content> for current element representation
pass/fail depending on
  (celval = (0.25, 0.13) and
   recval = auxiliary values specified by the standard)

*** *** *** *** ***   Text path   *** *** *** *** ***
<set text path>:
    text_path = LEFT

TEST: #SR 9 64
      "<Inquire current element type and size> should return
       text path as the type of the created element and
       the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = text path and
    celsiz = values specified by the standard)

TEST: #SR 10 64 65
      "<Inquire current element content> should return the standard
       representation for all valid text path values."

for txpath = RIGHT, LEFT, UP, and DOWN
   <set text path> with text_path = txpath
   <inquire current element content> for current element representation
   if (celval = txpath and
       recval = auxiliary values specified by the standard)
       OK so far
   else
      fail
      informative message on txpath
      goto donepath
   endif
next txpath

pass

donepath:

*** *** *** *** ***   Text alignment   *** *** *** *** ***
<set text alignment>:
    horizonal_text_alignment = CENTRE
    vertical_text_alignment  = BASE
TEST: #SR 9 72
      "<Inquire current element type and size> should return
       text alignment as the type of the created element and
       the appropriate element size."

<inquire current element type and size> for current element type and
appropriate size
pass/fail depending on
  (current_element_type = text alignment and
    celsiz = values specified by the standard)

TEST: #SR 10 72 73
      "<Inquire current element content> should return the standard
       representation for all valid text alignment values."

for txhor = NORMAL, LEFT, CENTRE, and RIGHT
for txver = NORMAL, TOP, CAP, HALF, BASE, and BOTTOM

   <set text alignment> with horizonal_text_alignment = txhor
                             vertical_text_alignment  = txver
   <inquire current element content> for current element representation
   if (celval = (txhor, txver) and
       recval = auxiliary values specified by the standard)
       OK so far
   else
      fail
      informative message on (txhor, txver)
      goto donealign
   endif
next txver
next txhor

pass

donealign:

END PROGRAM 1