conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 21_configuration_operations / 2103_test_component_operations / 210307_done_operation / NegSem_210307_done_operation_006.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:21.3.7, Verify that any from done index redirection for multi-D arrays requires arrays
13 ** @verdict pass reject
14 *****************************************************************/
15 // The following requirements are tested:
16 // Restriction f:
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_210307_done_operation_006 {
22
23 type component GeneralComp {}
24
25 function f() runs on GeneralComp {
26 timer t := 100.0;
27 t.start;
28 t.timeout;
29 }
30
31 testcase TC_NegSem_210307_done_operation_006() runs on GeneralComp system GeneralComp {
32 const integer c_size := 3;
33 var GeneralComp v_ptc[c_size][c_size];
34 var integer v_index;
35
36 for (var integer i := 0; i < c_size; i := i + 1) {
37 for (var integer j := 0; j < c_size; j := j + 1) {
38 v_ptc[i][j] := GeneralComp.create; // created components are inactive
39 if (i mod 2 == 0 or j mod 2 == 1) { v_ptc[i][j].kill; } // kill components on even i or odd j
40 else { v_ptc[i][j].start(f());} // activate v_ptc
41 }
42 }
43
44 alt
45 {
46 [] any from v_ptc.done -> @index v_index
47 {
48 if(v_index == 1){
49 setverdict(pass);
50 } else {
51 setverdict(fail, "Invalid index value");
52 }
53 setverdict(pass);
54 }
55 [else] { setverdict(fail, "The any from done operation didn't find done components"); }
56 }
57 }
58
59 control {
60 execute(TC_NegSem_210307_done_operation_006(), 5.0);
61 }
62 }
This page took 0.032177 seconds and 5 git commands to generate.