No Test

Component Testing for Ada

You can only initialize and test records with the following forms:

  • INIT =

  • INIT ==

  • EV =

  • EV ==

If a field of a structured variable needs to be initialized or tested in a different way, you can omit its initial and expected values from the global test of the structured variable, and run a separate test on this field.

The following example illustrates this:

TEST 4

FAMILY nominal

ELEMENT

VAR l, init = NIL, ev = NONIL

VAR l.all, init == , ev = (next=>NIL,prev=>NIL)

VAR s, init in ("foo","bar"), ev = init

VAR l.str, init ==, ev(s) in ("foo","bar")

#push(l,s);

END ELEMENT

END TEST

Related Topics

Testing Records | Testing a Record with Ada Expressions | Testing a Record with Another Record | Testing Records with Discriminants | Testing Tagged Records