From 7ee593b1a25df64fb1ecc59325d775b073ff6fad Mon Sep 17 00:00:00 2001 From: Keryan Didier Date: Tue, 30 May 2023 17:07:39 +0200 Subject: [PATCH] Fix anomalies reporting in dump comparisons --- examples/dgfip_c/ml_primitif/ml_driver/main.ml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/examples/dgfip_c/ml_primitif/ml_driver/main.ml b/examples/dgfip_c/ml_primitif/ml_driver/main.ml index 3cb244287..9452cb713 100644 --- a/examples/dgfip_c/ml_primitif/ml_driver/main.ml +++ b/examples/dgfip_c/ml_primitif/ml_driver/main.ml @@ -91,7 +91,8 @@ let compare_dump out outexp = let rec read_strings ic strs = try let str = read64 ic in - StrSet.add (Bytes.to_string str) strs + let strs = StrSet.add (Bytes.to_string str) strs in + read_strings ic strs with | End_of_file -> strs in @@ -111,10 +112,11 @@ let compare_dump out outexp = else string_of_float(Int64.float_of_bits i64) in List.iter (fun (var, res, exp) -> - Printf.eprintf "%s: %s found, expected %s\n%!" + Printf.eprintf "%s: %s found, expected %s\n" var (hex2floatstr res) (hex2floatstr exp) ) diffs; + flush stderr; close_in out; close_in outexp