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

Unified Diff: runtime/vm/object_graph_test.cc

Issue 292663012: Retaining path in Observatory. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 6 years, 7 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 | « runtime/vm/object_graph.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_graph_test.cc
===================================================================
--- runtime/vm/object_graph_test.cc (revision 36435)
+++ runtime/vm/object_graph_test.cc (working copy)
@@ -98,7 +98,6 @@
b = Array::null();
ObjectGraph graph(isolate);
// A retaining path should end like this: c <- b <- a <- ...
- // c itself is not included in the returned path and length.
{
HANDLESCOPE(isolate);
// Test null, empty, and length 1 array.
@@ -108,17 +107,20 @@
intptr_t one_length = graph.RetainingPath(&c, path);
EXPECT_EQ(null_length, empty_length);
EXPECT_EQ(null_length, one_length);
- EXPECT_LE(2, null_length);
+ EXPECT_LE(3, null_length);
}
{
HANDLESCOPE(isolate);
- Array& path = Array::Handle(Array::New(2, Heap::kNew));
+ Array& path = Array::Handle(Array::New(3, Heap::kNew));
intptr_t length = graph.RetainingPath(&c, path);
- EXPECT_LE(2, length);
+ EXPECT_LE(3, length);
+ Array& expected_c = Array::Handle();
+ expected_c ^= path.At(0);
Array& expected_b = Array::Handle();
- expected_b ^= path.At(0);
+ expected_b ^= path.At(1);
Array& expected_a = Array::Handle();
- expected_a ^= path.At(1);
+ expected_a ^= path.At(2);
+ EXPECT(expected_c.raw() == c.raw());
EXPECT(expected_b.raw() == a.At(0));
EXPECT(expected_a.raw() == a.raw());
}
« no previous file with comments | « runtime/vm/object_graph.cc ('k') | runtime/vm/service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698