-
+ 517C943163381E304EC2FBA2BF3FEE8C7E7EBEBBDEC618DB613F94F9ABD3DEB6DF1CCF061E2FB55DDBA367AD34924CCB53EED35A1E2240FDB6A1003ED6023F98
eucrypt/crc32/tests/test_crc32.adb
(0 . 0)(1 . 39)
422 ------------------------------------------------------------------------------
423 ------------------------------------------------------------------------------
424 -- This file is part of 'CRC32' --
425 -- --
426 -- You do not have, nor can you ever acquire the right to use, copy or --
427 -- distribute this software ; Should you use this software for any purpose, --
428 -- or copy and distribute it to anyone or in any manner, you are breaking --
429 -- the laws of whatever soi-disant jurisdiction, and you promise to --
430 -- continue doing so for the indefinite future. In any case, please --
431 -- always : read and understand any software ; verify any PGP signatures --
432 -- that you use - for any purpose. --
433 -- --
434 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
435 ------------------------------------------------------------------------------
436 ------------------------------------------------------------------------------
437
438 -- Basic test for the CRC32 implementation
439 -- S.MG, 2018
440
441 with Ada.Text_IO; use Ada.Text_IO;
442 with Interfaces; use Interfaces;
443 with CRC32;
444
445 procedure Test_CRC32 is
446 Input : constant String := "123456789";
447 Expected : constant Unsigned_32 := 16#CBF4_3926#;
448 Output : Unsigned_32;
449 begin
450 Output := CRC32.CRC(Input);
451 if Output /= Expected then
452 Put_Line("FAIL: CRC32(" & Input & ") returned " &
453 Unsigned_32'Image(Output) & " instead of " &
454 Unsigned_32'Image(Expected));
455 else
456 Put_Line("PASS: CRC32(" & Input & ") returned " &
457 Unsigned_32'Image(Output) & " as expected.");
458 end if;
459
460 end Test_CRC32;