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 487
** @version 0.0.1
** @purpose 1:10, Ensure that dot notation of a field in a record, which actual value is null shall cause an error
** @verdict pass reject
***************************************************/
/* The following requirements are tested:
Using the dot notation and index notation for referencing a field, alternative or element of an address value, which actual value is null shall cause an
error.
*/
module NegSem_10_Constants_004 {
type integer address;
type record MyRecordType
{
address field1,
integer field2 optional
};
type component GeneralComp {
}
testcase TC_NegSem_10_Constants_004() runs on GeneralComp {
var MyRecordType R1:= {field1 := null,
field2 := 2};
const integer C1 := R1.field1; //error
if (C1 == R1.field1) { setverdict(pass) }
else { setverdict(fail) }
}
control{
execute(TC_NegSem_10_Constants_004());
}
}