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_002.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, verify assignment of explicitly identified elements to arrays
13 ** @verdict pass accept, ttcn3verdict:pass
14 ***************************************************/
15
16 // The following requirement is tested:
17 // Values may be assigned individually by a value list notation or indexed notation
18 // or more than one or all at once by a value list notation or index assignment
19 // notation.
20 // Elements to be left out from the assignment shall be explicitly skipped in the
21 // list by using dash.
22
23 module Sem_060207_arrays_002 {
24
25 type component GeneralComp {
26 }
27
28 type integer MyArrayType1[3] (1 .. 10);
29
30 testcase TC_Sem_060207_arrays_002() runs on GeneralComp {
31
32 var MyArrayType1 v_array1 := {
33 [0] := 8,
34 [1] := 1,
35 [2] := -
36 };
37
38 if (match(v_array1[0], 8) and match(v_array1[1], 1) and not isbound(v_array1[2])
39 and lengthof (v_array1 & {2}) == 4) {
40 setverdict(pass);
41 }
42 else {
43 setverdict(fail);
44 }
45 }
46
47 control {
48 execute(TC_Sem_060207_arrays_002());
49 }
50
51 }
This page took 0.032672 seconds and 5 git commands to generate.