Commit 9fb7733e authored by Stephane Glondu's avatar Stephane Glondu

More diagnostics in verify-diff

parent 615d8273
......@@ -174,6 +174,10 @@ let verifydiff dir1 dir2 =
if not (GMap.for_all (fun pk _ -> GMap.mem pk ballots2) ballots1) then
raise (VerifydiffError DecreasingBallots)
in
let () =
let n = GMap.cardinal ballots2 - GMap.cardinal ballots1 in
if n > 0 then Printf.eprintf "I: %d new ballot(s)\n%!" n
in
(* the keys of modified ballots have not been replaced *)
let () =
if not (GMap.for_all (fun pk ballot1 ->
......@@ -182,4 +186,12 @@ let verifydiff dir1 dir2 =
) ballots1)
then raise (VerifydiffError BallotSignedByReplacedKey)
in
let () =
let n = GMap.fold (fun pk ballot1 accu ->
let ballot2 = GMap.find pk ballots2 in
if ballot1 <> ballot2 then accu + 1 else accu
) ballots1 0
in
if n > 0 then Printf.eprintf "W: %d ballot(s) have been replaced\n%!" n
in
Printf.eprintf "I: all tests passed!\n%!"
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment