conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0602_structured_types_and_values / 060201_record_type_and_values / 06020101_referencing_fields_of_record_type / NegSem_06020101_ReferencingRecordFields_004.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:6.2.1.1, verify that referencing omitted record on the right hand of an assignment is not allowed
13 ** @verdict pass reject
14 ***************************************************/
15
16 // The following requirement is tested:
17 // Referencing a subfield of an uninitialized or omitted record field or value on the right
18 // hand side of an assignment shall cause an error.
19
20 module NegSem_06020101_ReferencingRecordFields_004 {
21
22 type component GeneralComp {
23 }
24
25 type record R {
26 record {
27 integer subfield1
28 } field1 optional,
29 charstring field2 optional
30 }
31
32 testcase TC_NegSem_06020101_ReferencingRecordFields_004() runs on GeneralComp {
33 var R v_rec;
34 v_rec.field1 := omit;
35 v_rec.field2 := "abc";
36 if (v_rec.field1.subfield1 == 5) {
37 setverdict(fail);
38 } else {
39 setverdict(pass);
40 }
41 }
42
43 control {
44 execute(TC_NegSem_06020101_ReferencingRecordFields_004());
45 }
46
47 }
This page took 0.040929 seconds and 5 git commands to generate.