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/class_finalizer.h" | 6 #include "vm/class_finalizer.h" |
7 #include "vm/symbols.h" | 7 #include "vm/symbols.h" |
8 #include "vm/unit_test.h" | 8 #include "vm/unit_test.h" |
9 | 9 |
10 namespace dart { | 10 namespace dart { |
11 | 11 |
12 | 12 |
13 static RawClass* CreateTestClass(const char* name) { | 13 static RawClass* CreateTestClass(const char* name) { |
14 const String& class_name = String::Handle(Symbols::New(Thread::Current(), | 14 const String& class_name = String::Handle(Symbols::New(Thread::Current(), |
15 name)); | 15 name)); |
16 const Script& script = Script::Handle(); | 16 const Script& script = Script::Handle(); |
17 const Class& cls = Class::Handle( | 17 const Class& cls = Class::Handle( |
18 Class::New(class_name, script, TokenPosition::kNoSource)); | 18 Class::New(Library::Handle(), class_name, script, |
| 19 TokenPosition::kNoSource)); |
19 cls.set_interfaces(Object::empty_array()); | 20 cls.set_interfaces(Object::empty_array()); |
20 cls.SetFunctions(Object::empty_array()); | 21 cls.SetFunctions(Object::empty_array()); |
21 cls.SetFields(Object::empty_array()); | 22 cls.SetFields(Object::empty_array()); |
22 return cls.raw(); | 23 return cls.raw(); |
23 } | 24 } |
24 | 25 |
25 | 26 |
26 TEST_CASE(ClassFinalizer) { | 27 TEST_CASE(ClassFinalizer) { |
27 Zone* zone = thread->zone(); | 28 Zone* zone = thread->zone(); |
28 Isolate* isolate = thread->isolate(); | 29 Isolate* isolate = thread->isolate(); |
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
100 TokenPosition::kNoSource)); | 101 TokenPosition::kNoSource)); |
101 const TypeArguments& type_arguments = TypeArguments::Handle(); | 102 const TypeArguments& type_arguments = TypeArguments::Handle(); |
102 rhb.set_super_type(Type::Handle( | 103 rhb.set_super_type(Type::Handle( |
103 Type::New(Object::Handle(unresolved.raw()), | 104 Type::New(Object::Handle(unresolved.raw()), |
104 type_arguments, | 105 type_arguments, |
105 TokenPosition::kNoSource))); | 106 TokenPosition::kNoSource))); |
106 EXPECT(ClassFinalizer::ProcessPendingClasses()); | 107 EXPECT(ClassFinalizer::ProcessPendingClasses()); |
107 } | 108 } |
108 | 109 |
109 } // namespace dart | 110 } // namespace dart |
OLD | NEW |