conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 22_communication_operations / 2202_message_based_communication / 220203_trigger_operation / Sem_220203_TriggerOperation_020.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.2.3, single dimensional index redirect in any from port.trigger statement
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 // The following requirements are tested:
17 // It is also possible to store the index of a port in a single-dimensional port array
18 // at which the operation was successful to a variable of type integer or, in case of
19 // multi-dimensional port arrays the index of the successful port to an integer array
20 // or record of integer variable. When checking the port array for matching messages,
21 // the port indices to be checked are iterated from lowest to highest. If the port
22 // array is multi-dimensional, then the ports are iterated over from innermost to
23 // outermost array dimension from lowest to highest index for each dimension, e.g.
24 // [0][0], [0][1], [1][0], [1][1]. The first port which matches all the criteria will
25 // cause the operation to be successful even if other ports in the array would also
26 // meet the criteria.
27
28 module Sem_220203_TriggerOperation_020 {
29
30 type port P message {
31 inout integer;
32 } with {extension "internal"}
33
34 type component GeneralComp
35 {
36 port P p [3];
37 port P altP;
38 }
39
40 testcase TC_Sem_220203_TriggerOperation_020() runs on GeneralComp {
41 var integer v_index;
42
43 connect(self:p[2], self:p[2]);
44 connect(self:altP, self:altP);
45 p[2].send(10);
46 altP.send(1);
47
48 alt {
49 [] any from p.trigger(integer:?) -> @index v_index {
50 if (v_index == 2) { setverdict(pass); }
51 else { setverdict(fail); }
52 }
53 [] any port.receive { setverdict(fail); }
54 }
55 }
56
57 control {
58 execute(TC_Sem_220203_TriggerOperation_020(), 5.0);
59 }
60 }
This page took 0.038546 seconds and 5 git commands to generate.