conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 15_templates / 1506_referencing_elements_of_templates_or_template_fields / 150603_referencing_record_of_and_set_elements / NegSem_150603_ReferencingRecordOfAndSetElements_012.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:15.6.3, Ensure that referencing uninitialized fields is not allowed.
13 ** @verdict pass reject
14 *****************************************************************/
15
16 //Restriction a) Omit: referencing an element within a record of, set of or array field to which omit is assigned shall follow the rules specified in clause 6.2.3.
17
18 /*Clause 6.2.3: If the value of the element indicated by the index at the right-hand of an assignment is undefined (uninitialized), this
19 shall cause a semantic or runtime error. Referencing an identified element of an uninitialized or omitted record of or set
20 of field or value on the right hand side of an assignment shall cause an error.*/
21
22
23 module NegSem_150603_ReferencingRecordOfAndSetElements_012{
24
25 type component GeneralComp { }
26
27 type set of integer SoI;
28
29 testcase TC_NegSem_150603_ReferencingRecordOfAndSetElements_012() runs on GeneralComp {
30
31 var template SoI m_one;
32 var template SoI m_two;
33
34 m_one := {1,-}; // {1,-}
35 m_two := {m_one[1],2}; // {-,2} error not allowed referencing
36
37 if (not isvalue(m_two)) {
38 setverdict(pass);
39 }
40
41 }
42
43 control{
44 execute(TC_NegSem_150603_ReferencingRecordOfAndSetElements_012());
45 }
46
47
48
49 }
This page took 0.045526 seconds and 5 git commands to generate.