Newer
Older
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
/***************************************************
** @author STF 470
** @version 0.0.1
** @purpose 1:6.2.3, referencing element of uninitialized record of value (left-hand side)
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
// The following requirement is tested:
// If an indexing operator at the left-hand side of an assignment refers to
// a non-existent element, the value at the right-hand side is assigned to
// the element and all elements with an index smaller than the actual index
// and without assigned value are created with an undefined value.
module Sem_060203_records_and_sets_of_single_types_021 {
type component GeneralComp {
}
type record of integer RoI;
testcase TC_Sem_060203_records_and_sets_of_single_types_021() runs on GeneralComp {
var RoI v_rec;
v_rec[2] := 2; // {-, -, 2}
if (not isbound(v_rec[0]) and
not isbound(v_rec[1]) and
v_rec[2] == 2) {
setverdict(pass);
}
else {
setverdict(fail);
}
}
control {
execute(TC_Sem_060203_records_and_sets_of_single_types_021());
}
}