Index: test/unittests/heap/slot-set-unittest.cc |
diff --git a/test/unittests/heap/slot-set-unittest.cc b/test/unittests/heap/slot-set-unittest.cc |
index d24ed1322b4042851cdde1da64611a340b94fc4b..c9b1464d670b48615407aaa7001669030ef342fd 100644 |
--- a/test/unittests/heap/slot-set-unittest.cc |
+++ b/test/unittests/heap/slot-set-unittest.cc |
@@ -101,18 +101,21 @@ void CheckRemoveRangeOn(uint32_t start, uint32_t end) { |
set.SetPageStart(0); |
uint32_t first = start == 0 ? 0 : start - kPointerSize; |
uint32_t last = end == Page::kPageSize ? end - kPointerSize : end; |
- for (uint32_t i = first; i <= last; i += kPointerSize) { |
- set.Insert(i); |
- } |
- set.RemoveRange(start, end, SlotSet::FREE_EMPTY_BUCKETS); |
- if (first != start) { |
- EXPECT_TRUE(set.Lookup(first)); |
- } |
- if (last == end) { |
- EXPECT_TRUE(set.Lookup(last)); |
- } |
- for (uint32_t i = start; i < end; i += kPointerSize) { |
- EXPECT_FALSE(set.Lookup(i)); |
+ for (const auto mode : |
+ {SlotSet::FREE_EMPTY_BUCKETS, SlotSet::KEEP_EMPTY_BUCKETS}) { |
+ for (uint32_t i = first; i <= last; i += kPointerSize) { |
+ set.Insert(i); |
+ } |
+ set.RemoveRange(start, end, mode); |
+ if (first != start) { |
+ EXPECT_TRUE(set.Lookup(first)); |
+ } |
+ if (last == end) { |
+ EXPECT_TRUE(set.Lookup(last)); |
+ } |
+ for (uint32_t i = start; i < end; i += kPointerSize) { |
+ EXPECT_FALSE(set.Lookup(i)); |
+ } |
} |
} |
@@ -134,10 +137,13 @@ TEST(SlotSet, RemoveRange) { |
} |
SlotSet set; |
set.SetPageStart(0); |
- set.Insert(Page::kPageSize / 2); |
- set.RemoveRange(0, Page::kPageSize, SlotSet::FREE_EMPTY_BUCKETS); |
- for (uint32_t i = 0; i < Page::kPageSize; i += kPointerSize) { |
- EXPECT_FALSE(set.Lookup(i)); |
+ for (const auto mode : |
+ {SlotSet::FREE_EMPTY_BUCKETS, SlotSet::KEEP_EMPTY_BUCKETS}) { |
+ set.Insert(Page::kPageSize / 2); |
+ set.RemoveRange(0, Page::kPageSize, mode); |
+ for (uint32_t i = 0; i < Page::kPageSize; i += kPointerSize) { |
+ EXPECT_FALSE(set.Lookup(i)); |
+ } |
} |
} |