conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 20_statement_and_operations_for_alt / 2005_default_handling / 200503_the_deactivate_operation / Sem_200503_the_deactivate_operation_002.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:20.5.1, verify that deactivate removes default from list of defaults
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 // The following requirement is tested:
17 // A deactivate operation will remove the referenced default from the list of defaults.
18
19 // Note:
20 // The test verifies syntactical variant with a function instance passed as a parameter
21 // to the deactivate operation.
22
23 module Sem_200503_the_deactivate_operation_002 {
24
25 type port P message {
26 inout integer;
27 } with {extension "internal"}
28
29 type component GeneralComp {
30 port P p;
31 }
32
33 altstep a1() runs on GeneralComp {
34 [] p.receive(integer:?) {
35 setverdict(pass);
36 }
37 }
38
39 altstep a2() runs on GeneralComp {
40 [] p.receive(integer:?) {
41 setverdict(fail, "Deactivated"); // should be deactivated at the time of default processing
42 }
43 }
44
45 function f(default p_default) return default {
46 return p_default;
47 }
48
49 testcase TC_Sem_200503_the_deactivate_operation_002() runs on GeneralComp {
50 var default v_default;
51 activate(a1());
52 v_default := activate(a2());
53
54 connect(self:p, self:p);
55 p.send(integer:1);
56
57 deactivate(f(v_default));
58
59 alt {
60 [] p.receive(integer:0) { // not expected: leads to default invocation
61 setverdict(fail);
62 }
63 }
64 }
65
66 control{
67 execute(TC_Sem_200503_the_deactivate_operation_002());
68 }
69 }
This page took 0.033331 seconds and 5 git commands to generate.