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 expansion of uninitialized record values works when other constructive types are involved
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_012 {
35 type component GeneralComp {
49 testcase TC_Sem_06020101_ReferencingRecordFields_012() runs on GeneralComp {
51 v_rec.field1.option1[0].nested1 := 0;
52 if (isbound(v_rec) and isbound(v_rec.field1) and not isbound(v_rec.field2) and
53 match(v_rec.field1.option1[0].nested1, 0) and not isbound(v_rec.field1.option1[0].nested2)) {
61 execute(TC_Sem_06020101_ReferencingRecordFields_012());