------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- This file is part of 'CRC32' -- -- -- -- You do not have, nor can you ever acquire the right to use, copy or -- -- distribute this software ; Should you use this software for any purpose, -- -- or copy and distribute it to anyone or in any manner, you are breaking -- -- the laws of whatever soi-disant jurisdiction, and you promise to -- -- continue doing so for the indefinite future. In any case, please -- -- always : read and understand any software ; verify any PGP signatures -- -- that you use - for any purpose. -- -- -- -- See also http://trilema.com/2015/a-new-software-licensing-paradigm . -- ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ -- Basic test for the CRC32 implementation -- S.MG, 2018 with Ada.Text_IO; use Ada.Text_IO; with Interfaces; use Interfaces; with CRC32; procedure Test_CRC32 is Input : constant String := "123456789"; Expected : constant Unsigned_32 := 16#CBF4_3926#; Output : Unsigned_32; begin Output := CRC32.CRC(Input); if Output /= Expected then Put_Line("FAIL: CRC32(" & Input & ") returned " & Unsigned_32'Image(Output) & " instead of " & Unsigned_32'Image(Expected)); else Put_Line("PASS: CRC32(" & Input & ") returned " & Unsigned_32'Image(Output) & " as expected."); end if; end Test_CRC32;