conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 22_communication_operations / 2203_procedure_based_communication / 220302_getcall_operation / NegSem_220302_GetcallOperation_007.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 for multi-D arrays requires arrays of correct size
13 ** @verdict pass reject
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 NegSem_220302_GetcallOperation_007 {
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 port P p[c_portCount][c_portCount];
32 }
33
34 function f() runs on GeneralComp
35 {
36 var integer v_index[1], v_parValue;
37 var GeneralComp v_src;
38 alt
39 {
40 [] any from p.getcall(S:{p_par := (0..c_portCount)}) -> sender v_src @index v_index {
41 if(v_index[0] == 1 and v_index[1] == 2 and v_parValue == v_index[0] + 1){
42 setverdict(pass);
43 } else {
44 setverdict(fail, "Indices or parameter value incorrectly assigned");
45 }
46 }
47 [else] { setverdict(fail, "The any from getcall operation didn't match for some reason"); }
48 }
49 }
50
51
52 testcase TC_NegSem_220302_GetcallOperation_007() 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_NegSem_220302_GetcallOperation_007(), 5.0);
66 }
67 }
This page took 0.035694 seconds and 5 git commands to generate.