| OLD | NEW |
| 1 // Copyright 2010 the V8 project authors. All rights reserved. | 1 // Copyright 2010 the V8 project authors. All rights reserved. |
| 2 // Redistribution and use in source and binary forms, with or without | 2 // Redistribution and use in source and binary forms, with or without |
| 3 // modification, are permitted provided that the following conditions are | 3 // modification, are permitted provided that the following conditions are |
| 4 // met: | 4 // met: |
| 5 // | 5 // |
| 6 // * Redistributions of source code must retain the above copyright | 6 // * Redistributions of source code must retain the above copyright |
| 7 // notice, this list of conditions and the following disclaimer. | 7 // notice, this list of conditions and the following disclaimer. |
| 8 // * Redistributions in binary form must reproduce the above | 8 // * Redistributions in binary form must reproduce the above |
| 9 // copyright notice, this list of conditions and the following | 9 // copyright notice, this list of conditions and the following |
| 10 // disclaimer in the documentation and/or other materials provided | 10 // disclaimer in the documentation and/or other materials provided |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 46 v.Add(0); | 46 v.Add(0); |
| 47 v.Add(1); | 47 v.Add(1); |
| 48 BitVector w(15); | 48 BitVector w(15); |
| 49 w.Add(1); | 49 w.Add(1); |
| 50 v.Intersect(w); | 50 v.Intersect(w); |
| 51 CHECK(!v.Contains(0)); | 51 CHECK(!v.Contains(0)); |
| 52 CHECK(v.Contains(1)); | 52 CHECK(v.Contains(1)); |
| 53 } | 53 } |
| 54 | 54 |
| 55 { | 55 { |
| 56 BitVector v(64); |
| 57 v.Add(27); |
| 58 v.Add(30); |
| 59 v.Add(31); |
| 60 v.Add(33); |
| 61 BitVector::Iterator iter(&v); |
| 62 CHECK_EQ(27, iter.Current()); |
| 63 iter.Advance(); |
| 64 CHECK_EQ(30, iter.Current()); |
| 65 iter.Advance(); |
| 66 CHECK_EQ(31, iter.Current()); |
| 67 iter.Advance(); |
| 68 CHECK_EQ(33, iter.Current()); |
| 69 iter.Advance(); |
| 70 CHECK(iter.Done()); |
| 71 } |
| 72 |
| 73 { |
| 56 BitVector v(15); | 74 BitVector v(15); |
| 57 v.Add(0); | 75 v.Add(0); |
| 58 BitVector w(15); | 76 BitVector w(15); |
| 59 w.Add(1); | 77 w.Add(1); |
| 60 v.Union(w); | 78 v.Union(w); |
| 61 CHECK(v.Contains(0)); | 79 CHECK(v.Contains(0)); |
| 62 CHECK(v.Contains(1)); | 80 CHECK(v.Contains(1)); |
| 63 } | 81 } |
| 64 | 82 |
| 65 { | 83 { |
| (...skipping 29 matching lines...) Expand all Loading... |
| 95 w.Add(33); | 113 w.Add(33); |
| 96 v.Intersect(w); | 114 v.Intersect(w); |
| 97 CHECK(!v.Contains(32)); | 115 CHECK(!v.Contains(32)); |
| 98 CHECK(v.Contains(33)); | 116 CHECK(v.Contains(33)); |
| 99 BitVector r(35); | 117 BitVector r(35); |
| 100 r.CopyFrom(v); | 118 r.CopyFrom(v); |
| 101 CHECK(!r.Contains(32)); | 119 CHECK(!r.Contains(32)); |
| 102 CHECK(r.Contains(33)); | 120 CHECK(r.Contains(33)); |
| 103 } | 121 } |
| 104 } | 122 } |
| OLD | NEW |