| OLD | NEW |
| 1 // Copyright (c) 2011, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2011, 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 "vm/assert.h" | 5 #include "vm/assert.h" |
| 6 #include "vm/class_finalizer.h" | 6 #include "vm/class_finalizer.h" |
| 7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| (...skipping 54 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 65 TEST_CASE(ClassFinalize_Resolve) { | 65 TEST_CASE(ClassFinalize_Resolve) { |
| 66 GrowableArray<const Class*> classes; | 66 GrowableArray<const Class*> classes; |
| 67 Class& rhb = Class::ZoneHandle(CreateTestClass("RhB")); | 67 Class& rhb = Class::ZoneHandle(CreateTestClass("RhB")); |
| 68 Class& sbb = Class::ZoneHandle(CreateTestClass("SBB")); | 68 Class& sbb = Class::ZoneHandle(CreateTestClass("SBB")); |
| 69 Library& lib = Library::Handle(NewLib("TestLib")); | 69 Library& lib = Library::Handle(NewLib("TestLib")); |
| 70 classes.Add(&rhb); | 70 classes.Add(&rhb); |
| 71 classes.Add(&sbb); | 71 classes.Add(&sbb); |
| 72 lib.AddClass(rhb); | 72 lib.AddClass(rhb); |
| 73 lib.AddClass(sbb); | 73 lib.AddClass(sbb); |
| 74 const String& superclass_name = String::Handle(sbb.Name()); | 74 const String& superclass_name = String::Handle(sbb.Name()); |
| 75 const UnresolvedClass& unresolved = UnresolvedClass::Handle( |
| 76 UnresolvedClass::New(0, String::Handle(), superclass_name)); |
| 75 TypeArguments& type_arguments = TypeArguments::Handle(); | 77 TypeArguments& type_arguments = TypeArguments::Handle(); |
| 76 rhb.set_super_type(Type::Handle(Type::NewParameterizedType( | 78 rhb.set_super_type(Type::Handle(Type::NewParameterizedType( |
| 77 Object::Handle(superclass_name.raw()), type_arguments))); | 79 Object::Handle(unresolved.raw()), type_arguments))); |
| 78 ClassFinalizer::AddPendingClasses(classes); | 80 ClassFinalizer::AddPendingClasses(classes); |
| 79 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 81 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
| 80 } | 82 } |
| 81 | 83 |
| 82 } // namespace dart | 84 } // namespace dart |
| OLD | NEW |