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

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

Issue 1870343002: - Refactor Symbol allocation to expect a thread parameter. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Address review feedback. Created 4 years, 8 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
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/object_test.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) 2013, the Dart project authors. Please see the AUTHORS file 1 // Copyright (c) 2013, 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 "platform/assert.h" 5 #include "platform/assert.h"
6 #include "vm/globals.h" 6 #include "vm/globals.h"
7 #include "vm/object_id_ring.h" 7 #include "vm/object_id_ring.h"
8 #include "vm/unit_test.h" 8 #include "vm/unit_test.h"
9 #include "vm/dart_api_impl.h" 9 #include "vm/dart_api_impl.h"
10 #include "vm/dart_api_state.h" 10 #include "vm/dart_api_state.h"
(...skipping 19 matching lines...) Expand all
30 30
31 static void ExpectIndexId(ObjectIdRing* ring, intptr_t index, intptr_t id) { 31 static void ExpectIndexId(ObjectIdRing* ring, intptr_t index, intptr_t id) {
32 EXPECT_EQ(id, ring->IdOfIndex(index)); 32 EXPECT_EQ(id, ring->IdOfIndex(index));
33 } 33 }
34 34
35 static void ExpectInvalidIndex(ObjectIdRing* ring, intptr_t index) { 35 static void ExpectInvalidIndex(ObjectIdRing* ring, intptr_t index) {
36 EXPECT_EQ(-1, ring->IdOfIndex(index)); 36 EXPECT_EQ(-1, ring->IdOfIndex(index));
37 } 37 }
38 38
39 static RawObject* MakeString(const char* s) { 39 static RawObject* MakeString(const char* s) {
40 return Symbols::New(s); 40 return Symbols::New(Thread::Current(), s);
41 } 41 }
42 42
43 static void ExpectString(RawObject* obj, const char* s) { 43 static void ExpectString(RawObject* obj, const char* s) {
44 String& str = String::Handle(); 44 String& str = String::Handle();
45 str ^= obj; 45 str ^= obj;
46 EXPECT(str.Equals(s)); 46 EXPECT(str.Equals(s));
47 } 47 }
48 }; 48 };
49 49
50 50
(...skipping 220 matching lines...) Expand 10 before | Expand all | Expand 10 after
271 // Check our first entry reports it has expired. 271 // Check our first entry reports it has expired.
272 obj_lookup = ring->GetObjectForId(obj_id, &kind); 272 obj_lookup = ring->GetObjectForId(obj_id, &kind);
273 EXPECT_EQ(ObjectIdRing::kExpired, kind); 273 EXPECT_EQ(ObjectIdRing::kExpired, kind);
274 EXPECT_NE(obj.raw(), obj_lookup); 274 EXPECT_NE(obj.raw(), obj_lookup);
275 EXPECT_EQ(Object::null(), obj_lookup); 275 EXPECT_EQ(Object::null(), obj_lookup);
276 } 276 }
277 277
278 #endif // !PRODUCT 278 #endif // !PRODUCT
279 279
280 } // namespace dart 280 } // namespace dart
OLDNEW
« no previous file with comments | « runtime/vm/object.cc ('k') | runtime/vm/object_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698