Skip to content

Commit 77d0264

Browse files
committed
Fix unit test compilation with suppress_ovwarn changes
1 parent 2e44691 commit 77d0264

File tree

5 files changed

+21
-11
lines changed

5 files changed

+21
-11
lines changed

src/domains/intDomainProperties.ml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,19 @@ sig
2323
end
2424

2525
module type S = IntDomain.S with type int_t = Z.t
26+
module type S2 = IntDomain.S2 with type int_t = Z.t
27+
28+
module MakeS2 (I: S): S2 =
29+
struct
30+
include I
31+
32+
let starting ?suppress_ovwarn ik x = starting ik x
33+
let ending ?suppress_ovwarn ik x = ending ik x
34+
let of_interval ?suppress_ovwarn ik x = of_interval ik x
35+
end
2636

2737
(* TODO: deduplicate with IntDomain, extension of IntDomWithDefaultIkind, inverse of OldDomainFacade? *)
28-
module WithIkind (I: S) (Ik: IntDomain.Ikind): OldSWithIkind =
38+
module WithIkind (I: S2) (Ik: IntDomain.Ikind): OldSWithIkind =
2939
struct
3040
include I
3141
module Ikind = Ik

tests/unit/cdomains/intDomainTest.ml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -115,11 +115,11 @@ end
115115
module Ikind = struct let ikind () = Cil.ILong end
116116
module A = IntTest (IntDomain.Integers (IntOps.BigIntOps))
117117
module B = IntTest (IntDomain.Flat (IntDomain.Integers (IntOps.BigIntOps)))
118-
module C = IntTest (IntDomainProperties.WithIkind (IntDomain.DefExc) (Ikind))
118+
module C = IntTest (IntDomainProperties.WithIkind (IntDomainProperties.MakeS2 (IntDomain.DefExc)) (Ikind))
119119

120120
module D = struct
121121
module T = struct
122-
include IntDomainProperties.WithIkind (IntDomain.DefExc) (Ikind)
122+
include IntDomainProperties.WithIkind (IntDomainProperties.MakeS2 (IntDomain.DefExc)) (Ikind)
123123
let of_excl_list xs = of_excl_list Cil.ILong xs
124124
end
125125

tests/unit/cdomains/lvalTest.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ open Goblint_lib
22
open OUnit2
33
open GoblintCil
44

5-
module ID = IntDomain.IntDomWithDefaultIkind (IntDomain.IntDomLifter (IntDomain.DefExc)) (IntDomain.PtrDiffIkind)
5+
module ID = IntDomain.IntDomWithDefaultIkind (IntDomain.IntDomLifter (IntDomainProperties.MakeS2 (IntDomain.DefExc))) (IntDomain.PtrDiffIkind)
66
module Offs = Offset.MakeLattice (ID)
77
module LV = AddressDomain.AddressLattice (Mval.MakeLattice (Offs))
88

tests/unit/maindomaintest.ml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ let domains: (module Lattice.S) list = [
4141

4242
let nonAssocDomains: (module Lattice.S) list = []
4343

44-
let intDomains: (module IntDomainProperties.S) list = [
44+
let intDomains: (module IntDomainProperties.S2) list = [
4545
(module IntDomain.SOverflowUnlifter(IntDomain.Interval));
46-
(module IntDomain.Enums);
47-
(module IntDomain.Congruence);
46+
(module IntDomainProperties.MakeS2 (IntDomain.Enums));
47+
(module IntDomainProperties.MakeS2 (IntDomain.Congruence));
4848
(module IntDomain.SOverflowUnlifter(IntDomain.IntervalSet));
4949
(module IntDomain.SOverflowUnlifter(IntDomain.Bitfield));
5050
(* (module IntDomain.Flattened); *)
@@ -53,8 +53,8 @@ let intDomains: (module IntDomainProperties.S) list = [
5353
(* (module IntDomain.IntDomTuple); *)
5454
]
5555

56-
let nonAssocIntDomains: (module IntDomainProperties.S) list = [
57-
(module IntDomain.DefExc);
56+
let nonAssocIntDomains: (module IntDomainProperties.S2) list = [
57+
(module IntDomainProperties.MakeS2 (IntDomain.DefExc));
5858
]
5959

6060
(* TODO: make arbitrary ikind part of domain test for better efficiency *)
@@ -91,7 +91,7 @@ let nonAssocTestsuite =
9191
let old_intdomains intDomains =
9292
BatList.cartesian_product intDomains ikinds
9393
|> List.map (fun (d, ik) ->
94-
let module D = (val d: IntDomainProperties.S) in
94+
let module D = (val d: IntDomainProperties.S2) in
9595
let module Ikind = struct let ikind () = ik end in
9696
(module IntDomainProperties.WithIkind (D) (Ikind): IntDomainProperties.OldSWithIkind)
9797
)

tests/unit/solver/solverTest.ml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ end
2323

2424
(* domain is (reversed) integers *)
2525
module Ikind = struct let ikind () = Cil.ILong end
26-
module Int = IntDomainProperties.WithIkind (IntDomain.DefExc) (Ikind)
26+
module Int = IntDomainProperties.WithIkind (IntDomainProperties.MakeS2 (IntDomain.DefExc)) (Ikind)
2727
module IntR = Lattice.Reverse(Int)
2828

2929
module ConstrSys = struct

0 commit comments

Comments
 (0)