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:20.5.1, verify that default processing order is correct
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
16 // The following requirement is tested:
17 // For each test component the defaults, i.e. activated altsteps, are stored as an ordered
18 // list. The defaults are listed in the reversed order of their activation i.e. the last
19 // activated default is the first element in the list of active defaults.
21 // The default mechanism is evoked at the end of each alt statement, if due to the
22 // actual snapshot none of the specified alternatives could be executed. An evoked
23 // default mechanism invokes the first altstep in the list of defaults, i.e. the last
24 // activated default, and waits for the result of its termination. The termination can
25 // be successful or unsuccessful.
27 // In the case of a successful termination, the default ... the main control flow of the
28 // test component will continue immediately after the alt statement from which the default
29 // mechanism was called...
32 // In this test case, two altsteps are activated as defaults. The sooner activated
33 // default leads to a test case failure, but because the last activated default takes
34 // precedence, it should never happen.
36 module Sem_200501_the_default_mechanism_004 {
40 } with {extension "internal"}
42 type component GeneralComp {
46 altstep a1() runs on GeneralComp {
47 [] p.receive(integer:?) {
48 setverdict(fail, "First default");
52 altstep a2() runs on GeneralComp {
53 [] p.receive(integer:?) {
54 setverdict(pass, "Last default");
58 testcase TC_Sem_200501_the_default_mechanism_004() runs on GeneralComp {
62 connect(self:p, self:p);
66 [] p.receive(integer:0) { // not expected: leads to default invocation
73 execute(TC_Sem_200501_the_default_mechanism_004());