OLD | NEW |
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 Loading... |
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 Loading... |
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 |
OLD | NEW |