Skip to content

Commit 7f61939

Browse files
author
Thomas Kiley
committed
fixup binary eval unit test commit
1 parent a84494c commit 7f61939

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

unit/util/interval/eval.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,12 +124,17 @@ TEST_CASE("binary eval switch", "[core][analyses][interval]")
124124
constant_interval_exprt five = interval_of(5);
125125
constant_interval_exprt eight = interval_of(8);
126126

127+
// Here we test only single element intervals, more robust testing of each
128+
// opertion can be found in the method unit tests (e.g.
129+
// unit/util/interval/add.cpp)
130+
127131
SECTION("Numeric operations")
128132
{
129133
REQUIRE(five.eval(ID_plus, eight) == interval_of(13));
130134
REQUIRE(five.eval(ID_minus, eight) == interval_of(-3));
131135
REQUIRE(five.eval(ID_mult, eight) == interval_of(40));
132136
REQUIRE(five.eval(ID_div, eight) == interval_of(0));
137+
// Note modulo is implemented very imprecisely
133138
REQUIRE(five.eval(ID_mod, eight) == interval_from_to(0, 5));
134139
REQUIRE(five.eval(ID_shl, two) == interval_of(20 /* 5 << 2 */));
135140
REQUIRE(five.eval(ID_ashr, two) == interval_of(1 /* 5 >> 2 */));

0 commit comments

Comments
 (0)