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 that any from getcall index redirection works for multidimensional arrays
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15 // The following requirements are tested:
17 // If the index redirection is used for multi-dimensional component arrays, the size
18 // of the integer array or record of integer type shall exactly be the same as the dimension
19 // of the respective array, and its type shall allow storing the highest index (from all
20 // dimensions) of the array.
21 module Sem_220302_GetcallOperation_011 {
23 signature S(integer p_par);
25 type port P procedure {
27 } with {extension "internal"}
29 const integer c_portCount := 3;
30 type component GeneralComp
32 port P p[c_portCount][c_portCount];
35 function f() runs on GeneralComp
37 var integer v_index[2], v_parValue;
38 var GeneralComp v_src;
41 [] any from p.getcall(S:{p_par := (0..c_portCount)}) -> param (v_parValue := p_par) sender v_src @index v_index {
42 if(v_index[0] == 1 and v_index[1] == 2 and v_parValue == v_index[0] + 1){
45 setverdict(fail, "Indices or parameter value incorrectly assigned");
48 [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); }
52 testcase TC_Sem_220302_GetcallOperation_011() runs on GeneralComp system GeneralComp {
53 var GeneralComp v_ptc := GeneralComp.create;
54 for(var integer i := 0; i < c_portCount; i := i + 1) {
55 for(var integer j := 0; j < c_portCount; j := j + 1) {
56 connect(self:p[i][j], v_ptc:p[i][j]);
57 if (i == 1 and j == 2 or i == 2 and j == 1) { p[i][j].call(S:{ p_par := i + 1 }, nowait); }
65 execute(TC_Sem_220302_GetcallOperation_011(), 5.0);