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.3.2, Verify any from getcall index redirection to lazy variable
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15 // The following requirements are tested:
17 // If a variable referenced in the @index clause is a lazy or fuzzy variable, the expression
18 // assigned to this variable is equal to the result produced by the getcall operation. Later
19 // evaluation of the lazy or fuzzy variable does not lead to repeated invocation of the
21 module Sem_220302_GetcallOperation_012 {
23 signature S(integer p_par);
25 type port P procedure {
27 } with {extension "internal"}
29 const integer c_portCount := 4;
30 type component GeneralComp
32 port P p[c_portCount];
34 function f() runs on GeneralComp
36 var @lazy integer v_index;
39 [] any from p.getcall -> @index v_index {
40 if(v_index == 1){ // no getcall call during evaluation, v_index remains equal to 1
43 setverdict(fail, "Index incorrectly assigned");
46 [else] { setverdict(fail, "The any from getcall didn't match for some reason"); }
49 testcase TC_Sem_220302_GetcallOperation_012() runs on GeneralComp system GeneralComp {
50 var GeneralComp v_ptc := GeneralComp.create;
52 for(var integer i := 0; i < c_portCount; i := i + 1) {
53 connect(self:p[i], v_ptc:p[i]);
54 if (i mod 2 > 0) { p[i].call(S:{ p_par := i + 100 }, nowait); }
62 execute(TC_Sem_220302_GetcallOperation_012(), 5.0);