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.2.3, single dimensional index redirect in any from port.trigger statement
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
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
28 module Sem_220203_TriggerOperation_020 {
32 } with {extension "internal"}
34 type component GeneralComp
40 testcase TC_Sem_220203_TriggerOperation_020() runs on GeneralComp {
43 connect(self:p[2], self:p[2]);
44 connect(self:altP, self:altP);
49 [] any from p.trigger(integer:?) -> @index v_index {
50 if (v_index == 2) { setverdict(pass); }
51 else { setverdict(fail); }
53 [] any port.receive { setverdict(fail); }
58 execute(TC_Sem_220203_TriggerOperation_020(), 5.0);