@@ -7,72 +7,42 @@ let make ~name (module M : Checkseum.S) input expected =
77 fun () ->
88 Alcotest. check checkseum name
99 M. (digest_string input 0 (String. length input) default)
10- expected )
10+ M. (of_int32 expected) )
1111
1212let () =
1313 Alcotest. run " checkseum"
1414 [
1515 ( " crc32c" ,
1616 [
17- make ~name: " 0" (module Checkseum. Crc32c ) " " Optint. zero;
18- make ~name: " 1"
19- (module Checkseum. Crc32c )
20- " \x00 "
21- (Optint. of_unsigned_int32 0x527d5351l );
17+ make ~name: " 0" (module Checkseum. Crc32c ) " " 0l ;
18+ make ~name: " 1" (module Checkseum. Crc32c ) " \x00 " 0x527d5351l ;
2219 make ~name: " 2"
2320 (module Checkseum. Crc32c )
24- " \xff\xff\xff\xff "
25- (Optint. of_unsigned_int32 0xffffffffl );
26- make ~name: " 3"
27- (module Checkseum. Crc32c )
28- " 123456789"
29- (Optint. of_unsigned_int32 0xe3069283l );
21+ " \xff\xff\xff\xff " 0xffffffffl ;
22+ make ~name: " 3" (module Checkseum. Crc32c ) " 123456789" 0xe3069283l ;
3023 make ~name: " 4"
3124 (module Checkseum. Crc32c )
32- " Thou hast made me, and shall thy work decay?"
33- (Optint. of_unsigned_int32 0x866374c0l );
25+ " Thou hast made me, and shall thy work decay?" 0x866374c0l ;
3426 ] );
3527 ( " crc32" ,
3628 [
37- make ~name: " 0" (module Checkseum. Crc32 ) " " Optint. zero;
38- make ~name: " 1"
39- (module Checkseum. Crc32 )
40- " \x00 "
41- (Optint. of_unsigned_int32 0xd202ef8dl );
42- make ~name: " 2"
43- (module Checkseum. Crc32 )
44- " \xff\xff\xff\xff "
45- (Optint. of_unsigned_int32 0xffffffffl );
46- make ~name: " 3"
47- (module Checkseum. Crc32 )
48- " 123456789"
49- (Optint. of_unsigned_int32 0xcbf43926l );
29+ make ~name: " 0" (module Checkseum. Crc32 ) " " 0l ;
30+ make ~name: " 1" (module Checkseum. Crc32 ) " \x00 " 0xd202ef8dl ;
31+ make ~name: " 2" (module Checkseum. Crc32 ) " \xff\xff\xff\xff " 0xffffffffl ;
32+ make ~name: " 3" (module Checkseum. Crc32 ) " 123456789" 0xcbf43926l ;
5033 make ~name: " 4"
5134 (module Checkseum. Crc32 )
52- " Thou hast made me, and shall thy work decay?"
53- (Optint. of_unsigned_int32 0xf1fabe1dl );
35+ " Thou hast made me, and shall thy work decay?" 0xf1fabe1dl ;
5436 make ~name: " 5"
5537 (module Checkseum. Crc32 )
5638 (String. concat " %" (List. init 1000 (const " abcdef" )))
57- ( Optint. of_unsigned_int32 0xadc436fl ) ;
39+ 0xadc436fl ;
5840 ] );
5941 ( " crc24" ,
6042 [
61- make ~name: " 0"
62- (module Checkseum. Crc24 )
63- " "
64- (Optint. of_unsigned_int32 0xb704cel );
65- make ~name: " 1"
66- (module Checkseum. Crc24 )
67- " a"
68- (Optint. of_unsigned_int32 0xf25713l );
69- make ~name: " 2"
70- (module Checkseum. Crc24 )
71- " abc"
72- (Optint. of_unsigned_int32 0xba1c7bl );
73- make ~name: " 3"
74- (module Checkseum. Crc24 )
75- " message digest"
76- (Optint. of_unsigned_int32 0xdbf0b6l );
43+ make ~name: " 0" (module Checkseum. Crc24 ) " " 0xb704cel ;
44+ make ~name: " 1" (module Checkseum. Crc24 ) " a" 0xf25713l ;
45+ make ~name: " 2" (module Checkseum. Crc24 ) " abc" 0xba1c7bl ;
46+ make ~name: " 3" (module Checkseum. Crc24 ) " message digest" 0xdbf0b6l ;
7747 ] );
7848 ]
0 commit comments