Titan



alt


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 {
    [
[guard_expression] ] [condition] { [statement_block] }
   
...
};
 


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