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

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: remove redudant mirror asserts, fix test 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
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 3368 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
OLDNEW
« no previous file with comments | « 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