| 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 "vm/assembler.h" | 5 #include "vm/assembler.h" |
| 6 #include "vm/bigint_operations.h" | 6 #include "vm/bigint_operations.h" |
| 7 #include "vm/class_finalizer.h" | 7 #include "vm/class_finalizer.h" |
| 8 #include "vm/dart_api_impl.h" | 8 #include "vm/dart_api_impl.h" |
| 9 #include "vm/dart_entry.h" | 9 #include "vm/dart_entry.h" |
| 10 #include "vm/isolate.h" | 10 #include "vm/isolate.h" |
| (...skipping 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3379 const Function& test6 = Function::Handle(GetFunction(class_a, "test6")); | 3379 const Function& test6 = Function::Handle(GetFunction(class_a, "test6")); |
| 3380 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); | 3380 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); |
| 3381 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); | 3381 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); |
| 3382 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); | 3382 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); |
| 3383 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); | 3383 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); |
| 3384 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); | 3384 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); |
| 3385 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); | 3385 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); |
| 3386 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); | 3386 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); |
| 3387 } | 3387 } |
| 3388 | 3388 |
| 3389 |
| 3390 TEST_CASE(SpecialClassesHaveEmptyArrays) { |
| 3391 ObjectStore* object_store = Isolate::Current()->object_store(); |
| 3392 Class& cls = Class::Handle(); |
| 3393 Object& array = Object::Handle(); |
| 3394 |
| 3395 cls = object_store->null_class(); |
| 3396 array = cls.fields(); |
| 3397 EXPECT(!array.IsNull()); |
| 3398 EXPECT(array.IsArray()); |
| 3399 array = cls.functions(); |
| 3400 EXPECT(!array.IsNull()); |
| 3401 EXPECT(array.IsArray()); |
| 3402 |
| 3403 cls = Object::void_class(); |
| 3404 array = cls.fields(); |
| 3405 EXPECT(!array.IsNull()); |
| 3406 EXPECT(array.IsArray()); |
| 3407 array = cls.functions(); |
| 3408 EXPECT(!array.IsNull()); |
| 3409 EXPECT(array.IsArray()); |
| 3410 |
| 3411 cls = Object::dynamic_class(); |
| 3412 array = cls.fields(); |
| 3413 EXPECT(!array.IsNull()); |
| 3414 EXPECT(array.IsArray()); |
| 3415 array = cls.functions(); |
| 3416 EXPECT(!array.IsNull()); |
| 3417 EXPECT(array.IsArray()); |
| 3418 } |
| 3419 |
| 3389 } // namespace dart | 3420 } // namespace dart |
| OLD | NEW |