conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0602_structured_types_and_values / 060207_arrays / Sem_060207_arrays_011.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.7, index notation applied to omitted array field on left hand side of assignment
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 // The following requirement is tested:
17 // All elements in an array value that are not set explicitly are undefined.
18 // When referencing an element of an uninitialized array value or field or
19 // omitted field on the left hand side of an assignment, the rules for record
20 // of values specified in 6.2.3 apply.
21
22 module Sem_060207_arrays_011 {
23
24 type component GeneralComp {
25 }
26
27 type record R {
28 integer field1[3] optional
29 }
30
31 testcase TC_Sem_060207_arrays_011() runs on GeneralComp {
32
33 var R v_rec := { field1 := omit };
34 v_rec.field1[2] := 3;
35
36 if (not isbound(v_rec.field1[0]) and not isbound(v_rec.field1[1]) and
37 v_rec.field1[2] == 3) {
38 setverdict(pass);
39 }
40 else {
41 setverdict(fail);
42 }
43 }
44
45 control {
46 execute(TC_Sem_060207_arrays_011());
47 }
48
49 }
This page took 0.040866 seconds and 5 git commands to generate.