Skip to content

Commit 029d4a9

Browse files
authored
Refactor VSA test cases to use union method instead of _merge_si (#604)
1 parent b50d3ea commit 029d4a9

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

tests/test_vsa.py

+5-7
Original file line numberDiff line numberDiff line change
@@ -631,8 +631,8 @@ def test_value_set_operations(self):
631631
assert vsa_model(vs_1).is_empty
632632

633633
# Test merging two addresses
634-
vsa_model(vs_1)._merge_si("global", 0, vsa_model(claripy.SI(bits=32, stride=0, lower_bound=10, upper_bound=10)))
635-
vsa_model(vs_1)._merge_si("global", 0, vsa_model(claripy.SI(bits=32, stride=0, lower_bound=28, upper_bound=28)))
634+
vs_1 = vs_1.union(VS(32, "global", 0, claripy.SI(bits=32, stride=0, lower_bound=10, upper_bound=10)))
635+
vs_1 = vs_1.union(VS(32, "global", 0, claripy.SI(bits=32, stride=0, lower_bound=28, upper_bound=28)))
636636
assert (
637637
vsa_model(vs_1)
638638
.get_si("global")
@@ -644,14 +644,12 @@ def test_value_set_operations(self):
644644
vs_2 = VS(name="foo", bits=32, value=0).intersection(VS(name="makeitempty", bits=32, value=1))
645645
assert self.is_equal(vs_1, vs_1)
646646
assert self.is_equal(vs_2, vs_2)
647-
vsa_model(vs_1)._merge_si("global", 0, vsa_model(claripy.SI(bits=32, stride=0, lower_bound=10, upper_bound=10)))
647+
vs_1 = vs_1.union(VS(32, "global", 0, claripy.SI(bits=32, stride=0, lower_bound=10, upper_bound=10)))
648648
assert not self.is_equal(vs_1, vs_2)
649-
vsa_model(vs_2)._merge_si("global", 0, vsa_model(claripy.SI(bits=32, stride=0, lower_bound=10, upper_bound=10)))
649+
vs_2 = vs_2.union(VS(32, "global", 0, claripy.SI(bits=32, stride=0, lower_bound=10, upper_bound=10)))
650650
assert self.is_equal(vs_1, vs_2)
651651
assert claripy.backends.vsa.is_true((vs_1 & vs_2) == vs_1)
652-
vsa_model(vs_1)._merge_si(
653-
"global", 0, vsa_model(claripy.SI(bits=32, stride=18, lower_bound=10, upper_bound=28))
654-
)
652+
vs_1 = vs_1.union(VS(32, "global", 0, claripy.SI(bits=32, stride=18, lower_bound=10, upper_bound=28)))
655653
assert not self.is_equal(vs_1, vs_2)
656654

657655
def test_value_set_subtraction(self):

0 commit comments

Comments
 (0)