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:6.2.1.1, verify that referencing fields nested deep inside omitted record invokes expansion
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
16 // The following requirement is tested:
17 // When referencing a field of an uninitialized record value or field or omitted field
18 // (including omitting a field at a higher level of the embedding hierarchy) on the left
19 // hand side of an assignment, the reference shall recursively be expanded up to and
20 // including the depth of the referenced subfield as follows:
21 // a) When expanding a value or value field of record type, the subfield referenced in
22 // the dot notation shall be set to present and all unreferenced mandatory subfields shall
23 // be left uninitialized; when the assignment is used in a scope where the optional
24 // attribute is equal to "explicit omit", all unreferenced optional subfields shall be
25 // left undefined. When the assignment is used in a scope where the optional attribute is
26 // equal to "implicit omit", all unreferenced optional subfields shall be set to omit.
27 // b) Expansion of record of/set of/array, union and set values and intermediate fields
28 // shall follow the rules of item a) in clauses 6.2.3 and 6.2.5.1, and clause 6.2.2.1
30 // At the end of the expansion, the value at the right hand side of the assignment shall
31 // be assigned to the referenced subfield.
33 module Sem_06020101_ReferencingRecordFields_016 {
35 type component GeneralComp {
51 testcase TC_Sem_06020101_ReferencingRecordFields_016() runs on GeneralComp {
54 v_rec.sub.field1.subfield1.nested1 := 0;
55 if (isbound(v_rec.sub) and isbound(v_rec.sub.field1) and not isbound(v_rec.sub.field2) and
56 isbound(v_rec.sub.field1.subfield1) and not isbound(v_rec.sub.field1.subfield2) and
57 match(v_rec.sub.field1.subfield1.nested1, 0) and not isbound(v_rec.sub.field1.subfield1.nested2)) {
65 execute(TC_Sem_06020101_ReferencingRecordFields_016());