Index: test/cctest/test-heap-profiler.cc |
diff --git a/test/cctest/test-heap-profiler.cc b/test/cctest/test-heap-profiler.cc |
index a26edd5358f45c7f5707b225b3f9cd47e65e3abd..214100f6fe3f7fdc62075eeb882b0888e97b58e2 100644 |
--- a/test/cctest/test-heap-profiler.cc |
+++ b/test/cctest/test-heap-profiler.cc |
@@ -1616,16 +1616,13 @@ TEST(DeleteAllHeapSnapshots) { |
} |
-static const v8::HeapSnapshot* FindHeapSnapshot(v8::HeapProfiler* profiler, |
- unsigned uid) { |
+static bool FindHeapSnapshot(v8::HeapProfiler* profiler, |
+ const v8::HeapSnapshot* snapshot) { |
int length = profiler->GetSnapshotCount(); |
for (int i = 0; i < length; i++) { |
- const v8::HeapSnapshot* snapshot = profiler->GetHeapSnapshot(i); |
- if (snapshot->GetUid() == uid) { |
- return snapshot; |
- } |
+ if (snapshot == profiler->GetHeapSnapshot(i)) return true; |
} |
- return NULL; |
+ return false; |
} |
@@ -1640,33 +1637,29 @@ TEST(DeleteHeapSnapshot) { |
CHECK(s1); |
CHECK_EQ(1, heap_profiler->GetSnapshotCount()); |
- unsigned uid1 = s1->GetUid(); |
- CHECK_EQ(s1, FindHeapSnapshot(heap_profiler, uid1)); |
+ CHECK(FindHeapSnapshot(heap_profiler, s1)); |
const_cast<v8::HeapSnapshot*>(s1)->Delete(); |
CHECK_EQ(0, heap_profiler->GetSnapshotCount()); |
- CHECK(!FindHeapSnapshot(heap_profiler, uid1)); |
+ CHECK(!FindHeapSnapshot(heap_profiler, s1)); |
const v8::HeapSnapshot* s2 = |
heap_profiler->TakeHeapSnapshot(v8_str("2")); |
CHECK(s2); |
CHECK_EQ(1, heap_profiler->GetSnapshotCount()); |
- unsigned uid2 = s2->GetUid(); |
- CHECK_NE(static_cast<int>(uid1), static_cast<int>(uid2)); |
- CHECK_EQ(s2, FindHeapSnapshot(heap_profiler, uid2)); |
+ CHECK(FindHeapSnapshot(heap_profiler, s2)); |
const v8::HeapSnapshot* s3 = |
heap_profiler->TakeHeapSnapshot(v8_str("3")); |
CHECK(s3); |
CHECK_EQ(2, heap_profiler->GetSnapshotCount()); |
- unsigned uid3 = s3->GetUid(); |
- CHECK_NE(static_cast<int>(uid1), static_cast<int>(uid3)); |
- CHECK_EQ(s3, FindHeapSnapshot(heap_profiler, uid3)); |
+ CHECK_NE(s2, s3); |
+ CHECK(FindHeapSnapshot(heap_profiler, s3)); |
const_cast<v8::HeapSnapshot*>(s2)->Delete(); |
CHECK_EQ(1, heap_profiler->GetSnapshotCount()); |
- CHECK(!FindHeapSnapshot(heap_profiler, uid2)); |
- CHECK_EQ(s3, FindHeapSnapshot(heap_profiler, uid3)); |
+ CHECK(!FindHeapSnapshot(heap_profiler, s2)); |
+ CHECK(FindHeapSnapshot(heap_profiler, s3)); |
const_cast<v8::HeapSnapshot*>(s3)->Delete(); |
CHECK_EQ(0, heap_profiler->GetSnapshotCount()); |
- CHECK(!FindHeapSnapshot(heap_profiler, uid3)); |
+ CHECK(!FindHeapSnapshot(heap_profiler, s3)); |
} |