Chromium Code Reviews| Index: test/cctest/test-heap.h |
| diff --git a/test/cctest/test-heap.h b/test/cctest/test-heap.h |
| new file mode 100644 |
| index 0000000000000000000000000000000000000000..bc7eea94137762b401a3a6f01cd1a5ecce6bc40f |
| --- /dev/null |
| +++ b/test/cctest/test-heap.h |
| @@ -0,0 +1,59 @@ |
| +// Copyright 2015 the V8 project authors. All rights reserved. |
| +// Use of this source code is governed by a BSD-style license that can be |
| +// found in the LICENSE file. |
| + |
| +#ifndef TEST_HEAP_H_ |
|
Michael Starzinger
2015/08/21 11:14:10
The name of this file is misleading, it looks like
|
| +#define TEST_HEAP_H_ |
| + |
| +#include "src/handles.h" |
| +#include "src/heap/spaces.h" |
| + |
| +// Tests that should have access to private methods of {v8::internal::Heap}. |
| +// Those tests need to be defined using HEAP_TEST(Name) { ... }. |
| +#define HEAP_TEST_METHODS(V) \ |
| + V(GCFlags) \ |
| + V(MarkCompactCollector) \ |
| + V(NoPromotion) \ |
| + V(NumberStringCacheSize) \ |
| + V(ObjectGroups) \ |
| + V(Promotion) \ |
| + V(Regression39128) \ |
| + V(ResetWeakHandle) \ |
| + V(StressHandles) \ |
| + V(TestSizeOfObjects) \ |
| + V(WriteBarriersInCopyJSObject) |
| + |
| + |
| +#define HEAP_TEST(Name) \ |
| + CcTest register_test_##Name(v8::internal::HeapTester::Test##Name, __FILE__, \ |
| + #Name, NULL, true, true); \ |
| + void v8::internal::HeapTester::Test##Name() |
| + |
| + |
| +#define THREADED_HEAP_TEST(Name) \ |
| + RegisterThreadedTest register_##Name(v8::internal::HeapTester::Test##Name, \ |
| + #Name); \ |
| + /* */ HEAP_TEST(Name) |
| + |
| + |
| +namespace v8 { |
| +namespace internal { |
| + |
| +class HeapTester { |
| + public: |
| +#define DECLARE_STATIC(Name) static void Test##Name(); |
| + |
| + HEAP_TEST_METHODS(DECLARE_STATIC) |
| +#undef HEAP_TEST_METHODS |
| + |
| + /* test-alloc.cc */ |
| + static AllocationResult AllocateAfterFailures(); |
| + static Handle<Object> TestAllocateAfterFailures(); |
| + |
| + /* test-api.cc */ |
| + static void ResetWeakHandle(bool global_gc); |
| +}; |
| +} |
| +} |
| + |
| +#endif // TEST_HEAP_H_ |