Commit | Line | Data |
---|---|---|
4e4a3e2c AK |
1 | /****************************************************************************** |
2 | * Copyright (c) 2000-2016 Ericsson Telecom AB | |
3 | * All rights reserved. This program and the accompanying materials | |
4 | * are made available under the terms of the Eclipse Public License v1.0 | |
5 | * which accompanies this distribution, and is available at | |
6 | * http://www.eclipse.org/legal/epl-v10.html | |
7 | * | |
8 | * Contributors: | |
9 | * Adrien Kirjak – initial implementation | |
10 | * | |
11 | ** @version 0.0.1 | |
12 | ** @purpose 1:B.1.2.8, Ensure that the IUT correctly handles content decoding | |
13 | ** @verdict pass accept, ttcn3verdict:pass | |
14 | ***************************************************/ | |
15 | ||
16 | //Restriction a) | |
17 | /*It can be assigned to templates and template fields of bitstring, hexstring, octetstring, | |
18 | charstring and universal charstring types.*/ | |
19 | ||
20 | ||
21 | module Sem_B010209_decoded_content_005 { | |
22 | ||
23 | type record MessageType { | |
24 | universal charstring payload | |
25 | } | |
26 | ||
4a43b62e | 27 | type integer MyInt with { variant "32 bit" }; |
4e4a3e2c AK |
28 | |
29 | type port loopbackPort message{ | |
30 | inout MessageType | |
31 | } with {extension "internal"} | |
32 | ||
33 | type component GeneralComp { | |
34 | port loopbackPort messagePort | |
35 | } | |
36 | ||
37 | const MyInt c_input := 1633837665; | |
38 | ||
39 | template MessageType mw_matchingTemplate:= { | |
40 | payload := decmatch MyInt:c_input | |
41 | } | |
42 | ||
43 | testcase TC_Sem_B010209_decoded_content_005() runs on GeneralComp { | |
44 | var MessageType v_message; | |
4a43b62e | 45 | var MessageType got; |
4e4a3e2c AK |
46 | |
47 | v_message.payload := encvalue_unichar(c_input); //encode message to payload, charstring | |
48 | ||
49 | connect(self:messagePort, self:messagePort); | |
50 | messagePort.send(v_message); //send message | |
4a43b62e | 51 | |
4e4a3e2c AK |
52 | |
53 | alt { | |
54 | [] messagePort.receive(mw_matchingTemplate) { | |
55 | setverdict(pass); | |
56 | } | |
4a43b62e AK |
57 | [] messagePort.receive(MessageType:?) -> value got { |
58 | setverdict(fail,"exepted: ", mw_matchingTemplate, " recieved: ", got); | |
4e4a3e2c AK |
59 | } |
60 | } | |
61 | ||
62 | } | |
63 | ||
64 | control{ | |
65 | execute(TC_Sem_B010209_decoded_content_005()); | |
66 | } | |
67 | ||
4a43b62e | 68 | } with { encode "RAW"} |
4e4a3e2c | 69 |