Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(145)

Side by Side Diff: runtime/vm/object_test.cc

Issue 22902002: Ensure the classes void and dynamic have empty arrays for fields, functions, etc. Move their Types … (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
OLDNEW
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 3353 matching lines...) Expand 10 before | Expand all | Expand 10 after
3364 const Function& test6 = Function::Handle(GetFunction(class_a, "test6")); 3364 const Function& test6 = Function::Handle(GetFunction(class_a, "test6"));
3365 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); 3365 const Function& test7 = Function::Handle(GetFunction(class_a, "test7"));
3366 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); 3366 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint());
3367 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); 3367 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint());
3368 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); 3368 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint());
3369 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); 3369 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint());
3370 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); 3370 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint());
3371 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); 3371 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
3372 } 3372 }
3373 3373
3374
3375 TEST_CASE(SpecialClassesHaveEmptyArrays) {
3376 ObjectStore* object_store = Isolate::Current()->object_store();
3377 Class& cls = Class::Handle();
3378 Object& array = Object::Handle();
3379
3380 cls = object_store->null_class();
3381 array = cls.fields();
3382 EXPECT(!array.IsNull());
3383 EXPECT(array.IsArray());
3384 array = cls.functions();
3385 EXPECT(!array.IsNull());
3386 EXPECT(array.IsArray());
3387
3388 cls = Object::void_class();
3389 array = cls.fields();
3390 EXPECT(!array.IsNull());
3391 EXPECT(array.IsArray());
3392 array = cls.functions();
3393 EXPECT(!array.IsNull());
3394 EXPECT(array.IsArray());
3395
3396 cls = Object::dynamic_class();
3397 array = cls.fields();
3398 EXPECT(!array.IsNull());
3399 EXPECT(array.IsArray());
3400 array = cls.functions();
3401 EXPECT(!array.IsNull());
3402 EXPECT(array.IsArray());
3403 }
3404
3374 } // namespace dart 3405 } // namespace dart
OLDNEW
« runtime/vm/object.cc ('K') | « runtime/vm/object_store.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698