Index: test/cctest/test-spaces.cc |
diff --git a/test/cctest/test-spaces.cc b/test/cctest/test-spaces.cc |
index 48c92c76462a27a5fe4857027eccd9688d539736..923227ff500af2903ac7605b0dcabfcb91929575 100644 |
--- a/test/cctest/test-spaces.cc |
+++ b/test/cctest/test-spaces.cc |
@@ -429,8 +429,10 @@ TEST(CompactionSpace) { |
// Cannot loop until "Available()" since we initially have 0 bytes available |
// and would thus neither grow, nor be able to allocate an object. |
const int kNumObjects = 100; |
- const int kExpectedPages = (kNumObjects / (compaction_space->AreaSize() / |
- Page::kMaxRegularHeapObjectSize)); |
+ const int kNumObjectsPerPage = |
+ compaction_space->AreaSize() / Page::kMaxRegularHeapObjectSize; |
+ const int kExpectedPages = |
+ (kNumObjects + kNumObjectsPerPage - 1) / kNumObjectsPerPage; |
for (int i = 0; i < kNumObjects; i++) { |
compaction_space->AllocateRawUnaligned(Page::kMaxRegularHeapObjectSize) |
.ToObjectChecked(); |