3 -- Grant of Unlimited Rights
5 -- Under contracts F33600-87-D-0337, F33600-84-D-0280, MDA903-79-C-0687,
6 -- F08630-91-C-0015, and DCA100-97-D-0025, the U.S. Government obtained
7 -- unlimited rights in the software and documentation contained herein.
8 -- Unlimited rights are defined in DFAR 252.227-7013(a)(19). By making
9 -- this public release, the Government intends to confer upon all
10 -- recipients unlimited rights equal to those held by the Government.
11 -- These rights include rights to use, duplicate, release or disclose the
12 -- released technical data and computer software in whole or in part, in
13 -- any manner and for any purpose whatsoever, and to have or permit others
18 -- ALL MATERIALS OR INFORMATION HEREIN RELEASED, MADE AVAILABLE OR
19 -- DISCLOSED ARE AS IS. THE GOVERNMENT MAKES NO EXPRESS OR IMPLIED
20 -- WARRANTY AS TO ANY MATTER WHATSOEVER, INCLUDING THE CONDITIONS OF THE
21 -- SOFTWARE, DOCUMENTATION OR OTHER INFORMATION RELEASED, MADE AVAILABLE
22 -- OR DISCLOSED, OR THE OWNERSHIP, MERCHANTABILITY, OR FITNESS FOR A
23 -- PARTICULAR PURPOSE OF SAID MATERIAL.
27 -- Check that subprograms Shift_Left, Shift_Right,
28 -- Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right are available
29 -- and produce correct results for values of signed and modular
30 -- integer types of 8 bits.
33 -- This test uses the shift and rotate functions of package Interfaces
34 -- with a modular type representative of 8 bits. The functions
35 -- are used as the right hand of assignment statements, as part of
36 -- conditional statements, and as arguments in other function calls.
38 -- A check is performed in the test to determine whether the bit
39 -- ordering method used by the machine/implementation is high-order
40 -- first ("Big Endian") or low-order first ("Little Endian"). The
41 -- specific subtests use this information to evaluate the results of
42 -- each of the functions under test.
44 -- Note: In the string associated with each Report.Failed statement, the
45 -- acronym BE refers to Big Endian, LE refers to Little Endian.
47 -- APPLICABILITY CRITERIA:
48 -- This test is applicable to all implementations that support signed
49 -- and modular integer types of 8 bits.
53 -- 21 Aug 95 SAIC Initial prerelease version.
54 -- 07 May 96 SAIC Incorporated reviewer comments for ACVC 2.1.
65 Report
.Test
("CXB2001",
66 "Check that subprograms Shift_Left, Shift_Right, " &
67 "Shift_Right_Arithmetic, Rotate_Left, and Rotate_Right " &
68 "produce correct results for values of signed and " &
69 "modular integer types of 8 bits");
77 TC_Amount
: Natural := Natural'First;
78 Big_Endian
: Boolean := False;
80 -- Range of type Unsigned_8 is 0..255 (0..Modulus-1).
82 TC_Result_Unsigned_8
: Unsigned_8
:= Unsigned_8
'First;
86 -- Determine whether the machine uses high-order first or low-order
87 -- first bit ordering.
88 -- On a high-order first machine, bit zero of a storage element is
89 -- the most significant bit (interpreting the sequence of bits that
90 -- represent a component as an unsigned integer value).
91 -- On a low-order first machine, bit zero is the least significant.
92 -- In this check, a right shift of one place on a Big Endian machine
93 -- will yield a result of one, while on a Little Endian machine the
94 -- result would be four.
96 TC_Val_Unsigned_8
:= 2;
97 Big_Endian
:= (Shift_Right
(TC_Val_Unsigned_8
, 1) = 1);
100 -- Note: The shifting and rotating subprograms operate on a bit-by-bit
101 -- basis, using the binary representation of the value of the
102 -- operands to yield a binary representation for the result.
104 -- Function Shift_Left.
106 if Big_Endian
then -- High-order first bit ordering.
109 TC_Val_Unsigned_8
:= Unsigned_8
'Last; -- 255.
110 TC_Result_Unsigned_8
:= Shift_Left
(Value
=> TC_Val_Unsigned_8
,
111 Amount
=> TC_Amount
);
112 if TC_Result_Unsigned_8
/= 254 then
113 Report
.Failed
("Incorrect result from BE Shift_Left - 1");
116 if Shift_Left
(TC_Val_Unsigned_8
, 2) /= 252 or
117 Shift_Left
(TC_Val_Unsigned_8
, 3) /= 248 or
118 Shift_Left
(TC_Val_Unsigned_8
, 5) /= 224 or
119 Shift_Left
(TC_Val_Unsigned_8
, 8) /= 0 or
120 Shift_Left
(TC_Val_Unsigned_8
, 9) /= 0 or
121 Shift_Left
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
123 Report
.Failed
("Incorrect result from BE Shift_Left - 2");
126 TC_Val_Unsigned_8
:= 1;
127 if Shift_Left
(TC_Val_Unsigned_8
, 1) /= 2 or
128 Shift_Left
(TC_Val_Unsigned_8
, Amount
=> 3) /= 8
130 Report
.Failed
("Incorrect result from BE Shift_Left - 3");
133 TC_Val_Unsigned_8
:= 7;
134 if Shift_Left
(TC_Val_Unsigned_8
, Amount
=> 4) /= 112 or
135 Shift_Left
(Shift_Left
(TC_Val_Unsigned_8
, 7), 1) /= 0
137 Report
.Failed
("Incorrect result from BE Shift_Left - 4");
140 else -- Low-order first bit ordering.
143 TC_Val_Unsigned_8
:= Unsigned_8
'Last; -- 255.
144 TC_Result_Unsigned_8
:= Shift_Left
(TC_Val_Unsigned_8
, TC_Amount
);
146 if TC_Result_Unsigned_8
/= 127 then
147 Report
.Failed
("Incorrect result from LE Shift_Left - 1");
150 if Shift_Left
(TC_Val_Unsigned_8
, 2) /= 63 or
151 Shift_Left
(TC_Val_Unsigned_8
, 3) /= 31 or
152 Shift_Left
(TC_Val_Unsigned_8
, 5) /= 7 or
153 Shift_Left
(TC_Val_Unsigned_8
, 8) /= 0 or
154 Shift_Left
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
156 Report
.Failed
("Incorrect result from LE Shift_Left - 2");
159 TC_Val_Unsigned_8
:= 1;
160 if Shift_Left
(TC_Val_Unsigned_8
, 1) /= 0 or
161 Shift_Left
(TC_Val_Unsigned_8
, 7) /= 0
163 Report
.Failed
("Incorrect result from LE Shift_Left - 3");
166 TC_Val_Unsigned_8
:= 129;
167 if Shift_Left
(TC_Val_Unsigned_8
, 4) /= 8 or
168 Shift_Left
(Shift_Left
(TC_Val_Unsigned_8
, 7), 1) /= 0
170 Report
.Failed
("Incorrect result from LE Shift_Left - 4");
177 -- Function Shift_Right.
179 if Big_Endian
then -- High-order first bit ordering.
182 TC_Val_Unsigned_8
:= Unsigned_8
'Last; -- 255.
183 TC_Result_Unsigned_8
:= Shift_Right
(TC_Val_Unsigned_8
, TC_Amount
);
185 if TC_Result_Unsigned_8
/= 127 then
186 Report
.Failed
("Incorrect result from BE Shift_Right - 1");
189 if Shift_Right
(TC_Val_Unsigned_8
, 2) /= 63 or
190 Shift_Right
(TC_Val_Unsigned_8
, 3) /= 31 or
191 Shift_Right
(TC_Val_Unsigned_8
, 5) /= 7 or
192 Shift_Right
(TC_Val_Unsigned_8
, 8) /= 0 or
193 Shift_Right
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
195 Report
.Failed
("Incorrect result from BE Shift_Right - 2");
198 TC_Val_Unsigned_8
:= 1;
199 if Shift_Right
(TC_Val_Unsigned_8
, 1) /= 0 or
200 Shift_Right
(TC_Val_Unsigned_8
, 7) /= 0
202 Report
.Failed
("Incorrect result from BE Shift_Right - 3");
205 TC_Val_Unsigned_8
:= 129;
206 if Shift_Right
(TC_Val_Unsigned_8
, 4) /= 8 or
207 Shift_Right
(Shift_Right
(TC_Val_Unsigned_8
, 7), 1) /= 0
209 Report
.Failed
("Incorrect result from BE Shift_Right - 4");
212 else -- Low-order first bit ordering.
215 TC_Val_Unsigned_8
:= Unsigned_8
'Last; -- 255.
216 TC_Result_Unsigned_8
:= Shift_Right
(Value
=> TC_Val_Unsigned_8
,
217 Amount
=> TC_Amount
);
218 if TC_Result_Unsigned_8
/= 254 then
219 Report
.Failed
("Incorrect result from LE Shift_Right - 1");
222 if Shift_Right
(TC_Val_Unsigned_8
, 2) /= 252 or
223 Shift_Right
(TC_Val_Unsigned_8
, 3) /= 248 or
224 Shift_Right
(TC_Val_Unsigned_8
, 5) /= 224 or
225 Shift_Right
(TC_Val_Unsigned_8
, 8) /= 0 or
226 Shift_Right
(TC_Val_Unsigned_8
, 9) /= 0 or
227 Shift_Right
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
229 Report
.Failed
("Incorrect result from LE Shift_Right - 2");
232 TC_Val_Unsigned_8
:= 1;
233 if Shift_Right
(TC_Val_Unsigned_8
, 1) /= 2 or
234 Shift_Right
(TC_Val_Unsigned_8
, Amount
=> 3) /= 8
236 Report
.Failed
("Incorrect result from LE Shift_Right - 3");
239 TC_Val_Unsigned_8
:= 7;
240 if Shift_Right
(TC_Val_Unsigned_8
, Amount
=> 4) /= 112 or
241 Shift_Right
(Shift_Right
(TC_Val_Unsigned_8
, 7), 1) /= 0
243 Report
.Failed
("Incorrect result from LE Shift_Right - 4");
250 -- Tests of Shift_Left and Shift_Right in combination.
252 if Big_Endian
then -- High-order first bit ordering.
254 TC_Val_Unsigned_8
:= 32;
256 if Shift_Left
(Shift_Right
(TC_Val_Unsigned_8
, 2), 2) /=
258 Shift_Left
(Shift_Right
(TC_Val_Unsigned_8
, 1), 3) /= 128 or
259 Shift_Right
(Shift_Left
(TC_Val_Unsigned_8
, 2), 6) /= 2 or
260 Shift_Right
(Shift_Left
(TC_Val_Unsigned_8
, 2), 8) /= 0
262 Report
.Failed
("Incorrect result from BE Shift_Left - " &
263 "Shift_Right functions used in combination");
266 else -- Low-order first bit ordering.
268 TC_Val_Unsigned_8
:= 32;
270 if Shift_Left
(Shift_Right
(TC_Val_Unsigned_8
, 2), 2) /=
272 Shift_Left
(Shift_Right
(TC_Val_Unsigned_8
, 1), 3) /= 8 or
273 Shift_Right
(Shift_Left
(TC_Val_Unsigned_8
, 2), 3) /= 64 or
274 Shift_Right
(Shift_Left
(TC_Val_Unsigned_8
, 2), 4) /= 128
276 Report
.Failed
("Incorrect result from LE Shift_Left - " &
277 "Shift_Right functions used in combination");
284 -- Function Shift_Right_Arithmetic.
286 if Big_Endian
then -- High-order first bit ordering.
288 -- Case where the parameter Value is less than
289 -- one half of the modulus. Zero bits will be shifted in.
290 -- Modulus of type Unsigned_8 is 256; half of the modulus is 128.
293 TC_Val_Unsigned_8
:= 127; -- Less than one half of modulus.
294 TC_Result_Unsigned_8
:= Shift_Right_Arithmetic
(TC_Val_Unsigned_8
,
296 if TC_Result_Unsigned_8
/= 63 then
298 ("Incorrect result from BE Shift_Right_Arithmetic - 1");
301 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 2) /= 31 or
302 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 3) /= 15 or
303 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 5) /= 3 or
304 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 8) /= 0 or
305 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
308 ("Incorrect result from BE Shift_Right_Arithmetic - 2");
311 TC_Val_Unsigned_8
:= 1;
312 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, Amount
=> 1) /= 0 or
313 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 3) /= 0
316 ("Incorrect result from BE Shift_Right_Arithmetic - 3");
319 -- Case where the parameter Value is greater than or equal to
320 -- one half of the modulus. One bits will be shifted in.
323 TC_Val_Unsigned_8
:= 128; -- One half of modulus.
324 TC_Result_Unsigned_8
:= Shift_Right_Arithmetic
(TC_Val_Unsigned_8
,
325 Amount
=> TC_Amount
);
326 if TC_Result_Unsigned_8
/= 192 then
328 ("Incorrect result from BE Shift_Right_Arithmetic - 4");
332 TC_Val_Unsigned_8
:= 129; -- Greater than one half of modulus.
333 TC_Result_Unsigned_8
:= Shift_Right_Arithmetic
(TC_Val_Unsigned_8
,
334 Amount
=> TC_Amount
);
335 if TC_Result_Unsigned_8
/= 192 then
337 ("Incorrect result from BE Shift_Right_Arithmetic - 5");
340 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 2) /= 224 or
341 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 3) /= 240 or
342 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 5) /= 252 or
343 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 7) /= Unsigned_8
'Last or
344 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
347 ("Incorrect result from BE Shift_Right_Arithmetic - 6");
350 TC_Val_Unsigned_8
:= Unsigned_8
'Last;
351 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 1) /=
355 ("Incorrect result from BE Shift_Right_Arithmetic - 7");
358 else -- Low-order first bit ordering
360 -- Case where the parameter Value is less than
361 -- one half of the modulus. Zero bits will be shifted in.
364 TC_Val_Unsigned_8
:= 127; -- Less than one half of modulus.
365 TC_Result_Unsigned_8
:= Shift_Right_Arithmetic
(TC_Val_Unsigned_8
,
367 if TC_Result_Unsigned_8
/= 254 then
369 ("Incorrect result from LE Shift_Right_Arithmetic - 1");
372 TC_Val_Unsigned_8
:= 2;
373 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 2) /= 8 or
374 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 3) /= 16 or
375 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 5) /= 64 or
376 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 8) /= 0 or
377 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
380 ("Incorrect result from LE Shift_Right_Arithmetic - 2");
383 TC_Val_Unsigned_8
:= 64;
384 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, Amount
=> 1) /= 128 or
385 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 3) /= 0
388 ("Incorrect result from LE Shift_Right_Arithmetic - 3");
391 -- Case where the parameter Value is greater than or equal to
392 -- one half of the modulus. One bits will be shifted in.
395 TC_Val_Unsigned_8
:= 128; -- One half of modulus.
396 TC_Result_Unsigned_8
:= Shift_Right_Arithmetic
(TC_Val_Unsigned_8
,
397 Amount
=> TC_Amount
);
399 if TC_Result_Unsigned_8
/= 3 then
401 ("Incorrect result from LE Shift_Right_Arithmetic - 4");
405 TC_Val_Unsigned_8
:= 129; -- Greater than one half of modulus.
406 TC_Result_Unsigned_8
:= Shift_Right_Arithmetic
(TC_Val_Unsigned_8
,
407 Amount
=> TC_Amount
);
409 if TC_Result_Unsigned_8
/= 3 then
411 ("Incorrect result from LE Shift_Right_Arithmetic - 5");
414 TC_Val_Unsigned_8
:= 135; -- Greater than one half of modulus.
415 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 2) /= 31 or
416 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 3) /= 63 or
417 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 5) /= Unsigned_8
'Last or
418 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 7) /= Unsigned_8
'Last or
419 Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
422 ("Incorrect result from LE Shift_Right_Arithmetic - 6");
425 TC_Val_Unsigned_8
:= Unsigned_8
'Last;
426 if Shift_Right_Arithmetic
(TC_Val_Unsigned_8
, 1) /=
430 ("Incorrect result from LE Shift_Right_Arithmetic - 7");
437 -- Function Rotate_Left.
439 if Big_Endian
then -- High-order first bit ordering.
442 TC_Val_Unsigned_8
:= 129;
443 TC_Result_Unsigned_8
:= Rotate_Left
(Value
=> TC_Val_Unsigned_8
,
444 Amount
=> TC_Amount
);
445 if TC_Result_Unsigned_8
/= 3 then
446 Report
.Failed
("Incorrect result from BE Rotate_Left - 1");
449 if Rotate_Left
(TC_Val_Unsigned_8
, 2) /= 6 or
450 Rotate_Left
(TC_Val_Unsigned_8
, 3) /= 12 or
451 Rotate_Left
(TC_Val_Unsigned_8
, 5) /= 48 or
452 Rotate_Left
(TC_Val_Unsigned_8
, 8) /= 129 or
453 Rotate_Left
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
455 Report
.Failed
("Incorrect result from BE Rotate_Left - 2");
458 TC_Val_Unsigned_8
:= 1;
459 if Rotate_Left
(Value
=> TC_Val_Unsigned_8
, Amount
=> 1) /= 2 or
460 Rotate_Left
(TC_Val_Unsigned_8
, Amount
=> 3) /= 8
462 Report
.Failed
("Incorrect result from BE Rotate_Left - 3");
465 TC_Val_Unsigned_8
:= 82;
466 if Rotate_Left
(TC_Val_Unsigned_8
, Amount
=> 4) /= 37 or
467 Rotate_Left
(Rotate_Left
(TC_Val_Unsigned_8
, 7), 1) /= 82
469 Report
.Failed
("Incorrect result from BE Rotate_Left - 4");
472 else -- Low-order first bit ordering.
475 TC_Val_Unsigned_8
:= 1;
476 TC_Result_Unsigned_8
:= Rotate_Left
(TC_Val_Unsigned_8
, TC_Amount
);
478 if TC_Result_Unsigned_8
/= 128 then
479 Report
.Failed
("Incorrect result from LE Rotate_Left - 1");
482 TC_Val_Unsigned_8
:= 15;
483 if Rotate_Left
(TC_Val_Unsigned_8
, 2) /= 195 or
484 Rotate_Left
(TC_Val_Unsigned_8
, 3) /= 225 or
485 Rotate_Left
(TC_Val_Unsigned_8
, 5) /= 120 or
486 Rotate_Left
(TC_Val_Unsigned_8
, 8) /= TC_Val_Unsigned_8
or
487 Rotate_Left
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
489 Report
.Failed
("Incorrect result from LE Rotate_Left - 2");
492 TC_Val_Unsigned_8
:= Unsigned_8
'Last;
493 if Rotate_Left
(TC_Val_Unsigned_8
, 1) /= Unsigned_8
'Last then
494 Report
.Failed
("Incorrect result from LE Rotate_Left - 3");
497 TC_Val_Unsigned_8
:= 12;
498 if Rotate_Left
(TC_Val_Unsigned_8
, 1) /= 6 or
499 Rotate_Left
(TC_Val_Unsigned_8
, 3) /= 129
501 Report
.Failed
("Incorrect result from LE Rotate_Left - 4");
504 TC_Val_Unsigned_8
:= 129;
505 if Rotate_Left
(TC_Val_Unsigned_8
, 4) /= 24 or
506 Rotate_Left
(Rotate_Left
(TC_Val_Unsigned_8
, 7), 1) /= 129
508 Report
.Failed
("Incorrect result from LE Rotate_Left - 5");
515 -- Function Rotate_Right.
517 if Big_Endian
then -- High-order first bit ordering.
520 TC_Val_Unsigned_8
:= 1;
521 TC_Result_Unsigned_8
:= Rotate_Right
(TC_Val_Unsigned_8
, TC_Amount
);
523 if TC_Result_Unsigned_8
/= 128 then
524 Report
.Failed
("Incorrect result from BE Rotate_Right - 1");
527 TC_Val_Unsigned_8
:= 15;
528 if Rotate_Right
(TC_Val_Unsigned_8
, 2) /= 195 or
529 Rotate_Right
(TC_Val_Unsigned_8
, 3) /= 225 or
530 Rotate_Right
(TC_Val_Unsigned_8
, 5) /= 120 or
531 Rotate_Right
(TC_Val_Unsigned_8
, 8) /= TC_Val_Unsigned_8
or
532 Rotate_Right
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
534 Report
.Failed
("Incorrect result from BE Rotate_Right - 2");
537 TC_Val_Unsigned_8
:= Unsigned_8
'Last;
538 if Rotate_Right
(TC_Val_Unsigned_8
, 1) /= Unsigned_8
'Last then
539 Report
.Failed
("Incorrect result from BE Rotate_Right - 3");
542 TC_Val_Unsigned_8
:= 12;
543 if Rotate_Right
(TC_Val_Unsigned_8
, 1) /= 6 or
544 Rotate_Right
(TC_Val_Unsigned_8
, 3) /= 129
546 Report
.Failed
("Incorrect result from BE Rotate_Right - 4");
549 TC_Val_Unsigned_8
:= 129;
550 if Rotate_Right
(TC_Val_Unsigned_8
, 4) /= 24 or
551 Rotate_Right
(Rotate_Right
(TC_Val_Unsigned_8
, 7), 1) /= 129
553 Report
.Failed
("Incorrect result from BE Rotate_Right - 5");
556 else -- Low-order first bit ordering.
559 TC_Val_Unsigned_8
:= 129;
560 TC_Result_Unsigned_8
:= Rotate_Right
(Value
=> TC_Val_Unsigned_8
,
561 Amount
=> TC_Amount
);
562 if TC_Result_Unsigned_8
/= 3 then
563 Report
.Failed
("Incorrect result from LE Rotate_Right - 1");
566 if Rotate_Right
(TC_Val_Unsigned_8
, 2) /= 6 or
567 Rotate_Right
(TC_Val_Unsigned_8
, 3) /= 12 or
568 Rotate_Right
(TC_Val_Unsigned_8
, 5) /= 48 or
569 Rotate_Right
(TC_Val_Unsigned_8
, 8) /= 129 or
570 Rotate_Right
(TC_Val_Unsigned_8
, 0) /= TC_Val_Unsigned_8
572 Report
.Failed
("Incorrect result from LE Rotate_Right - 2");
575 TC_Val_Unsigned_8
:= 1;
576 if Rotate_Right
(Value
=> TC_Val_Unsigned_8
, Amount
=> 1) /= 2 or
577 Rotate_Right
(TC_Val_Unsigned_8
, Amount
=> 3) /= 8
579 Report
.Failed
("Incorrect result from LE Rotate_Right - 3");
582 TC_Val_Unsigned_8
:= 82;
583 if Rotate_Right
(TC_Val_Unsigned_8
, Amount
=> 4) /= 37 or
584 Rotate_Right
(Rotate_Right
(TC_Val_Unsigned_8
, 7), 1) /= 82
586 Report
.Failed
("Incorrect result from LE Rotate_Right - 4");
593 -- Tests of Rotate_Left and Rotate_Right in combination.
595 if Big_Endian
then -- High-order first bit ordering.
597 TC_Val_Unsigned_8
:= 17;
599 if Rotate_Left
(Rotate_Right
(TC_Val_Unsigned_8
, 2), 2) /=
601 Rotate_Left
(Rotate_Right
(TC_Val_Unsigned_8
, 1), 3) /= 68 or
602 Rotate_Right
(Rotate_Left
(TC_Val_Unsigned_8
, 3), 7) /= 17 or
603 Rotate_Right
(Rotate_Left
(TC_Val_Unsigned_8
, 2), 8) /= 68
605 Report
.Failed
("Incorrect result from BE Rotate_Left - " &
606 "Rotate_Right functions used in combination");
609 else -- Low-order first bit ordering.
611 TC_Val_Unsigned_8
:= 4;
613 if Rotate_Left
(Rotate_Right
(TC_Val_Unsigned_8
, 2), 2) /=
615 Rotate_Left
(Rotate_Right
(TC_Val_Unsigned_8
, 1), 3) /= 1 or
616 Rotate_Right
(Rotate_Left
(TC_Val_Unsigned_8
, 3), 7) /= 64 or
617 Rotate_Right
(Rotate_Left
(TC_Val_Unsigned_8
, 2), 8) /= 1
619 Report
.Failed
("Incorrect result from LE Rotate_Left - " &
620 "Rotate_Right functions used in combination");
626 when The_Error
: others =>
627 Report
.Failed
("The following exception was raised in the " &
628 "Test_Block: " & Exception_Name
(The_Error
));