Tests moved to 'lib-digest'
git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10237 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02master
parent
ead8077dae
commit
40b7371af9
|
@ -0,0 +1,6 @@
|
||||||
|
MODULES=
|
||||||
|
MAIN_MODULE=md5
|
||||||
|
ADD_COMPFLAGS=-w a
|
||||||
|
|
||||||
|
include ../../makefiles/Makefile.one
|
||||||
|
include ../../makefiles/Makefile.common
|
|
@ -208,12 +208,14 @@ let _ =
|
||||||
then printf "Test vectors passed.\n";
|
then printf "Test vectors passed.\n";
|
||||||
flush stdout;
|
flush stdout;
|
||||||
(* Benchmark *)
|
(* Benchmark *)
|
||||||
let s = String.make 50000 'a' in
|
if (Array.length Sys.argv) > 1 && (Sys.argv.(1) = "-benchmark") then begin
|
||||||
let num_iter = 1000 in
|
let s = String.make 50000 'a' in
|
||||||
time "Caml implementation" num_iter
|
let num_iter = 1000 in
|
||||||
(fun () ->
|
time "Caml implementation" num_iter
|
||||||
let ctx = init() in
|
(fun () ->
|
||||||
update ctx s 0 (String.length s);
|
let ctx = init() in
|
||||||
ignore (finish ctx));
|
update ctx s 0 (String.length s);
|
||||||
time "C implementation" num_iter
|
ignore (finish ctx));
|
||||||
(fun () -> ignore (Digest.string s))
|
time "C implementation" num_iter
|
||||||
|
(fun () -> ignore (Digest.string s))
|
||||||
|
end
|
|
@ -0,0 +1 @@
|
||||||
|
Test vectors passed.
|
Loading…
Reference in New Issue