conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 21_configuration_operations / 2101_connection_operations / 210102_disconnect_and_unmap_operations / Sem_210102_disconnect_and_unmap_operations_008.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:21.1.2, Ensure that unmap operation with no parameters works correctly
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 // The following requirements are tested:
17 // The usage of an ... unmap operation without any parameters is a shorthand
18 // form for using the operation with the parameter self:all port. It ...
19 // unmaps all ports of the component that calls the operation.
20
21 module Sem_210102_disconnect_and_unmap_operations_008 {
22
23 type port P message {
24 inout integer
25 } with {extension "internal"}
26
27 type component GeneralComp
28 {
29 port P p1, p2;
30 }
31
32 function checkPortMapped(boolean p_stateActive, P p_port)
33 {
34 if(p_port.checkstate("Mapped") xor not p_stateActive) {
35 setverdict(pass);
36 } else {
37 setverdict(fail);
38 }
39 }
40 function checkMapped(boolean p_stateActive) runs on GeneralComp
41 {
42 checkPortMapped(p_stateActive, p1);
43 checkPortMapped(p_stateActive, p2);
44 }
45
46 testcase TC_Sem_210102_disconnect_and_unmap_operations_008() runs on GeneralComp system GeneralComp {
47 var GeneralComp v_ptc1 := GeneralComp.create;
48
49 map(self:p1, system:p1);
50 map(self:p2, system:p2);
51 map(v_ptc1:p1, system:p1);
52 map(v_ptc1:p2, system:p2);
53
54 unmap;
55
56 // verity that ports are really unmapped
57 checkMapped(false); // no active mapping
58 v_ptc1.start(checkMapped(true)); // still mapped to system:p1 and system:p2
59 all component.done;
60 }
61 control{
62 execute(TC_Sem_210102_disconnect_and_unmap_operations_008());
63 }
64 }
65
This page took 0.033409 seconds and 5 git commands to generate.