Skip to content

Commit 536fc46

Browse files
author
Thomas Kiley
committed
Make the equality comparison test easier to follow
1 parent 42e2d5a commit 536fc46

File tree

1 file changed

+19
-7
lines changed

1 file changed

+19
-7
lines changed

unit/util/interval/comparisons.cpp

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -257,12 +257,24 @@ TEST_CASE("interval::equality", "[core][analyses][interval]")
257257
constant_interval_exprt six_to_eight(CEV(6), CEV(8));
258258
constant_interval_exprt five_to_ten(CEV(5), CEV(10));
259259

260-
// TODO: wrongly concludes that these are unequal
261-
// ADA-537
262-
// REQUIRE(two_to_four.equal(six_to_eight).is_unknown());
263-
REQUIRE_FALSE(two_to_four.equal(five_to_ten).is_true());
264-
265-
REQUIRE_FALSE(two_to_four.not_equal(six_to_eight).is_unknown());
266-
REQUIRE(two_to_four.not_equal(five_to_ten).is_true());
260+
SECTION("Same interval")
261+
{
262+
// TODO: wrongly concludes that these are equal
263+
// ADA-537
264+
// REQUIRE(two_to_four.equal(two_to_four).is_unknown());
265+
// REQUIRE(two_to_four.not_equal(two_to_four).is_unknown());
266+
}
267+
SECTION("Overlapping intervals")
268+
{
269+
// TODO: wrongly concludes that these are not equal
270+
// ADA-537
271+
// REQUIRE_FALSE(six_to_eight.equal(five_to_ten).is_unknown());
272+
// REQUIRE_FALSE(six_to_eight.not_equal(five_to_ten).is_unknown());
273+
}
274+
SECTION("Disjoint intervals")
275+
{
276+
REQUIRE_FALSE(two_to_four.equal(six_to_eight).is_true());
277+
REQUIRE(two_to_four.not_equal(six_to_eight).is_true());
278+
}
267279
}
268280
}

0 commit comments

Comments
 (0)