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";
|
||||
flush stdout;
|
||||
(* Benchmark *)
|
||||
let s = String.make 50000 'a' in
|
||||
let num_iter = 1000 in
|
||||
time "Caml implementation" num_iter
|
||||
(fun () ->
|
||||
let ctx = init() in
|
||||
update ctx s 0 (String.length s);
|
||||
ignore (finish ctx));
|
||||
time "C implementation" num_iter
|
||||
(fun () -> ignore (Digest.string s))
|
||||
if (Array.length Sys.argv) > 1 && (Sys.argv.(1) = "-benchmark") then begin
|
||||
let s = String.make 50000 'a' in
|
||||
let num_iter = 1000 in
|
||||
time "Caml implementation" num_iter
|
||||
(fun () ->
|
||||
let ctx = init() in
|
||||
update ctx s 0 (String.length s);
|
||||
ignore (finish ctx));
|
||||
time "C implementation" num_iter
|
||||
(fun () -> ignore (Digest.string s))
|
||||
end
|
|
@ -0,0 +1 @@
|
|||
Test vectors passed.
|
Loading…
Reference in New Issue