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

Side by Side Diff: runtime/vm/class_table_test.cc

Issue 10829446: Add HasSubclasses function to class hierarchy analysis. (Closed) Base URL: http://dart.googlecode.com/svn/branches/bleeding_edge/dart/
Patch Set: Created 8 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 unified diff | Download patch | Annotate | Revision Log
« runtime/vm/class_table.cc ('K') | « runtime/vm/class_table.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file
2 // for details. All rights reserved. Use of this source code is governed by a 2 // for details. All rights reserved. Use of this source code is governed by a
3 // BSD-style license that can be found in the LICENSE file. 3 // BSD-style license that can be found in the LICENSE file.
4 4
5 #include "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/class_finalizer.h" 6 #include "vm/class_finalizer.h"
7 #include "vm/class_table.h" 7 #include "vm/class_table.h"
8 #include "vm/dart_entry.h" 8 #include "vm/dart_entry.h"
9 #include "vm/globals.h" 9 #include "vm/globals.h"
10 #include "vm/symbols.h" 10 #include "vm/symbols.h"
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after
113 ZoneGrowableArray<Function*>* bars = 113 ZoneGrowableArray<Function*>* bars =
114 class_table->GetNamedInstanceFunctionsOf(*a_subclass_ids, 114 class_table->GetNamedInstanceFunctionsOf(*a_subclass_ids,
115 function_bar_name); 115 function_bar_name);
116 EXPECT_EQ(1, bars->length()); 116 EXPECT_EQ(1, bars->length());
117 EXPECT_EQ(class_d_bar.raw(), (*bars)[0]->raw()); 117 EXPECT_EQ(class_d_bar.raw(), (*bars)[0]->raw());
118 118
119 ZoneGrowableArray<Function*>* class_a_bar_overrides = 119 ZoneGrowableArray<Function*>* class_a_bar_overrides =
120 class_table->GetOverridesOf(class_a_bar); 120 class_table->GetOverridesOf(class_a_bar);
121 EXPECT_EQ(1, class_a_bar_overrides->length()); 121 EXPECT_EQ(1, class_a_bar_overrides->length());
122 EXPECT_EQ(class_d_bar.raw(), (*class_a_bar_overrides)[0]->raw()); 122 EXPECT_EQ(class_d_bar.raw(), (*class_a_bar_overrides)[0]->raw());
123
124 EXPECT(class_table->HasSubclasses(class_a_id));
125 EXPECT(class_table->HasSubclasses(class_b_id));
126 EXPECT(!class_table->HasSubclasses(class_c_id));
127 EXPECT(!class_table->HasSubclasses(class_d_id));
123 } 128 }
124 129
125 } // namespace dart 130 } // namespace dart
126 131
OLDNEW
« runtime/vm/class_table.cc ('K') | « runtime/vm/class_table.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698