1 /******************************************************************************
2 * Copyright (c) 2000-2016 Ericsson Telecom AB
3 * All rights reserved. This program and the accompanying materials
4 * are made available under the terms of the Eclipse Public License v1.0
5 * which accompanies this distribution, and is available at
6 * http://www.eclipse.org/legal/epl-v10.html
9 * Adrien Kirjak – initial implementation
12 ** @purpose 1:22.2.2, lazy variable in index redirect
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
16 // The following requirements are tested:
17 // If a variable referenced in the value, sender or @index clause is a lazy or fuzzy
18 // variable, the expression assigned to this variable is equal to the result produced
19 // by the receive operation i.e. later evaluation of the lazy or fuzzy variable does not
20 // lead to repeated invocation of the receive operation.
22 module Sem_220202_ReceiveOperation_026 {
25 } with {extension "internal"}
27 type component GeneralComp {
31 testcase TC_Sem_220202_ReceiveOperation_026() runs on GeneralComp {
32 var @lazy integer v_int;
34 connect(self:p[1], self:p[1]);
40 any from p.receive(integer:?) -> @index v_int;
42 if (v_int == 1) { // evaluation of @lazy (receive shall not be called again)
44 [] p[1].receive(integer:2) { setverdict(pass); }
45 [] any from p.receive { setverdict(fail); }
53 execute(TC_Sem_220202_ReceiveOperation_026(), 5.0);