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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
/***************************************************
** @author STF 487
** @version 0.0.1
** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding
** @verdict pass accept, ttcn3verdict:pass
***************************************************/
//Restriction a)
/*It can be assigned to templates and template fields of bitstring, hexstring, octetstring,
charstring and universal charstring types.*/
module Sem_B010209_decoded_content_005 {
type record MessageType {
universal charstring payload
}
type record Mymessage {
integer field1,
universal charstring field2 optional
}
type port loopbackPort message{inout MessageType};
type component GeneralComp {
port loopbackPort messagePort
}
testcase TC_Sem_B010209_decoded_content_005() runs on GeneralComp {
var Mymessage v_testMessage;
var MessageType Message;
v_testMessage:= {1,"A"} ;
Message.payload :=any2unistr(v_testMessage); //encode message to payload,universal charstring UTF-8
template MessageType mw_matchingTemplate:=
{
payload := decmatch("UTF-8") Mymessage: {1,"A"}
}
messagePort.send(Message); //send message
alt {
[] messagePort.receive(mw_matchingTemplate) {
setverdict(pass);
}
[] messagePort.receive {
setverdict(fail,mw_matchingTemplate.payload);
}
}
}
control{
execute(TC_Sem_B010209_decoded_content_005());
}
}