Skip to content

Commit

Permalink
harder tests of stability
Browse files Browse the repository at this point in the history
  • Loading branch information
Niols committed May 5, 2021
1 parent c0a9c19 commit a2923a2
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions tests/arrays.ml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,7 @@ let test_one_stable sorter =
for log2_len = 1 to 5 do
let len = 1 lsl (3 * log2_len) in
Format.printf "[%d] @?" len;
test_stable ~sort:sorter.sorter ~gen:gen_unif ~nb ~len;
test_stable ~sort:sorter.sorter ~gen:(gen_k_runs 5) ~nb ~len
test_stable ~sort:sorter.sorter ~gen:(gen_unif ~limit:(len / 4)) ~nb ~len;
done;
Format.printf "done.@."
with
Expand Down
6 changes: 4 additions & 2 deletions tests/genlib/genarray.ml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
let gen_unif len =
Array.init len (fun _ -> Random.bits ())
let max_random_int = (1 lsl 30) - 1

let gen_unif ?(limit=max_random_int) len =
Array.init len (fun _ -> Random.int limit)

let gen_run ~asc t ofs len =
let (+-), limit =
Expand Down

0 comments on commit a2923a2

Please sign in to comment.