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
39
/***************************************************
** @author STF 470
** @version 0.0.1
** @purpose 1:6.2.3, referencing non-existent element of set 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_020 {
type component GeneralComp {
}
type set of integer SoI;
testcase TC_Sem_060203_records_and_sets_of_single_types_020() runs on GeneralComp {
var SoI v_set := { 0, 1 };
v_set[3] := 3; // {0, 1, -, 3}
if (v_set[0] == 0 and
v_set[1] == 1 and
not isbound(v_set[2]) and
v_set[3] == 3) {
setverdict(pass);
}
else {
setverdict(fail);
}
}
control {
execute(TC_Sem_060203_records_and_sets_of_single_types_020());
}
}