From 5a00eb24648141079207a71ca2a7c8bcf679c08a Mon Sep 17 00:00:00 2001 From: Max Lang <17551908+just-max@users.noreply.github.com> Date: Mon, 13 May 2024 05:13:54 +0200 Subject: [PATCH] ounit util: fix signed division (pathological case) --- src/test-lib/oUnit_util.ml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/test-lib/oUnit_util.ml b/src/test-lib/oUnit_util.ml index 461cb22..c3e3b96 100644 --- a/src/test-lib/oUnit_util.ml +++ b/src/test-lib/oUnit_util.ml @@ -53,7 +53,7 @@ let of_qcheck ?(timeout = default_qcheck_timeout) (QCheck2.Test.Test cell) = let test_length = let open Mtime.Span in let timeout_ns = to_uint64_ns timeout in - let extra = Int64.(div timeout_ns (of_int 4)) |> of_uint64_ns in + let extra = Int64.(unsigned_div timeout_ns 4L) |> of_uint64_ns in Custom_length (add timeout extra |> Util.span_to_float_s) in name >: TestCase (test_length, test_fun)