conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 05_basic_language_elements / 0503_ordering_of_declarations / NegSem_0503_Ordering_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 ** @desc Test cases for clause 5.2 Scope rules
13 ** @purpose 1:5.3, Ensure that declarations are in the allowed ordering
14 ** @verdict pass reject
15 ***************************************************/
16 module NegSem_0503_Ordering_002 {
17
18 type component GeneralComp {
19 var integer vc_component := 0;
20 }
21
22 function f_function() runs on GeneralComp {
23 var integer v_function := 0;
24 }
25
26 testcase TC_NegSem_0503_Ordering_002() runs on GeneralComp {
27 if(true) {
28 var integer v_int := 0;
29 if (v_int == 0) {
30 var integer v_statement_block_1 := 0;
31 v_statement_block_1 := v_statement_block_1 + 1;
32 f_function();
33 var integer v_statement_block_2 := 0; // declaration has to go before other statements
34 }
35
36 }
37 setverdict(pass);
38 }
39
40 control {
41 var integer v_control := 0;
42 execute(TC_NegSem_0503_Ordering_002());
43 }
44
45 }
This page took 0.038132 seconds and 5 git commands to generate.