Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(341)

Unified Diff: test/cctest/test-heap.cc

Issue 1293283003: [heap,cctest] Get rid of protected-for-sake-of-testing scope. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Add heap-tester.h to cctest.gyp Created 5 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: test/cctest/test-heap.cc
diff --git a/test/cctest/test-heap.cc b/test/cctest/test-heap.cc
index 8703871daf3631b4027914c3505cb737895c0e25..ccd47229bf9b8bdf69a521b44a3b7737c2479454 100644
--- a/test/cctest/test-heap.cc
+++ b/test/cctest/test-heap.cc
@@ -39,33 +39,13 @@
#include "src/macro-assembler.h"
#include "src/snapshot/snapshot.h"
#include "test/cctest/cctest.h"
+#include "test/cctest/heap-tester.h"
using v8::Just;
namespace v8 {
namespace internal {
-// 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)
-
-
-#define HEAP_TEST(Name) \
- CcTest register_test_##Name(HeapTester::Test##Name, __FILE__, #Name, NULL, \
- true, true); \
- void HeapTester::Test##Name()
-
-
-class HeapTester {
- public:
-#define DECLARE_STATIC(Name) static void Test##Name();
-
- HEAP_TEST_METHODS(DECLARE_STATIC)
-#undef HEAP_TEST_METHODS
-};
-
-
static void CheckMap(Map* map, int type, int instance_size) {
CHECK(map->IsHeapObject());
#ifdef DEBUG
@@ -1148,11 +1128,11 @@ static int LenFromSize(int size) {
}
-TEST(Regression39128) {
+HEAP_TEST(Regression39128) {
// Test case for crbug.com/39128.
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
- TestHeap* heap = CcTest::test_heap();
+ Heap* heap = CcTest::heap();
// Increase the chance of 'bump-the-pointer' allocation in old space.
heap->CollectAllGarbage();
@@ -1952,7 +1932,7 @@ TEST(TestSizeOfRegExpCode) {
}
-TEST(TestSizeOfObjects) {
+HEAP_TEST(TestSizeOfObjects) {
v8::V8::Initialize();
// Get initial heap size after several full GCs, which will stabilize
@@ -1975,7 +1955,7 @@ TEST(TestSizeOfObjects) {
AlwaysAllocateScope always_allocate(CcTest::i_isolate());
int filler_size = static_cast<int>(FixedArray::SizeFor(8192));
for (int i = 1; i <= 100; i++) {
- CcTest::test_heap()->AllocateFixedArray(8192, TENURED).ToObjectChecked();
+ CcTest::heap()->AllocateFixedArray(8192, TENURED).ToObjectChecked();
CHECK_EQ(initial_size + i * filler_size,
static_cast<int>(CcTest::heap()->SizeOfObjects()));
}
@@ -5824,13 +5804,13 @@ TEST(Regress442710) {
}
-TEST(NumberStringCacheSize) {
+HEAP_TEST(NumberStringCacheSize) {
// Test that the number-string cache has not been resized in the snapshot.
CcTest::InitializeVM();
Isolate* isolate = CcTest::i_isolate();
if (!isolate->snapshot_available()) return;
Heap* heap = isolate->heap();
- CHECK_EQ(TestHeap::kInitialNumberStringCacheSize * 2,
+ CHECK_EQ(Heap::kInitialNumberStringCacheSize * 2,
heap->number_string_cache()->length());
}
« no previous file with comments | « test/cctest/test-api.cc ('k') | test/cctest/test-mark-compact.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698