Tests moved to 'lib-digest'

git-svn-id: http://caml.inria.fr/svn/ocaml/trunk@10237 f963ae5c-01c2-4b8c-9fe0-0dff7051ff02
master
Xavier Clerc 2010-04-07 10:17:57 +00:00
parent ead8077dae
commit 40b7371af9
3 changed files with 18 additions and 9 deletions

View File

@ -0,0 +1,6 @@
MODULES=
MAIN_MODULE=md5
ADD_COMPFLAGS=-w a
include ../../makefiles/Makefile.one
include ../../makefiles/Makefile.common

View File

@ -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

View File

@ -0,0 +1 @@
Test vectors passed.