Newer
Older
/***************************************************
** @author STF 521
** @version 0.0.1
** @purpose 1:B.1.2.1, Ensure that the IUT correctly handles template list corretly
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
***************************************************/
// The following requirements are tested:
// Restriction C: Templates in the template list shall obey the template(present) restriction
module NegSem_B010201_value_list_004 {
type record MessageType {
integer field1,
charstring field2 optional
}
template(present) MessageType mw_examplePresent := {1, ?};
type port loopbackPort message {
inout MessageType
}
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_NegSem_B010201_value_list_004() runs on GeneralComp {
var MessageType v_testMessage;
var template(omit) MessageType v_present;
v_present := mw_examplePresent; // error: incorrect
v_testMessage:= {
field1:= 1,
field2:= "abc"
}
messagePort.send(v_testMessage);
alt {
[] messagePort.receive(v_present) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail);
}
}
}
control{
execute(TC_NegSem_B010201_value_list_004());
}
}