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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object_store.cc ('k') | runtime/vm/snapshot.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object_test.cc
diff --git a/runtime/vm/object_test.cc b/runtime/vm/object_test.cc
index 2bd6b8a71e03ec523fc04c8833d9761b8ed64579..96d506d34181fb7f13a33daff1beee4c88705838 100644
--- a/runtime/vm/object_test.cc
+++ b/runtime/vm/object_test.cc
@@ -3386,4 +3386,35 @@ TEST_CASE(FunctionSourceFingerprint) {
EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
}
+
+TEST_CASE(SpecialClassesHaveEmptyArrays) {
+ ObjectStore* object_store = Isolate::Current()->object_store();
+ Class& cls = Class::Handle();
+ Object& array = Object::Handle();
+
+ cls = object_store->null_class();
+ array = cls.fields();
+ EXPECT(!array.IsNull());
+ EXPECT(array.IsArray());
+ array = cls.functions();
+ EXPECT(!array.IsNull());
+ EXPECT(array.IsArray());
+
+ cls = Object::void_class();
+ array = cls.fields();
+ EXPECT(!array.IsNull());
+ EXPECT(array.IsArray());
+ array = cls.functions();
+ EXPECT(!array.IsNull());
+ EXPECT(array.IsArray());
+
+ cls = Object::dynamic_class();
+ array = cls.fields();
+ EXPECT(!array.IsNull());
+ EXPECT(array.IsArray());
+ array = cls.functions();
+ EXPECT(!array.IsNull());
+ EXPECT(array.IsArray());
+}
+
} // namespace dart
« 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