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

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

Issue 19856003: Inline create parameter mirror list functionality. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Created 7 years, 5 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 3162 matching lines...) Expand 10 before | Expand all | Expand 10 after
3173 isolate->heap()->CollectAllGarbage(); 3173 isolate->heap()->CollectAllGarbage();
3174 EXPECT(weak1.key() == Object::null()); 3174 EXPECT(weak1.key() == Object::null());
3175 EXPECT(weak1.value() == Object::null()); 3175 EXPECT(weak1.value() == Object::null());
3176 EXPECT(weak2.key() == Object::null()); 3176 EXPECT(weak2.key() == Object::null());
3177 EXPECT(weak2.value() == Object::null()); 3177 EXPECT(weak2.value() == Object::null());
3178 } 3178 }
3179 3179
3180 3180
3181 TEST_CASE(MirrorReference) { 3181 TEST_CASE(MirrorReference) {
3182 const MirrorReference& reference = 3182 const MirrorReference& reference =
3183 MirrorReference::Handle(MirrorReference::New()); 3183 MirrorReference::Handle(MirrorReference::New(Object::Handle()));
3184 Object& initial_referent = Object::Handle(reference.referent()); 3184 Object& initial_referent = Object::Handle(reference.referent());
3185 EXPECT(initial_referent.IsNull()); 3185 EXPECT(initial_referent.IsNull());
3186 3186
3187 Library& library = Library::Handle(Library::CoreLibrary()); 3187 Library& library = Library::Handle(Library::CoreLibrary());
3188 EXPECT(!library.IsNull()); 3188 EXPECT(!library.IsNull());
3189 EXPECT(library.IsLibrary()); 3189 EXPECT(library.IsLibrary());
3190 reference.set_referent(library); 3190 reference.set_referent(library);
3191 const Object& returned_referent = Object::Handle(reference.referent()); 3191 const Object& returned_referent = Object::Handle(reference.referent());
3192 EXPECT(returned_referent.IsLibrary()); 3192 EXPECT(returned_referent.IsLibrary());
3193 EXPECT_EQ(returned_referent.raw(), library.raw()); 3193 EXPECT_EQ(returned_referent.raw(), library.raw());
3194 3194
3195 const MirrorReference& other_reference = 3195 const MirrorReference& other_reference =
3196 MirrorReference::Handle(MirrorReference::New()); 3196 MirrorReference::Handle(MirrorReference::New(Object::Handle()));
3197 EXPECT_NE(reference.raw(), other_reference.raw()); 3197 EXPECT_NE(reference.raw(), other_reference.raw());
3198 other_reference.set_referent(library); 3198 other_reference.set_referent(library);
3199 EXPECT_NE(reference.raw(), other_reference.raw()); 3199 EXPECT_NE(reference.raw(), other_reference.raw());
3200 EXPECT_EQ(reference.referent(), other_reference.referent()); 3200 EXPECT_EQ(reference.referent(), other_reference.referent());
3201 3201
3202 Object& obj = Object::Handle(reference.raw()); 3202 Object& obj = Object::Handle(reference.raw());
3203 EXPECT(obj.IsMirrorReference()); 3203 EXPECT(obj.IsMirrorReference());
3204 } 3204 }
3205 3205
3206 3206
(...skipping 156 matching lines...) Expand 10 before | Expand all | Expand 10 after
3363 const Function& test7 = Function::Handle(GetFunction(class_a, "test7")); 3363 const Function& test7 = Function::Handle(GetFunction(class_a, "test7"));
3364 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint()); 3364 EXPECT_EQ(test1.SourceFingerprint(), test2.SourceFingerprint());
3365 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint()); 3365 EXPECT_NE(test1.SourceFingerprint(), test3.SourceFingerprint());
3366 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint()); 3366 EXPECT_NE(test3.SourceFingerprint(), test4.SourceFingerprint());
3367 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint()); 3367 EXPECT_NE(test4.SourceFingerprint(), test5.SourceFingerprint());
3368 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint()); 3368 EXPECT_NE(test5.SourceFingerprint(), test6.SourceFingerprint());
3369 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint()); 3369 EXPECT_EQ(test6.SourceFingerprint(), test7.SourceFingerprint());
3370 } 3370 }
3371 3371
3372 } // namespace dart 3372 } // namespace dart
OLDNEW
« runtime/lib/mirrors.cc ('K') | « runtime/vm/object.cc ('k') | runtime/vm/symbols.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698