Sync with 5.4.0
[deliverable/titan.core.git] / regression_test / predefFunction / shifty_SW.ttcn
CommitLineData
970ed795 1/******************************************************************************
3abe9331 2 * Copyright (c) 2000-2015 Ericsson Telecom AB
970ed795
EL
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 ******************************************************************************/
8module shifty_SW { //^In TTCN-3 module `shifty_SW'://
9
10type component PDTestComponent {};
11
12
13/*--- SHIFT ON BITSTRING --------------------------------------------------*/
14
15const bitstring shiconb := '0000000000'B
16const bitstring shiconb1 := '0000110000'B
17const bitstring shiconb2 := shiconb1 >> 2 // '0000001100'B
18const bitstring shiconb3 := shiconb1 << 2 // '0011000000'B
19const bitstring shiconb4 := shiconb1 << 5 // '1000000000'B
20const bitstring shiconb5 := shiconb1 >> 5 // '0000000001'B
21const bitstring shiconb6 := shiconb1 << 0 // '0000110000'B
22const bitstring shiconb7 := shiconb1 >> 0 // '0000110000'B
23const bitstring shiconb8 := shiconb1 << 11 // '0000000000'B
24const bitstring shiconb9 := shiconb1 >> 11 // '0000000000'B
25const bitstring shiconb10 := ''B
26const bitstring shiconb11 := ''B >> 2
27const bitstring shiconb12 := ''B << 2
28const bitstring shiconb13 := ''B >> 0
29const bitstring shiconb14 := ''B << 0
30const bitstring shiconb15 := shiconb1 >> -2 // '0011000000'B
31const bitstring shiconb16 := shiconb1 << -2 // '0000001100'B
32
33testcase shift_bitstr() runs on PDTestComponent{ //In testcase definition//
34
35 if (shiconb1 == shiconb2 << 2)
36 {setverdict(pass);}
37 else {setverdict(fail);} //^In else statement// \
38 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
39 if (shiconb1 == shiconb3 >> 2)
40 {setverdict(pass);}
41 else {setverdict(fail);} //^In else statement// \
42 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
43 if (shiconb1 != shiconb4 >> 5)
44 {setverdict(pass);}
45 else {setverdict(fail);} //^In else statement// \
46 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
47 if (shiconb1 != shiconb5 << 5)
48 {setverdict(pass);}
49 else {setverdict(fail);} //^In else statement// \
50 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
51 if (shiconb1 == shiconb6)
52 {setverdict(pass);}
53 else {setverdict(fail);} //^In else statement// \
54 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
55 if (shiconb1 == shiconb7)
56 {setverdict(pass);}
57 else {setverdict(fail);} //^In else statement// \
58 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
59 if (shiconb == shiconb8)
60 {setverdict(pass);}
61 else {setverdict(fail);} //^In else statement// \
62 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
63 if (shiconb == shiconb9)
64 {setverdict(pass);}
65 else {setverdict(fail);} //^In else statement// \
66 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
67 if ((shiconb10 == shiconb11)
68 and (shiconb10 == shiconb12))
69 {setverdict(pass);}
70 else {setverdict(fail);} //^In else statement// \
71 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
72 if ((shiconb10 == shiconb13)
73 and (shiconb10 == shiconb14))
74 {setverdict(pass);}
75 else {setverdict(fail);} //^In else statement// \
76 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
77 if (shiconb15 == shiconb3)
78 {setverdict(pass);}
79 else {setverdict(fail);} //^In else statement// \
80 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
81 if (shiconb16 == shiconb2)
82 {setverdict(pass);}
83 else {setverdict(fail);} //^In else statement// \
84 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
85}
86
87/*--- SHIFT ON HEXSTRING --------------------------------------------------*/
88
89const hexstring shiconh := '0000000000'H
90const hexstring shiconh1 := '0000110000'H
91const hexstring shiconh2 := shiconh1 >> 2 // '0000001100'H
92const hexstring shiconh3 := shiconh1 << 2 // '0011000000'H
93const hexstring shiconh4 := shiconh1 << 5 // '1000000000'H
94const hexstring shiconh5 := shiconh1 >> 5 // '0000000001'H
95const hexstring shiconh6 := shiconh1 << 0 // '0000110000'H
96const hexstring shiconh7 := shiconh1 >> 0 // '0000110000'H
97const hexstring shiconh8 := shiconh1 << 11 // '0000000000'H
98const hexstring shiconh9 := shiconh1 >> 11 // '0000000000'H
99const hexstring shiconh10 := ''H
100const hexstring shiconh11 := ''H >> 2
101const hexstring shiconh12 := ''H << 2
102const hexstring shiconh13 := ''H >> 0
103const hexstring shiconh14 := ''H << 0
104const hexstring shiconh15 := shiconh1 >> -2 // '0011000000'H
105const hexstring shiconh16 := shiconh1 << -2 // '0000001100'H
106
107testcase shift_hexstr() runs on PDTestComponent{ //In testcase definition//
108
109 if (shiconh1 == shiconh2 << 2)
110 {setverdict(pass);}
111 else {setverdict(fail);} //^In else statement// \
112 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
113 if (shiconh1 == shiconh3 >> 2)
114 {setverdict(pass);}
115 else {setverdict(fail);} //^In else statement// \
116 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
117 if (shiconh1 != shiconh4 >> 5)
118 {setverdict(pass);}
119 else {setverdict(fail);} //^In else statement// \
120 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
121 if (shiconh1 != shiconh5 << 5)
122 {setverdict(pass);}
123 else {setverdict(fail);} //^In else statement// \
124 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
125 if (shiconh1 == shiconh6)
126 {setverdict(pass);}
127 else {setverdict(fail);} //^In else statement// \
128 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
129 if (shiconh1 == shiconh7)
130 {setverdict(pass);}
131 else {setverdict(fail);} //^In else statement// \
132 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
133 if (shiconh == shiconh8)
134 {setverdict(pass);}
135 else {setverdict(fail);} //^In else statement// \
136 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
137 if (shiconh == shiconh9)
138 {setverdict(pass);}
139 else {setverdict(fail);} //^In else statement// \
140 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
141 if ((shiconh10 == shiconh11)
142 and (shiconh10 == shiconh12))
143 {setverdict(pass);}
144 else {setverdict(fail);} //^In else statement// \
145 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
146 if ((shiconh10 == shiconh13)
147 and (shiconh10 == shiconh14))
148 {setverdict(pass);}
149 else {setverdict(fail);} //^In else statement// \
150 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
151 if (shiconh15 == shiconh3)
152 {setverdict(pass);}
153 else {setverdict(fail);} //^In else statement// \
154 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
155 if (shiconh16 == shiconh2)
156 {setverdict(pass);}
157 else {setverdict(fail);} //^In else statement// \
158 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
159}
160
161/*--- SHIFT ON OCTETSTRING --------------------------------------------------*/
162
163const octetstring shicono := '0000000000'O
164const octetstring shicono1 := '0000AA0000'O
165const octetstring shicono2 := shicono1 >> 2 // '00000000AA'O
166const octetstring shicono3 := shicono1 << 2 // 'AA00000000'O
167const octetstring shicono4 := shicono1 << 5 // '0000000000'O
168const octetstring shicono5 := shicono1 >> 5 // '0000000000'O
169const octetstring shicono6 := shicono1 << 0 // '0000AA0000'O
170const octetstring shicono7 := shicono1 >> 0 // '0000AA0000'O
171const octetstring shicono8 := shicono1 << 11 // '0000000000'O
172const octetstring shicono9 := shicono1 >> 11 // '0000000000'O
173const octetstring shicono10 := ''O
174const octetstring shicono11 := ''O >> 2
175const octetstring shicono12 := ''O << 2
176const octetstring shicono13 := ''O >> 0
177const octetstring shicono14 := ''O << 0
178const octetstring shicono15 := shicono1 >> -2 // 'AA00000000'O
179const octetstring shicono16 := shicono1 << -2 // '00000000AA'O
180
181testcase shift_octetstr() runs on PDTestComponent{ //In testcase definition//
182
183 if (shicono1 == shicono2 << 2)
184 {setverdict(pass);}
185 else {setverdict(fail);} //^In else statement// \
186 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
187 if (shicono1 == shicono3 >> 2)
188 {setverdict(pass);}
189 else {setverdict(fail);} //^In else statement// \
190 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
191 if (shicono1 != shicono4 >> 5)
192 {setverdict(pass);}
193 else {setverdict(fail);} //^In else statement// \
194 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
195 if (shicono1 != shicono5 << 5)
196 {setverdict(pass);}
197 else {setverdict(fail);} //^In else statement// \
198 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
199 if (shicono1 == shicono6)
200 {setverdict(pass);}
201 else {setverdict(fail);} //^In else statement// \
202 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
203 if (shicono1 == shicono7)
204 {setverdict(pass);}
205 else {setverdict(fail);} //^In else statement// \
206 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
207 if (shicono == shicono8)
208 {setverdict(pass);}
209 else {setverdict(fail);} //^In else statement// \
210 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
211 if (shicono == shicono9)
212 {setverdict(pass);}
213 else {setverdict(fail);} //^In else statement// \
214 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
215 if ((shicono10 == shicono11)
216 and (shicono10 == shicono12))
217 {setverdict(pass);}
218 else {setverdict(fail);} //^In else statement// \
219 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
220 if ((shicono10 == shicono13)
221 and (shicono10 == shicono14))
222 {setverdict(pass);}
223 else {setverdict(fail);} //^In else statement// \
224 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
225 if (shicono15 == shicono3)
226 {setverdict(pass);}
227 else {setverdict(fail);} //^In else statement// \
228 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
229 if (shicono16 == shicono2)
230 {setverdict(pass);}
231 else {setverdict(fail);} //^In else statement// \
232 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
233}
234
235control {
236 execute (shift_bitstr());
237 execute (shift_hexstr());
238 execute (shift_octetstr());
239}
240
241}
This page took 0.033693 seconds and 5 git commands to generate.