conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 22_communication_operations / 2202_message_based_communication / 220201_send_operation / NegSem_220201_SendOperation_005.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, missing to clause in case of one-to-many connections
13 ** @verdict pass reject
14 *****************************************************************/
15
16 // The following requirements are tested:
17 // Unicast, multicast and broadcast communication can be determined by the optional to clause
18 // in the send operation. A to clause can be omitted in case of a one-to-one connection where
19 // unicast communication is used and the message receiver is uniquely determined by the test
20 // system structure.
21 // A to clause shall be present in case of one-to-many connections.
22
23 module NegSem_220201_SendOperation_005 {
24
25 type port P message {
26 inout integer;
27 } with {extension "internal"}
28
29 type component GeneralComp
30 {
31 port P p;
32 }
33
34 function f(integer p_expected) runs on GeneralComp
35 {
36 alt {
37 [] p.receive(p_expected) { setverdict(pass); }
38 [] p.receive { setverdict(fail); }
39 }
40 }
41
42 const integer c_ptcCount := 2;
43
44 testcase TC_NegSem_220201_SendOperation_005() runs on GeneralComp system GeneralComp {
45 var GeneralComp v_ptcs[c_ptcCount];
46
47 for (var integer i := 0; i < c_ptcCount; i := i + 1) {
48 v_ptcs[i] := GeneralComp.create;
49 connect(self:p, v_ptcs[i]:p);
50 v_ptcs[i].start(f(0));
51 }
52
53 p.send(0);
54 all component.done;
55 setverdict(pass);
56 }
57
58 control {
59 execute(TC_NegSem_220201_SendOperation_005(), 5.0);
60 }
61 }
This page took 0.034302 seconds and 5 git commands to generate.