conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 20_statement_and_operations_for_alt / 2003_the_repeat_statement / Sem_2003_the_repeat_statement_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:20.2, repeat in alstep branch of alt statements
13 ** @verdict pass accept, ttcn3verdict:pass
14 *****************************************************************/
15
16 // The following requirement is tested:
17 // If a repeat statement is used in a top alternative in an altstep definition,
18 // it causes a new snapshot and the re-evaluation of the alt statement from
19 // which the altstep has been called. The call of the altstep may either be
20 // done implicitly by the default mechanism (see clause 20.5.1) or explicitly
21 // in the alt statement (see clause 20.2).
22
23 module Sem_2003_the_repeat_statement_003 {
24
25 type port MyPort message {
26 inout charstring;
27 } with {extension "internal"}
28
29 type component GeneralComp {
30 port MyPort p;
31 }
32
33 altstep a_receiveAny() runs on GeneralComp {
34 [] p.receive(charstring:?) {
35 repeat;
36 }
37 }
38
39 testcase TC_Sem_2003_the_repeat_statement_003() runs on GeneralComp {
40
41 connect(self:p, self:p);
42 p.send(charstring:"foo");
43 p.send(charstring:"bar");
44
45 alt {
46 [] p.receive(charstring:"bar") {
47 setverdict(pass);
48 }
49 [] a_receiveAny();
50 }
51 }
52
53 control {
54 execute(TC_Sem_2003_the_repeat_statement_003());
55 }
56 }
This page took 0.036515 seconds and 5 git commands to generate.