-
+ 517C943163381E304EC2FBA2BF3FEE8C7E7EBEBBDEC618DB613F94F9ABD3DEB6DF1CCF061E2FB55DDBA367AD34924CCB53EED35A1E2240FDB6A1003ED6023F98
eucrypt/crc32/tests/test_crc32.adb
(0 . 0)(1 . 39)
359 ------------------------------------------------------------------------------
360 ------------------------------------------------------------------------------
361 -- This file is part of 'CRC32' --
362 -- --
363 -- You do not have, nor can you ever acquire the right to use, copy or --
364 -- distribute this software ; Should you use this software for any purpose, --
365 -- or copy and distribute it to anyone or in any manner, you are breaking --
366 -- the laws of whatever soi-disant jurisdiction, and you promise to --
367 -- continue doing so for the indefinite future. In any case, please --
368 -- always : read and understand any software ; verify any PGP signatures --
369 -- that you use - for any purpose. --
370 -- --
371 -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . --
372 ------------------------------------------------------------------------------
373 ------------------------------------------------------------------------------
374
375 -- Basic test for the CRC32 implementation
376 -- S.MG, 2018
377
378 with Ada.Text_IO; use Ada.Text_IO;
379 with Interfaces; use Interfaces;
380 with CRC32;
381
382 procedure Test_CRC32 is
383 Input : constant String := "123456789";
384 Expected : constant Unsigned_32 := 16#CBF4_3926#;
385 Output : Unsigned_32;
386 begin
387 Output := CRC32.CRC(Input);
388 if Output /= Expected then
389 Put_Line("FAIL: CRC32(" & Input & ") returned " &
390 Unsigned_32'Image(Output) & " instead of " &
391 Unsigned_32'Image(Expected));
392 else
393 Put_Line("PASS: CRC32(" & Input & ") returned " &
394 Unsigned_32'Image(Output) & " as expected.");
395 end if;
396
397 end Test_CRC32;