Design: 11/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: Packing and unpacking

CHARACTERISTICS: nnnn

OPERATOR SCRIPT: passive test.

DESIGN:

data record to hold:
   drinin = 77, 32, -64, 286
   drinrl = 9.9, -4.88, 1e12
   drinst = "This string is to test pack and unpack", "THis is another"

TEST: #SR 1
      "<Pack data record> should report successful packing of
       valid data."
<pack data record> with drinin, drinrl, drinst
if (no error reported) then
   pass
else
   fail
   message about skipping test, error code
   goto done
endif

TEST: #SR 1 2
      "Unpacking a packed data record should return the original data."
<unpack data record> to determine
   drotin = array with integer entries
   drotrl = array with real entries
   drotst = array with character string entries

if (no error reported) then
   OK so far
else
   fail
   message about error code
   goto done
endif

if (array sizes OK) then
   OK so far
else
   fail
   message: Array sizes from PUREC are incorrect.
   goto done
endif

if (integer array contents OK) then
   OK so far
else
   fail
   message: Integer array from PUREC is incorrect.
   goto done
endif

if (real array contents OK) then
   OK so far
else
   fail
   message: Real array from PUREC is incorrect.
   goto done
endif

if (string length array contents OK) then
   OK so far
else
   fail
   message: String-length array from PUREC is incorrect.
   goto done
endif

if (string array contents OK) then
   OK so far
else
   fail
   message: String array from PUREC is incorrect.
   goto done
endif

pass

done:

END PROGRAM 1