| 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 |
| (...skipping 73 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 84 EXPECT_EQ(false, a->Contains(96)); | 84 EXPECT_EQ(false, a->Contains(96)); |
| 85 } | 85 } |
| 86 | 86 |
| 87 { BitVector* a = new BitVector(34); | 87 { BitVector* a = new BitVector(34); |
| 88 BitVector* b = new BitVector(34); | 88 BitVector* b = new BitVector(34); |
| 89 a->SetAll(); | 89 a->SetAll(); |
| 90 b->Add(0); | 90 b->Add(0); |
| 91 b->Add(1); | 91 b->Add(1); |
| 92 b->Add(31); | 92 b->Add(31); |
| 93 b->Add(32); | 93 b->Add(32); |
| 94 a->Intersect(b); | 94 a->Intersect(*b); |
| 95 EXPECT_EQ(true, a->Equals(*b)); | 95 EXPECT_EQ(true, a->Equals(*b)); |
| 96 } | 96 } |
| 97 | 97 |
| 98 { BitVector* a = new BitVector(2); | 98 { BitVector* a = new BitVector(2); |
| 99 BitVector* b = new BitVector(2); | 99 BitVector* b = new BitVector(2); |
| 100 a->SetAll(); | 100 a->SetAll(); |
| 101 a->Remove(0); | 101 a->Remove(0); |
| 102 a->Remove(1); | 102 a->Remove(1); |
| 103 EXPECT_EQ(true, a->Equals(*b)); | 103 EXPECT_EQ(true, a->Equals(*b)); |
| 104 } | 104 } |
| 105 | 105 |
| 106 { BitVector* a = new BitVector(128); | 106 { BitVector* a = new BitVector(128); |
| 107 BitVector* b = new BitVector(128); | 107 BitVector* b = new BitVector(128); |
| 108 b->Add(0); | 108 b->Add(0); |
| 109 b->Add(32); | 109 b->Add(32); |
| 110 b->Add(64); | 110 b->Add(64); |
| 111 a->Add(0); | 111 a->Add(0); |
| 112 a->Add(64); | 112 a->Add(64); |
| 113 b->RemoveAll(a); | 113 b->RemoveAll(a); |
| 114 EXPECT_EQ(false, b->Contains(0)); | 114 EXPECT_EQ(false, b->Contains(0)); |
| 115 EXPECT_EQ(true, b->Contains(32)); | 115 EXPECT_EQ(true, b->Contains(32)); |
| 116 EXPECT_EQ(false, b->Contains(64)); | 116 EXPECT_EQ(false, b->Contains(64)); |
| 117 } | 117 } |
| 118 } | 118 } |
| 119 | 119 |
| 120 } // namespace dart | 120 } // namespace dart |
| OLD | NEW |