Testing Pointer Variables while Preserving the Pointed Value

Component Testing for Ada

To initialize a variable as a pointer while keeping the ability to test the value of the pointed element, use the FORMAT string_ptr statement in your .ptu test script.

This allows you to initialize your variable as a pointer and still perform string comparisons using str_comp.

Example:

TEST 1

      

FAMILY nominal

  ELEMENT

    FORMAT pointer_name = string_ptr

-- Then your variable pointer_name will be first initialized as a pointer

    ....

    VAR pointer_name, INIT="l11c01pA00", ev=init

-- It is initialized as pointing to the string "l11c01pA00",

--and then string comparisons are done with the expected values using str_comp.