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:21.1.2, Ensure that unmap operation with no parameters works correctly
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
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.
21 module Sem_210102_disconnect_and_unmap_operations_008 {
25 } with {extension "internal"}
27 type component GeneralComp
32 function checkPortMapped(boolean p_stateActive, P p_port)
34 if(p_port.checkstate("Mapped") xor not p_stateActive) {
40 function checkMapped(boolean p_stateActive) runs on GeneralComp
42 checkPortMapped(p_stateActive, p1);
43 checkPortMapped(p_stateActive, p2);
46 testcase TC_Sem_210102_disconnect_and_unmap_operations_008() runs on GeneralComp system GeneralComp {
47 var GeneralComp v_ptc1 := GeneralComp.create;
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);
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
62 execute(TC_Sem_210102_disconnect_and_unmap_operations_008());