VAR, ARRAY and STR <expected> Parameter

Ada Test Script Language

Purpose

In conjunction with the VAR, ARRAY and STR keywords, the <expected value> parameters for Ada specify the expected value of a variable.

Syntax

EV = <exp>

EV = <exp> , DELTA = <delta>

MIN = <exp>, MAX = <exp>

EV IN ( <exp>, <exp>, ... )

EV ( <variable> ) IN ( <exp>, <exp>, ... )

EV = INIT

EV ==

where:

Description

The EV expressions are used to specify a test criteria by comparison with the value of a variable. The test is considered Passed when the actual value matches the <expected value> expression.

The EV value is calculated during the preprocessing phase, not dynamically during test execution.

An acceptable tolerance <delta> can be expressed:

Expected values can be expressed in the following ways:

Expressions

The initialization expressions <exp> can be among any of the following values:

Additional Rules

EV with DELTA is only allowed for numeric variables. The STR statement does not support DELTA.

MIN = <exp> and MAX = <exp> are only allowed for alphanumeric variables that use lexicographical order for characters and character strings.

MIN = <exp> and MAX = <exp> are not allowed for pointers.

Only EV = and EV == are allowed for structured variables.

In some cases, in order to avoid generated code compilation warnings, the word CAST must be inserted before the NIL or NONIL keywords.

Example

VAR x, ..., EV = pi/4-1

VAR y[4], ..., EV IN (0, 1, 2, 3 )

VAR y[5], ..., EV(y[4]) IN ) (10, 11, 12, 13 )

VAR z.field, ..., MIN = 0, MAX = 100

VAR p->value, ..., EV ==

ARRAY y[0..100], ..., EV = cos(I)

ARRAY y, ..., EV = (50=>10,others=>0)

STR z, ..., EV = (0, "", NIL)

STR *p, ..., EV = (value=>4.9, valid=>1)

 

Related Topics

VAR, ARRAY and STRVAR, ARRAY and STR <expected> ParameterVAR, ARRAY and STR <variable> Parameter