Skip to content

Commit 34c1199

Browse files
committed
Adjust test_FI_div_zero_result_top property to account for the 0/0 case
1 parent ef71e73 commit 34c1199

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

tests/unit/cdomains/floatDomainTest.ml

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -265,7 +265,10 @@ struct
265265

266266
let test_FI_div_zero_result_top =
267267
QCheck.Test.make ~name:"test_FI_div_zero_result_top" (FI.arbitrary ()) (fun arg ->
268-
FI.is_top (FI.div arg (FI.of_const 0.)))
268+
let res = FI.div arg (FI.of_const 0.) in
269+
if FI.equal arg fi_zero
270+
then FI.equal res (FI.nan ())
271+
else FI.is_top res)
269272

270273
let test_FI_accurate_neg =
271274
QCheck.Test.make ~name:"test_FI_accurate_neg" QCheck.float (fun arg ->

0 commit comments

Comments
 (0)