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 / Sem_06020101_ReferencingRecordFields_006.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 dot notation can be used for referencing sub-elements on the right hand side of an assignement
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 // The following requirement is tested:
17 // Elements of a record shall be referenced by the dot notation TypeIdOrExpression.ElementId,
18 // where TypeIdOrExpression resolves to the name of a structured type or an expression of
19 // a structured type such as variable, formal parameter, module parameter, constant, template,
20 // or function invocation. ElementId shall resolve to the name of a field in the structured
21 // type.
22
23 module Sem_06020101_ReferencingRecordFields_006 {
24
25 type component GeneralComp {
26 }
27
28 type record R {
29 record {
30 integer subfield1
31 } field1,
32 charstring field2 optional
33 }
34
35 testcase TC_Sem_06020101_ReferencingRecordFields_006() runs on GeneralComp {
36 var R v_rec := { field1 := { subfield1 := 5 }, field2 := "abc" };
37 if (v_rec.field1.subfield1 == 5) {
38 setverdict(pass);
39 } else {
40 setverdict(fail);
41 }
42 }
43
44 control {
45 execute(TC_Sem_06020101_ReferencingRecordFields_006());
46 }
47
48 }
This page took 0.031877 seconds and 5 git commands to generate.