From db1c9ac2c28f7c52d4081dc42fc4f10efed953f9 Mon Sep 17 00:00:00 2001 From: Hiroshi Yamauchi Date: Thu, 12 Mar 2015 15:40:53 -0700 Subject: Exercise Heap::PreZygoteFork() in a test. Change-Id: If41c931ffdbb0310536799b4515557770f2cd4b9 --- runtime/gc/heap_test.cc | 12 ++++++++++++ 1 file changed, 12 insertions(+) (limited to 'runtime/gc/heap_test.cc') diff --git a/runtime/gc/heap_test.cc b/runtime/gc/heap_test.cc index 73196b20a2..14d78d8710 100644 --- a/runtime/gc/heap_test.cc +++ b/runtime/gc/heap_test.cc @@ -71,5 +71,17 @@ TEST_F(HeapTest, HeapBitmapCapacityTest) { bitmap->Set(fake_end_of_heap_object); } +class ZygoteHeapTest : public CommonRuntimeTest { + void SetUpRuntimeOptions(RuntimeOptions* options) { + CommonRuntimeTest::SetUpRuntimeOptions(options); + options->push_back(std::make_pair("-Xzygote", nullptr)); + } +}; + +TEST_F(ZygoteHeapTest, PreZygoteFork) { + // Exercise Heap::PreZygoteFork() to check it does not crash. + Runtime::Current()->GetHeap()->PreZygoteFork(); +} + } // namespace gc } // namespace art -- cgit v1.2.3-59-g8ed1b