| OLD | NEW |
| 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 "platform/assert.h" | 5 #include "platform/assert.h" |
| 6 #include "vm/bit_vector.h" | 6 #include "vm/bit_vector.h" |
| 7 #include "vm/unit_test.h" | 7 #include "vm/unit_test.h" |
| 8 | 8 |
| 9 namespace dart { | 9 namespace dart { |
| 10 | 10 |
| 11 #define Z Thread::Current()->zone() | 11 #define Z (thread->zone()) |
| 12 | 12 |
| 13 TEST_CASE(BitVector) { | 13 TEST_CASE(BitVector) { |
| 14 { BitVector* v = new BitVector(Z, 15); | 14 { BitVector* v = new BitVector(Z, 15); |
| 15 v->Add(1); | 15 v->Add(1); |
| 16 EXPECT_EQ(true, v->Contains(1)); | 16 EXPECT_EQ(true, v->Contains(1)); |
| 17 EXPECT_EQ(false, v->Contains(0)); | 17 EXPECT_EQ(false, v->Contains(0)); |
| 18 { BitVector::Iterator iter(v); | 18 { BitVector::Iterator iter(v); |
| 19 EXPECT_EQ(1, iter.Current()); | 19 EXPECT_EQ(1, iter.Current()); |
| 20 iter.Advance(); | 20 iter.Advance(); |
| 21 EXPECT(iter.Done()); | 21 EXPECT(iter.Done()); |
| (...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 113 a->Add(0); | 113 a->Add(0); |
| 114 a->Add(64); | 114 a->Add(64); |
| 115 b->RemoveAll(a); | 115 b->RemoveAll(a); |
| 116 EXPECT_EQ(false, b->Contains(0)); | 116 EXPECT_EQ(false, b->Contains(0)); |
| 117 EXPECT_EQ(true, b->Contains(32)); | 117 EXPECT_EQ(true, b->Contains(32)); |
| 118 EXPECT_EQ(false, b->Contains(64)); | 118 EXPECT_EQ(false, b->Contains(64)); |
| 119 } | 119 } |
| 120 } | 120 } |
| 121 | 121 |
| 122 } // namespace dart | 122 } // namespace dart |
| OLD | NEW |