Variable expected value expressions
The expected expressions are used to specify a test criteria by comparison with the value of a variable. The test receives a passed verdict when the actual obtained value matches the expected value expression.
- Numeric (integer or floating-point), character, or character string literal values. Strings can be delimited by single or double quotes.
- Native constants, which can be numeric, characters, or character strings.
- Ranges with lower and upper values and inclusive or exclusive bounds.
- Global variables that are declared by the program under test.
- A null pointer or a non-null pointer.
- Arrays and structures, any of the above-mentioned expressions between braces ('{}').
- C functions or expressions with one or more of the above elements combined using any operators and casting, with all required levels of parentheses. The + operator allows to concatenate character string variables.
- No Check, which specifies that no check is performed on that variable.
- Same As Init, which specifies that the expected variable equals the initialization expression.
- Data sets that are synchronized with a multiple initialization expression.
The data type of the variable defines the acceptable values for the expected value.
Numeric values can be associated with a comparison operator in the test case editor.
Expected expressions can be synchronized, which means that a list of multiple values for one variable will be synchronized with a matching number of values for another variable. See Synchronizing multiple values for more information.
Additional notes
- hex_integerH for hexadecimal values. In this case, the integer must be preceded by 0 if it begins with a letter.
- binary_integerB for hexadecimal values.
Ranges are not allowed for pointers.
The number of values inside an expected expression is limited to 100 elements in a single variable.
If variables are used in the expected expression, the test evaluates the initialization value with variable values from after the execution.
- -(9/2) returns -4
- -9/2 returns -5