Sync with 5.1.0
[deliverable/titan.core.git] / regression_test / predefFunction / rotter_SW.ttcn
CommitLineData
970ed795
EL
1/******************************************************************************
2 * Copyright (c) 2000-2014 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 ******************************************************************************/
8module rotter_SW { //^In TTCN-3 module `rotter_SW'://
9
10type component PDTestComponent {};
11
12
13/*--- ROTATE ON BITSTRING --------------------------------------------------*/
14
15const bitstring rotconb := '0000000000'B
16const bitstring rotconb1 := '1000110001'B
17const bitstring rotconb2 := rotconb1 @> 2 // '0110001100'B
18const bitstring rotconb3 := rotconb1 <@ 2 // '0011000110'B
19const bitstring rotconb4 := rotconb1 <@ 5 // '1000110001'B
20const bitstring rotconb5 := rotconb1 @> 5 // '1000110001'B
21const bitstring rotconb6 := rotconb1 <@ 0 // '1000110001'B
22const bitstring rotconb7 := rotconb1 @> 0 // '1000110001'B
23const bitstring rotconb8 := rotconb1 <@ 11 // '0001100011'B
24const bitstring rotconb9 := rotconb1 @> 11 // '1100011000'B
25const bitstring rotconb10 := ''B
26const bitstring rotconb11 := ''B @> 2
27const bitstring rotconb12 := ''B <@ 2
28const bitstring rotconb13 := ''B @> 0
29const bitstring rotconb14 := ''B <@ 0
30const bitstring rotconb15 := rotconb1 @> -2 // '0011000110'B
31const bitstring rotconb16 := rotconb1 <@ -2 // '0110001100'B
32
33testcase rotate_bitstr() runs on PDTestComponent{ //In testcase definition//
34
35 if (rotconb1 == rotconb1 <@ lengthof(rotconb1))
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 (rotconb1 == rotconb1 @> lengthof(rotconb1))
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 (rotconb1 == rotconb2 <@ 2)
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 (rotconb1 == rotconb3 @> 2)
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 (rotconb1 == rotconb4 @> 5)
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 (rotconb1 == rotconb5 <@ 5)
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 (rotconb1 == rotconb6)
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 (rotconb1 == rotconb7)
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 (rotconb8 == '0001100011'B)
68 {setverdict(pass);}
69 else {setverdict(fail);} //^In else statement// \
70 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
71 if (rotconb9 == '1100011000'B)
72 {setverdict(pass);}
73 else {setverdict(fail);} //^In else statement// \
74 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
75 if ((rotconb10 == rotconb11)
76 and (rotconb10 == rotconb12))
77 {setverdict(pass);}
78 else {setverdict(fail);} //^In else statement// \
79 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
80 if ((rotconb10 == rotconb13)
81 and (rotconb10 == rotconb14))
82 {setverdict(pass);}
83 else {setverdict(fail);} //^In else statement// \
84 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
85 if (rotconb15 == rotconb3)
86 {setverdict(pass);}
87 else {setverdict(fail);} //^In else statement// \
88 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
89 if (rotconb16 == rotconb2)
90 {setverdict(pass);}
91 else {setverdict(fail);} //^In else statement// \
92 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
93}
94
95/*--- ROTATE ON HEXSTRING --------------------------------------------------*/
96
97const hexstring rotconh := '0000000000'H
98const hexstring rotconh1 := '1000110001'H
99const hexstring rotconh2 := rotconh1 @> 2 // '0110001100'H
100const hexstring rotconh3 := rotconh1 <@ 2 // '0011000110'H
101const hexstring rotconh4 := rotconh1 <@ 5 // '1000110001'H
102const hexstring rotconh5 := rotconh1 @> 5 // '1000110001'H
103const hexstring rotconh6 := rotconh1 <@ 0 // '1000110001'H
104const hexstring rotconh7 := rotconh1 @> 0 // '1000110001'H
105const hexstring rotconh8 := rotconh1 <@ 11 // '0001100011'H
106const hexstring rotconh9 := rotconh1 @> 11 // '1100011000'H
107const hexstring rotconh10 := ''H
108const hexstring rotconh11 := ''H @> 2
109const hexstring rotconh12 := ''H <@ 2
110const hexstring rotconh13 := ''H @> 0
111const hexstring rotconh14 := ''H <@ 0
112const hexstring rotconh15 := rotconh1 @> -2 // '0011000110'H
113const hexstring rotconh16 := rotconh1 <@ -2 // '0110001100'H
114
115testcase rotate_hexstr() runs on PDTestComponent{ //In testcase definition//
116 if (rotconh1 == rotconh1 <@ lengthof(rotconh1))
117 {setverdict(pass);}
118 else {setverdict(fail);} //^In else statement// \
119 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
120 if (rotconh1 == rotconh1 @> lengthof(rotconh1))
121 {setverdict(pass);}
122 else {setverdict(fail);} //^In else statement// \
123 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
124 if (rotconh1 == rotconh2 <@ 2)
125 {setverdict(pass);}
126 else {setverdict(fail);} //^In else statement// \
127 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
128 if (rotconh1 == rotconh3 @> 2)
129 {setverdict(pass);}
130 else {setverdict(fail);} //^In else statement// \
131 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
132 if (rotconh1 == rotconh4 @> 5)
133 {setverdict(pass);}
134 else {setverdict(fail);} //^In else statement// \
135 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
136 if (rotconh1 == rotconh5 <@ 5)
137 {setverdict(pass);}
138 else {setverdict(fail);} //^In else statement// \
139 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
140 if (rotconh1 == rotconh6)
141 {setverdict(pass);}
142 else {setverdict(fail);} //^In else statement// \
143 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
144 if (rotconh1 == rotconh7)
145 {setverdict(pass);}
146 else {setverdict(fail);} //^In else statement// \
147 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
148 if (rotconh8 == '0001100011'H)
149 {setverdict(pass);}
150 else {setverdict(fail);} //^In else statement// \
151 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
152 if (rotconh9 == '1100011000'H)
153 {setverdict(pass);}
154 else {setverdict(fail);} //^In else statement// \
155 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
156 if ((rotconh10 == rotconh11)
157 and (rotconh10 == rotconh12))
158 {setverdict(pass);}
159 else {setverdict(fail);} //^In else statement// \
160 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
161 if ((rotconh10 == rotconh13)
162 and (rotconh10 == rotconh14))
163 {setverdict(pass);}
164 else {setverdict(fail);} //^In else statement// \
165 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
166 if (rotconh15 == rotconh3)
167 {setverdict(pass);}
168 else {setverdict(fail);} //^In else statement// \
169 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
170 if (rotconh16 == rotconh2)
171 {setverdict(pass);}
172 else {setverdict(fail);} //^In else statement// \
173 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
174}
175
176/*--- ROTATE ON OCTETSTRING --------------------------------------------------*/
177
178const octetstring rotcono1 := 'AA00AA00AA'O
179const octetstring rotcono2 := rotcono1 @> 1 // 'AAAA00AA00'O
180const octetstring rotcono3 := rotcono1 <@ 1 // '00AA00AAAA'O
181const octetstring rotcono4 := rotcono1 <@ 5 // 'AA00AA00AA'O
182const octetstring rotcono5 := rotcono1 @> 5 // 'AA00AA00AA'O
183const octetstring rotcono6 := rotcono1 <@ 0 // 'AA00AA00AA'O
184const octetstring rotcono7 := rotcono1 @> 0 // 'AA00AA00AA'O
185const octetstring rotcono8 := rotcono1 <@ 11 // '00AA00AAAA'O
186const octetstring rotcono9 := rotcono1 @> 11 // 'AAAA00AA00'O
187const octetstring rotcono10 := ''O
188const octetstring rotcono11 := ''O @> 2
189const octetstring rotcono12 := ''O <@ 2
190const octetstring rotcono13 := ''O @> 0
191const octetstring rotcono14 := ''O <@ 0
192const octetstring rotcono15 := rotcono1 @> -1 // '00AA00AAAA'O
193const octetstring rotcono16 := rotcono1 <@ -1 // 'AAAA00AA00'O
194
195testcase rotate_octetstr() runs on PDTestComponent{ //In testcase definition//
196
197 if (rotcono1 == rotcono1 <@ lengthof(rotcono1))
198 {setverdict(pass);}
199 else {setverdict(fail);} //^In else statement// \
200 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
201 if (rotcono1 == rotcono1 @> lengthof(rotcono1))
202 {setverdict(pass);}
203 else {setverdict(fail);} //^In else statement// \
204 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
205 if (rotcono1 == rotcono2 <@ 1)
206 {setverdict(pass);}
207 else {setverdict(fail);} //^In else statement// \
208 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
209 if (rotcono1 == rotcono3 @> 1)
210 {setverdict(pass);}
211 else {setverdict(fail);} //^In else statement// \
212 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
213 if (rotcono1 == rotcono4 @> 5)
214 {setverdict(pass);}
215 else {setverdict(fail);} //^In else statement// \
216 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
217 if (rotcono1 == rotcono5 <@ 5)
218 {setverdict(pass);}
219 else {setverdict(fail);} //^In else statement// \
220 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
221 if (rotcono1 == rotcono6)
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 (rotcono1 == rotcono7)
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 (rotcono8 == '00AA00AAAA'O)
230 {setverdict(pass);}
231 else {setverdict(fail);} //^In else statement// \
232 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
233 if (rotcono9 == 'AAAA00AA00'O)
234 {setverdict(pass);}
235 else {setverdict(fail);} //^In else statement// \
236 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
237 if ((rotcono10 == rotcono11)
238 and (rotcono10 == rotcono12))
239 {setverdict(pass);}
240 else {setverdict(fail);} //^In else statement// \
241 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
242 if ((rotcono10 == rotcono13)
243 and (rotcono10 == rotcono14))
244 {setverdict(pass);}
245 else {setverdict(fail);} //^In else statement// \
246 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
247 if (rotcono15 == rotcono3)
248 {setverdict(pass);}
249 else {setverdict(fail);} //^In else statement// \
250 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
251 if (rotcono16 == rotcono2)
252 {setverdict(pass);}
253 else {setverdict(fail);} //^In else statement// \
254 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
255}
256
257/*--- ROTATE ON CHARSTRING --------------------------------------------------*/
258
259const charstring rotconc := "0000000000"
260const charstring rotconc1 := "1000110001"
261const charstring rotconc2 := rotconc1 @> 2 // "0110001100"
262const charstring rotconc3 := rotconc1 <@ 2 // "0011000110"
263const charstring rotconc4 := rotconc1 <@ 5 // "1000110001"
264const charstring rotconc5 := rotconc1 @> 5 // "1000110001"
265const charstring rotconc6 := rotconc1 <@ 0 // "1000110001"
266const charstring rotconc7 := rotconc1 @> 0 // "1000110001"
267const charstring rotconc8 := rotconc1 <@ 11 // "0001100011"
268const charstring rotconc9 := rotconc1 @> 11 // "1100011000"
269const charstring rotconc10 := ""
270const charstring rotconc11 := "" @> 2
271const charstring rotconc12 := "" <@ 2
272const charstring rotconc13 := "" @> 0
273const charstring rotconc14 := "" <@ 0
274const charstring rotconc15 := rotconc1 @> -2 // "0011000110"
275const charstring rotconc16 := rotconc1 <@ -2 // "0110001100"
276
277testcase rotate_char() runs on PDTestComponent{ //In testcase definition//
278
279 if (rotconc1 == rotconc1 <@ lengthof(rotconc1))
280 {setverdict(pass);}
281 else {setverdict(fail);} //^In else statement// \
282 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
283 if (rotconc1 == rotconc1 @> lengthof(rotconc1))
284 {setverdict(pass);}
285 else {setverdict(fail);} //^In else statement// \
286 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
287 if (rotconc1 == rotconc2 <@ 2)
288 {setverdict(pass);}
289 else {setverdict(fail);} //^In else statement// \
290 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
291 if (rotconc1 == rotconc3 @> 2)
292 {setverdict(pass);}
293 else {setverdict(fail);} //^In else statement// \
294 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
295 if (rotconc1 == rotconc4 @> 5)
296 {setverdict(pass);}
297 else {setverdict(fail);} //^In else statement// \
298 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
299 if (rotconc1 == rotconc5 <@ 5)
300 {setverdict(pass);}
301 else {setverdict(fail);} //^In else statement// \
302 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
303 if (rotconc1 == rotconc6)
304 {setverdict(pass);}
305 else {setverdict(fail);} //^In else statement// \
306 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
307 if (rotconc1 == rotconc7)
308 {setverdict(pass);}
309 else {setverdict(fail);} //^In else statement// \
310 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
311 if (rotconc8 == "0001100011")
312 {setverdict(pass);}
313 else {setverdict(fail);} //^In else statement// \
314 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
315 if (rotconc9 == "1100011000")
316 {setverdict(pass);}
317 else {setverdict(fail);} //^In else statement// \
318 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
319 if ((rotconc10 == rotconc11)
320 and (rotconc10 == rotconc12))
321 {setverdict(pass);}
322 else {setverdict(fail);} //^In else statement// \
323 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
324 if ((rotconc10 == rotconc13)
325 and (rotconc10 == rotconc14))
326 {setverdict(pass);}
327 else {setverdict(fail);} //^In else statement// \
328 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
329 if (rotconc15 == rotconc3)
330 {setverdict(pass);}
331 else {setverdict(fail);} //^In else statement// \
332 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
333 if (rotconc16 == rotconc2)
334 {setverdict(pass);}
335 else {setverdict(fail);} //^In else statement// \
336 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
337}
338
339
340/*--- ROTATE ON UNIVERSAL CHARSTRING --------------------------------------------------*/
341
342const universal charstring rotconuc := "0000000000"
343const universal charstring rotconuc1 := char(0,0,0,65) & "000" & char(0,0,0,65) & char(0,0,0,65) & "000" & char(0,0,0,65) //A000AA000A
344const universal charstring rotconuc2 := rotconuc1 @> 2 // "0AA000AA00"
345const universal charstring rotconuc3 := rotconuc1 <@ 2 // "00AA000AA0"
346const universal charstring rotconuc4 := rotconuc1 <@ 5 // "A000AA000A"
347const universal charstring rotconuc5 := rotconuc1 @> 5 // "A000AA000A"
348const universal charstring rotconuc6 := rotconuc1 <@ 0 // "A000AA000A"
349const universal charstring rotconuc7 := rotconuc1 @> 0 // "A000AA000A"
350const universal charstring rotconuc8 := rotconuc1 <@ 11 // "000AA000AA"
351const universal charstring rotconuc9 := rotconuc1 @> 11 // "AA000AA000"
352const universal charstring rotconuc10 := ""
353const universal charstring rotconuc11 := "" @> 2
354const universal charstring rotconuc12 := "" <@ 2
355const universal charstring rotconuc13 := "" @> 0
356const universal charstring rotconuc14 := "" <@ 0
357const universal charstring rotconuc15 := rotconuc1 @> -2 // "00AA000AA0"
358const universal charstring rotconuc16 := rotconuc1 <@ -2 // "0AA000AA00"
359
360testcase rotate_uchar() runs on PDTestComponent{ //In testcase definition//
361
362 if (rotconuc1 == rotconuc1 <@ lengthof(rotconc1))
363 {setverdict(pass);}
364 else {setverdict(fail);} //^In else statement// \
365 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
366 if (rotconuc1 == rotconuc1 @> lengthof(rotconc1))
367 {setverdict(pass);}
368 else {setverdict(fail);} //^In else statement// \
369 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
370 if (rotconuc1 == rotconuc2 <@ 2)
371 {setverdict(pass);}
372 else {setverdict(fail);} //^In else statement// \
373 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
374 if (rotconuc1 == rotconuc3 @> 2)
375 {setverdict(pass);}
376 else {setverdict(fail);} //^In else statement// \
377 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
378 if (rotconuc1 == rotconuc4 @> 5)
379 {setverdict(pass);}
380 else {setverdict(fail);} //^In else statement// \
381 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
382 if (rotconuc1 == rotconuc5 <@ 5)
383 {setverdict(pass);}
384 else {setverdict(fail);} //^In else statement// \
385 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
386 if (rotconuc1 == rotconuc6)
387 {setverdict(pass);}
388 else {setverdict(fail);} //^In else statement// \
389 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
390 if (rotconuc1 == rotconuc7)
391 {setverdict(pass);}
392 else {setverdict(fail);} //^In else statement// \
393 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
394 if (rotconuc8 == "000AA000AA")
395 {setverdict(pass);}
396 else {setverdict(fail);} //^In else statement// \
397 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
398 if (rotconuc9 == "AA000AA000")
399 {setverdict(pass);}
400 else {setverdict(fail);} //^In else statement// \
401 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
402 if ((rotconuc10 == rotconuc11)
403 and (rotconuc10 == rotconuc12))
404 {setverdict(pass);}
405 else {setverdict(fail);} //^In else statement// \
406 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
407 if ((rotconuc10 == rotconuc13)
408 and (rotconuc10 == rotconuc14))
409 {setverdict(pass);}
410 else {setverdict(fail);} //^In else statement// \
411 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
412 if (rotconuc15 == rotconuc3)
413 {setverdict(pass);}
414 else {setverdict(fail);} //^In else statement// \
415 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
416 if (rotconuc16 == rotconuc2)
417 {setverdict(pass);}
418 else {setverdict(fail);} //^In else statement// \
419 //^warning\: Control never reaches this code because of previous effective condition\(s\)//
420}
421
422control {
423 execute (rotate_bitstr());
424 execute (rotate_hexstr());
425 execute (rotate_octetstr());
426 execute (rotate_char());
427 execute (rotate_uchar());
428}
429
430}
This page took 0.039162 seconds and 5 git commands to generate.