Index: test/unittests/heap/heap-unittest.cc |
diff --git a/test/unittests/heap/heap-unittest.cc b/test/unittests/heap/heap-unittest.cc |
index b738b44e835054df0c3803f634077ce80a8831fa..d378782fbb723b99a96f9f3ff6df36e48f30209d 100644 |
--- a/test/unittests/heap/heap-unittest.cc |
+++ b/test/unittests/heap/heap-unittest.cc |
@@ -45,5 +45,37 @@ TEST(Heap, HeapGrowingFactor) { |
Heap::HeapGrowingFactor(400, 1)); |
} |
+TEST(Heap, SemiSpaceSize) { |
+ uint64_t configurations[][2] = { |
+ {0, 1 * i::Heap::kPointerMultiplier}, |
+ {512 * i::MB, 1 * i::Heap::kPointerMultiplier}, |
+ {1 * i::GB, 3 * i::Heap::kPointerMultiplier}, |
+ {2 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize}, |
+ {4 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize}, |
+ {8 * static_cast<uint64_t>(i::GB), i::Heap::kMaxSemiSpaceSize}}; |
+ |
+ for (auto configuration : configurations) { |
+ ASSERT_EQ(configuration[1], |
+ static_cast<uint64_t>( |
+ i::Heap::ComputeMaxSemiSpaceSize(configuration[0]))); |
+ } |
+} |
+ |
+TEST(Heap, OldGenerationSize) { |
+ uint64_t configurations[][2] = { |
+ {0, i::Heap::kMinOldSpaceSize}, |
+ {512, i::Heap::kMinOldSpaceSize}, |
+ {1 * i::GB, 256 * i::Heap::kPointerMultiplier}, |
+ {2 * static_cast<uint64_t>(i::GB), 512 * i::Heap::kPointerMultiplier}, |
+ {4 * static_cast<uint64_t>(i::GB), i::Heap::kMaxOldSpaceSize}, |
+ {8 * static_cast<uint64_t>(i::GB), i::Heap::kMaxOldSpaceSize}}; |
+ |
+ for (auto configuration : configurations) { |
+ ASSERT_EQ(configuration[1], |
+ static_cast<uint64_t>( |
+ i::Heap::ComputeMaxOldGenerationSize(configuration[0]))); |
+ } |
+} |
+ |
} // namespace internal |
} // namespace v8 |