File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff 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 */ ));
You can’t perform that action at this time.
0 commit comments