Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion src/cdomain/value/cdomains/floatDomain.ml
Original file line number Diff line number Diff line change
Expand Up @@ -220,7 +220,9 @@ module FloatIntervalImpl(Float_t : CFloatType) = struct
| _ -> Top

(**for QCheck: should describe how to generate random values and shrink possible counter examples *)
let arbitrary () = QCheck.map convert_arb (QCheck.option (QCheck.pair QCheck.float QCheck.float))
let arbitrary () =
let gen = QCheck.map convert_arb (QCheck.option (QCheck.pair QCheck.float QCheck.float)) in
QCheck.set_print show gen

let of_interval' interval =
let x = norm @@ Interval interval
Expand Down
5 changes: 4 additions & 1 deletion tests/unit/cdomains/floatDomainTest.ml
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,10 @@ struct

let test_FI_div_zero_result_top =
QCheck.Test.make ~name:"test_FI_div_zero_result_top" (FI.arbitrary ()) (fun arg ->
FI.is_top (FI.div arg (FI.of_const 0.)))
let res = FI.div arg (FI.of_const 0.) in
if FI.equal arg fi_zero
then FI.equal res (FI.nan ())
else FI.is_top res)

let test_FI_accurate_neg =
QCheck.Test.make ~name:"test_FI_accurate_neg" QCheck.float (fun arg ->
Expand Down
Loading