Chromium Code Reviews| 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 43 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 54 BitVector v(15); | 54 BitVector v(15); |
| 55 v.Add(0); | 55 v.Add(0); |
| 56 BitVector w(15); | 56 BitVector w(15); |
| 57 w.Add(1); | 57 w.Add(1); |
| 58 v.Union(w); | 58 v.Union(w); |
| 59 CHECK(v.Contains(0)); | 59 CHECK(v.Contains(0)); |
| 60 CHECK(v.Contains(1)); | 60 CHECK(v.Contains(1)); |
| 61 } | 61 } |
| 62 | 62 |
| 63 { | 63 { |
| 64 BitVector v(15); | |
| 65 v.Add(0); | |
| 66 BitVector w = v; | |
|
Kevin Millikin (Chromium)
2010/03/09 09:38:10
This is not testing the assignment operator.
fschneider
2010/03/09 09:51:53
Done.
| |
| 67 CHECK(w.Contains(0)); | |
| 68 w.Add(1); | |
| 69 BitVector u(w); | |
| 70 CHECK(u.Contains(0)); | |
| 71 CHECK(u.Contains(1)); | |
| 72 v.Union(w); | |
| 73 CHECK(v.Contains(0)); | |
| 74 CHECK(v.Contains(1)); | |
| 75 } | |
| 76 | |
| 77 { | |
| 64 BitVector v(35); | 78 BitVector v(35); |
| 65 v.Add(0); | 79 v.Add(0); |
| 66 BitVector w(35); | 80 BitVector w(35); |
| 67 w.Add(33); | 81 w.Add(33); |
| 68 v.Union(w); | 82 v.Union(w); |
| 69 CHECK(v.Contains(0)); | 83 CHECK(v.Contains(0)); |
| 70 CHECK(v.Contains(33)); | 84 CHECK(v.Contains(33)); |
| 71 } | 85 } |
| 72 | 86 |
| 73 { | 87 { |
| 74 BitVector v(35); | 88 BitVector v(35); |
| 75 v.Add(32); | 89 v.Add(32); |
| 76 v.Add(33); | 90 v.Add(33); |
| 77 BitVector w(35); | 91 BitVector w(35); |
| 78 w.Add(33); | 92 w.Add(33); |
| 79 v.Intersect(w); | 93 v.Intersect(w); |
| 80 CHECK(!v.Contains(32)); | 94 CHECK(!v.Contains(32)); |
| 81 CHECK(v.Contains(33)); | 95 CHECK(v.Contains(33)); |
| 82 BitVector r(35); | 96 BitVector r(35); |
| 83 r.CopyFrom(v); | 97 r.CopyFrom(v); |
| 84 CHECK(!r.Contains(32)); | 98 CHECK(!r.Contains(32)); |
| 85 CHECK(r.Contains(33)); | 99 CHECK(r.Contains(33)); |
| 86 } | 100 } |
| 87 } | 101 } |
| OLD | NEW |