conformance_test/positive_tests added
[deliverable/titan.core.git] / conformance_test / positive_tests / 06_types_and_values / 0602_structured_types_and_values / 060207_arrays / NegSem_060207_arrays_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.7, wrong index type applied to an array on the left hand side of an assignment
13 ** @verdict pass reject
14 ***************************************************/
15
16 // The following requirement is tested:
17 // Indexed value notation can be used on both the right-hand side and left-hand
18 // side of assignments. The index of the first element shall be zero or the lower
19 // bound if an index range has been given.
20 // [from 3.1] index notation: notation to access individual elements of record of,
21 // set of, array and string values or templates, where the element to be accessed
22 // is identified explicitly by an index value enclosed in square brackets ("[" and
23 // "]") which specifies the position of that element within the referenced value
24 // or template and the index value is either an integer value, array of integers
25 // or record of integers.
26
27 module NegSem_060207_arrays_006 {
28
29 type component GeneralComp {
30 }
31
32 type integer MyArrayType1[5] (1 .. 10);
33
34 testcase TC_NegSem_060207_arrays_006() runs on GeneralComp {
35
36 var MyArrayType1 v_array1 := { 8, 9, 2, 3, 4};
37 v_array1["0"] := 10; // error expected
38 setverdict(pass);
39 }
40
41 control {
42 execute(TC_NegSem_060207_arrays_006());
43 }
44
45 }
This page took 0.03217 seconds and 5 git commands to generate.