Titan



interleave


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 sequence of the events does not matter. The individual alternatives (or branches) contain an event or "receiving operation", which can be successful or unsuccessful ("condition") and end by an optional statement block.

Opposed to alt statement, where only a single alternative is taken, all branches of the interleave statement must "happen".

Related keyword:


interleave {
    []
[condition] { [statement_block] }
   
...
};
 


Example:

interleave { 
   [] L1_PCO.receive   (tr_Sig1)
     { 
         L1_PCO.send   (t_Sig2);
         L1_PCO.receive(tr_Sig3)
     } 
   [] L2_PCO.receive   (tr_Sig4) 
     { 
         L2_PCO.send   (t_Sig5);
         L2_PCO.receive(tr_Sig6);
         L2_PCO.send   (t_Sig7)
     } 
};

The reception events on ports L1_PCO and L2_PCO may happen in arbitrary order. The possible orderings of incoming messages are:

tr_Sig1, tr_Sig3, tr_Sig4, tr_Sig6
tr_Sig1, tr_Sig4, tr_Sig3, tr_Sig6
tr_Sig1, tr_Sig4, tr_Sig6, tr_Sig3
tr_Sig4, tr_Sig1, tr_Sig3, tr_Sig6
tr_Sig4, tr_Sig1, tr_Sig6, tr_Sig3
tr_Sig4, tr_Sig6, tr_Sig1, tr_Sig3



BNF definition of interleave