conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 22_communication_operations / 2202_message_based_communication / 220201_send_operation / Sem_220201_SendOperation_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.2.1, broadcast send operation
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 // The following requirements are tested:
17 // Broadcast is defined by using the to clause with all component keyword.
18
19 module Sem_220201_SendOperation_007 {
20
21 type port P message {
22 inout integer;
23 } with {extension "internal"}
24
25 type component GeneralComp
26 {
27 port P p;
28 }
29
30 function f(integer p_expected) runs on GeneralComp
31 {
32 alt {
33 [] p.receive(p_expected) { setverdict(pass); }
34 [] p.receive { setverdict(fail); }
35 }
36 }
37
38 const integer c_ptcCount := 3;
39
40 testcase TC_Sem_220201_SendOperation_007() runs on GeneralComp system GeneralComp {
41 var GeneralComp v_ptcs[c_ptcCount];
42
43 for (var integer i := 0; i < c_ptcCount; i := i + 1) {
44 v_ptcs[i] := GeneralComp.create;
45 connect(self:p, v_ptcs[i]:p);
46 v_ptcs[i].start(f(0));
47 }
48
49 p.send(0) to all component;
50 all component.done;
51 setverdict(pass);
52 }
53
54 control {
55 execute(TC_Sem_220201_SendOperation_007(), 5.0);
56 }
57 }
This page took 0.032263 seconds and 5 git commands to generate.