OLD | NEW |
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/cha.h" | 6 #include "vm/cha.h" |
7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
8 #include "vm/globals.h" | 8 #include "vm/globals.h" |
9 #include "vm/symbols.h" | 9 #include "vm/symbols.h" |
10 #include "vm/unit_test.h" | 10 #include "vm/unit_test.h" |
(...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
108 ZoneGrowableArray<Function*>* bars = | 108 ZoneGrowableArray<Function*>* bars = |
109 CHA::GetNamedInstanceFunctionsOf(*a_subclass_ids, function_bar_name); | 109 CHA::GetNamedInstanceFunctionsOf(*a_subclass_ids, function_bar_name); |
110 EXPECT_EQ(1, bars->length()); | 110 EXPECT_EQ(1, bars->length()); |
111 EXPECT_EQ(class_d_bar.raw(), (*bars)[0]->raw()); | 111 EXPECT_EQ(class_d_bar.raw(), (*bars)[0]->raw()); |
112 | 112 |
113 ZoneGrowableArray<Function*>* class_a_bar_overrides = | 113 ZoneGrowableArray<Function*>* class_a_bar_overrides = |
114 CHA::GetOverridesOf(class_a_bar); | 114 CHA::GetOverridesOf(class_a_bar); |
115 EXPECT_EQ(1, class_a_bar_overrides->length()); | 115 EXPECT_EQ(1, class_a_bar_overrides->length()); |
116 EXPECT_EQ(class_d_bar.raw(), (*class_a_bar_overrides)[0]->raw()); | 116 EXPECT_EQ(class_d_bar.raw(), (*class_a_bar_overrides)[0]->raw()); |
117 | 117 |
118 // TODO(regis): Add this test EXPECT(CHA::HasSubclasses(kDartObjectCid)). | 118 EXPECT(CHA::HasSubclasses(kInstanceCid)); |
119 EXPECT(!CHA::HasSubclasses(kSmiCid)); | 119 EXPECT(!CHA::HasSubclasses(kSmiCid)); |
120 EXPECT(!CHA::HasSubclasses(kNullCid)); | 120 EXPECT(!CHA::HasSubclasses(kNullCid)); |
121 EXPECT(!CHA::HasSubclasses(kDynamicCid)); | 121 EXPECT(!CHA::HasSubclasses(kDynamicCid)); |
122 EXPECT(!CHA::HasSubclasses(kVoidCid)); | 122 EXPECT(!CHA::HasSubclasses(kVoidCid)); |
123 EXPECT(CHA::HasSubclasses(class_a_id)); | 123 EXPECT(CHA::HasSubclasses(class_a_id)); |
124 EXPECT(CHA::HasSubclasses(class_b_id)); | 124 EXPECT(CHA::HasSubclasses(class_b_id)); |
125 EXPECT(!CHA::HasSubclasses(class_c_id)); | 125 EXPECT(!CHA::HasSubclasses(class_c_id)); |
126 EXPECT(!CHA::HasSubclasses(class_d_id)); | 126 EXPECT(!CHA::HasSubclasses(class_d_id)); |
127 } | 127 } |
128 | 128 |
129 } // namespace dart | 129 } // namespace dart |
130 | |
OLD | NEW |