![]() |
![]() |
![]() |
![]() |
![]() |
The statement denotes branching of test behavior due to the reception and handling of communication and/or timer events and/or the termination of parallel test components. The individual alternatives (or branches) begin with a Boolean guard enabling or disabling the alternative (default is true), continue with an event or ââ¬Åreceiving operationââ¬ï¿½, which can be successful or unsuccessful ("condition") and end by an optional statement block.
Related keywords:
alt {
|
The alt keyword introduces the branching definition.
Each alternative begins with an optional guard_expression with the following options:
else keyword. The statement_block will always be executed. No condition may appear in the branch.
condition may be a communication or a timer event or the termination of a parallel test component. The following operations may be written here: receive, trigger, getcall, getreply, catch, check, timeout and done.
The optional statement_block contains one or more statements separated by semicolons. When empty, the curly brackets must be written.
... indicates that several branches may occur in the alt body. There is no separator between them.
Example:
alt {
[] L1_PCO.receive { setverdict(pass) }
[x<=1] L2_PCO.receive { setverdict(inconc) }
[else] { setverdict(fail); stop }
};
The first branch is activated if a message has been received on port L1_PCO. The verdict is set to pass. The second branch is activated if a message has been received on port L2_PCO and the variable x is not grater then one. In this case the verdict is set to inconclusive. The last branch is activated if none of the ports has received a messages. The verdict is set to fail and test execution is stopped.
BNF definition of alt