Index: test/cctest/test-mark-compact.cc |
diff --git a/test/cctest/test-mark-compact.cc b/test/cctest/test-mark-compact.cc |
index 48610b09acf78e8781ee07580f4c02531e50eb94..d94c37e808ff8a72fa889b3e95e238353296a4f5 100644 |
--- a/test/cctest/test-mark-compact.cc |
+++ b/test/cctest/test-mark-compact.cc |
@@ -53,6 +53,7 @@ static void InitializeVM() { |
TEST(MarkingDeque) { |
+ InitializeVM(); |
int mem_size = 20 * kPointerSize; |
byte* mem = NewArray<byte>(20*kPointerSize); |
Address low = reinterpret_cast<Address>(mem); |
@@ -60,19 +61,20 @@ TEST(MarkingDeque) { |
MarkingDeque s; |
s.Initialize(low, high); |
- Address address = NULL; |
+ Address original_address = reinterpret_cast<Address>(&s); |
+ Address current_address = original_address; |
while (!s.IsFull()) { |
- s.PushBlack(HeapObject::FromAddress(address)); |
- address += kPointerSize; |
+ s.PushBlack(HeapObject::FromAddress(current_address)); |
+ current_address += kPointerSize; |
} |
while (!s.IsEmpty()) { |
Address value = s.Pop()->address(); |
- address -= kPointerSize; |
- CHECK_EQ(address, value); |
+ current_address -= kPointerSize; |
+ CHECK_EQ(current_address, value); |
} |
- CHECK_EQ(NULL, address); |
+ CHECK_EQ(original_address, current_address); |
DeleteArray(mem); |
} |