Initializing without testing

Component Testing for Ada

It is sometimes difficult to predict the expected result for a variable; such as if a variable holds the current date or time. In this case, you might want to avoid specifying an expected output but still have the value of the variable initialized in the test script. To do this, use the EV == syntax.

Example

In the following script a, b, and c are initialized, but only a and b are tested.

TEST 7

FAMILY nominal

ELEMENT

VAR a, init in (1,2,3), ev = init

VAR b, init = 3, ev = init

VAR c, init = 0, ev ==

#c = add(a,b);

END ELEMENT

END TEST

Related Topics

Testing variables | Testing intervals | Testing expressions |