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 16 matching lines...) Expand all Loading... | |
27 " bar() { }" | 27 " bar() { }" |
28 "}\n"; | 28 "}\n"; |
29 | 29 |
30 TestCase::LoadTestScript(kScriptChars, NULL); | 30 TestCase::LoadTestScript(kScriptChars, NULL); |
31 EXPECT(ClassFinalizer::FinalizePendingClasses()); | 31 EXPECT(ClassFinalizer::FinalizePendingClasses()); |
32 const String& name = String::Handle(String::New(TestCase::url())); | 32 const String& name = String::Handle(String::New(TestCase::url())); |
33 const Library& lib = Library::Handle(Library::LookupLibrary(name)); | 33 const Library& lib = Library::Handle(Library::LookupLibrary(name)); |
34 EXPECT(!lib.IsNull()); | 34 EXPECT(!lib.IsNull()); |
35 | 35 |
36 const Class& class_a = Class::Handle( | 36 const Class& class_a = Class::Handle( |
37 lib.LookupClass(String::Handle(Symbols::New("A")))); | 37 lib.LookupClass(String::Handle(Symbols::New("A")), NULL)); |
38 EXPECT(!class_a.IsNull()); | 38 EXPECT(!class_a.IsNull()); |
siva
2013/07/22 22:21:46
This is a case where if we have some bugs the test
regis
2013/07/22 23:51:27
Done.
| |
39 const intptr_t class_a_id = class_a.id(); | 39 const intptr_t class_a_id = class_a.id(); |
40 | 40 |
41 const Class& class_b = Class::Handle( | 41 const Class& class_b = Class::Handle( |
42 lib.LookupClass(String::Handle(Symbols::New("B")))); | 42 lib.LookupClass(String::Handle(Symbols::New("B")), NULL)); |
43 EXPECT(!class_b.IsNull()); | 43 EXPECT(!class_b.IsNull()); |
44 const intptr_t class_b_id = class_b.id(); | 44 const intptr_t class_b_id = class_b.id(); |
45 | 45 |
46 const Class& class_c = Class::Handle( | 46 const Class& class_c = Class::Handle( |
47 lib.LookupClass(String::Handle(Symbols::New("C")))); | 47 lib.LookupClass(String::Handle(Symbols::New("C")), NULL)); |
48 EXPECT(!class_c.IsNull()); | 48 EXPECT(!class_c.IsNull()); |
49 const intptr_t class_c_id = class_c.id(); | 49 const intptr_t class_c_id = class_c.id(); |
50 | 50 |
51 const Class& class_d = Class::Handle( | 51 const Class& class_d = Class::Handle( |
52 lib.LookupClass(String::Handle(Symbols::New("D")))); | 52 lib.LookupClass(String::Handle(Symbols::New("D")), NULL)); |
53 EXPECT(!class_d.IsNull()); | 53 EXPECT(!class_d.IsNull()); |
54 const intptr_t class_d_id = class_d.id(); | 54 const intptr_t class_d_id = class_d.id(); |
55 | 55 |
56 const String& function_foo_name = String::Handle(String::New("foo")); | 56 const String& function_foo_name = String::Handle(String::New("foo")); |
57 const String& function_bar_name = String::Handle(String::New("bar")); | 57 const String& function_bar_name = String::Handle(String::New("bar")); |
58 | 58 |
59 const Function& class_a_foo = | 59 const Function& class_a_foo = |
60 Function::Handle(class_a.LookupDynamicFunction(function_foo_name)); | 60 Function::Handle(class_a.LookupDynamicFunction(function_foo_name)); |
61 EXPECT(!class_a_foo.IsNull()); | 61 EXPECT(!class_a_foo.IsNull()); |
62 | 62 |
(...skipping 57 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
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 |
OLD | NEW |