conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 22_communication_operations / 2203_procedure_based_communication / 220302_getcall_operation / Sem_220302_GetcallOperation_011.ttcn
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
7 *
8 * Contributors:
9 * Adrien Kirjak – initial implementation
10 *
11 ** @version 0.0.1
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:
16 // Restriction j:
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 {
22
23 signature S(integer p_par);
24
25 type port P procedure {
26 inout S;
27 } with {extension "internal"}
28
29 const integer c_portCount := 3;
30 type component GeneralComp
31 {
32 port P p[c_portCount][c_portCount];
33 }
34
35 function f() runs on GeneralComp
36 {
37 var integer v_index[2], v_parValue;
38 var GeneralComp v_src;
39 alt
40 {
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){
43 setverdict(pass);
44 } else {
45 setverdict(fail, "Indices or parameter value incorrectly assigned");
46 }
47 }
48 [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); }
49 }
50 }
51
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); }
58 }
59 }
60 v_ptc.start(f());
61 v_ptc.done;
62 }
63
64 control {
65 execute(TC_Sem_220302_GetcallOperation_011(), 5.0);
66 }
67 }
This page took 0.055631 seconds and 5 git commands to generate.