(int maxSize)
| 173 | } |
| 174 | |
| 175 | protected void doSingle(int maxSize) { |
| 176 | int sz = rand.nextInt(maxSize + 1); |
| 177 | int sz2 = rand.nextInt(maxSize); |
| 178 | FixedBitSet bs1 = getRandomSet(sz, rand.nextInt(sz + 1)); |
| 179 | FixedBitSet bs2 = getRandomSet(sz, rand.nextInt(sz2 + 1)); |
| 180 | |
| 181 | DocSet a1 = new BitDocSet(bs1); |
| 182 | DocSet a2 = new BitDocSet(bs2); |
| 183 | DocSet b1 = getDocSet(bs1); |
| 184 | DocSet b2 = getDocSet(bs2); |
| 185 | |
| 186 | checkEqual(bs1, b1); |
| 187 | checkEqual(bs2, b2); |
| 188 | |
| 189 | iter(a1, b1); |
| 190 | iter(a2, b2); |
| 191 | |
| 192 | collect(a1, maxSize); |
| 193 | collect(a2, maxSize); |
| 194 | |
| 195 | FixedBitSet a_and = bs1.clone(); |
| 196 | a_and.and(bs2); |
| 197 | FixedBitSet a_or = bs1.clone(); |
| 198 | a_or.or(bs2); |
| 199 | // FixedBitSet a_xor = bs1.clone(); a_xor.xor(bs2); |
| 200 | FixedBitSet a_andn = bs1.clone(); |
| 201 | a_andn.andNot(bs2); |
| 202 | |
| 203 | checkEqual(a_and, b1.intersection(b2)); |
| 204 | checkEqual(a_or, b1.union(b2)); |
| 205 | checkEqual(a_andn, b1.andNot(b2)); |
| 206 | |
| 207 | assertEquals(a_and.cardinality(), b1.intersectionSize(b2)); |
| 208 | assertEquals(a_or.cardinality(), b1.unionSize(b2)); |
| 209 | assertEquals(a_andn.cardinality(), b1.andNotSize(b2)); |
| 210 | } |
| 211 | |
| 212 | public void doMany(int maxSz, int iter) { |
| 213 | for (int i = 0; i < iter; i++) { |
no test coverage detected