conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0602_structured_types_and_values / 060212_addressing_entities_inside_sut / NegSem_060212_AddressingEntitiesInsideSut_003.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:6.2.12, Ensure that address type cannot be used in a sender part of receive operation with connected ports
13 ** @verdict pass reject
14 ***************************************************/
15
16 /* The following requirements are tested:
17 * Restrictions c) The address data type shall not be used in the to,
18 * from and sender parts of receive and send operations of connected ports,
19 * i.e, ports used for the communication among test components.*/
20
21
22 module NegSem_060212_AddressingEntitiesInsideSut_003 {
23
24 type integer MyAddress;
25 type integer MyMessType;
26 type integer address;
27
28
29 type port PortType message {
30 address MyAddress;
31 inout MyMessType;
32 } with {extension "internal"}
33
34 type component TestCaseComp {
35 port PortType p;
36 }
37
38 function Sendmessage() runs on TestCaseComp
39 {
40 if(p.checkstate("Connected")) {
41 p.send(MyMessType: 1) to mtc;
42 } else {
43 setverdict(fail,"Not connected");
44 }
45 }
46
47
48
49 testcase TC_NegSem_060212_AddressingEntitiesInsideSut_003() runs on TestCaseComp system TestCaseComp {
50
51 var TestCaseComp v_ptcA := TestCaseComp.create alive;
52
53 var address MyAddr := 1;
54
55 connect(mtc:p, v_ptcA:p);
56
57 v_ptcA.start(Sendmessage());
58
59
60 p.receive(MyMessType:1) -> sender MyAddr; //error: address type is allowed in sender part receive operation
61
62 setverdict(pass);
63 }
64
65 control {
66 execute(TC_NegSem_060212_AddressingEntitiesInsideSut_003());
67 }
68 }
This page took 0.035818 seconds and 5 git commands to generate.