WAITTIL

System Testing Test Script Language.

Syntax

WAITTIL (<passed_expr>, <failed_ expr>)

Description

This instruction waits for several events and/or a timer.

<passed_expr> is a parameter that contains a Boolean expression. If this expression is true, the waiting process is disabled and the test sequence continues.

<failed_ expr> is a parameter that contains a Boolean expression. If this expression is true, the waiting process is disabled and it ends with an error.

The expressions <passed_expr> and <failed_expr> can only use global variables.

When <failed_ expr> is true, the execution of the scenario containing the WAITTIL is interrupted. The next scenario at the same level is then executed.

To use this instruction, you need to take the following actions:

  1. Declare a type of communication with the COMMTYPE instruction.

    Declare a communication channel with the CHANNEL instruction.

    Declare the reference messages with the MESSAGE instruction.

    Write a callback for a non-blocking read of communication and message type.

    Define the expected values for each reference message with the DEF_MESSAGE instruction.

    Associate the identifier of a communication connection with the ADD_ID instruction.

    Use the four comparison operators, MATCHING, MATCHED, NOTMATCHING, NOTMATCHED, and the timer WTIME. Also use the && (logical and) and || (logical or) operators.

You must use a global variable to pass parameters to a WAITTIL statement, as in the following example. It does not handle PROC parameters.

Example

The following lines are from the Basestation sample application delivered with the product.

#int tt; /* global var */

PROC con (int timeout)

VAR tt, INIT=timeout;

DEF_MESSAGE mResponse, EV={command=>cmd_connection_established}

WAITTIL ( MATCHING(mResponse,BaseStation), WTIME>tt )

END PROC

Related Topics

ADD_ID | MATCHED( ) | MATCHING( ) | NOTMATCHED( ) | NOTMATCHING( ) | WTIME