Lines Matching refs:i
25 for (int i = 1; i <= 32; i++) { in test_makeBitSet()
26 assertEquals(label(i), 1, Bits.makeBitSet(i).length); in test_makeBitSet()
29 for (int i = 33; i <= 64; i++) { in test_makeBitSet()
30 assertEquals(label(i), 2, Bits.makeBitSet(i).length); in test_makeBitSet()
33 for (int i = 65; i < 4000; i += 101) { in test_makeBitSet()
34 int expect = i >> 5; in test_makeBitSet()
35 if ((expect * 32) < i) { in test_makeBitSet()
38 assertEquals(label(i), expect, Bits.makeBitSet(i).length); in test_makeBitSet()
43 for (int i = 0; i < 4000; i += 59) { in test_getMax()
44 int expect = i >> 5; in test_getMax()
45 if ((expect * 32) < i) { in test_getMax()
48 assertEquals(label(i), expect * 32, in test_getMax()
56 for (int i = 0; i < 100; i++) { in test1_get()
57 assertFalse(label(i), Bits.get(bits, i)); in test1_get()
63 for (int i = 0; i < bits.length; i++) { in test2_get()
64 bits[i] = -1; in test2_get()
67 for (int i = 0; i < 100; i++) { in test2_get()
68 assertTrue(label(i), Bits.get(bits, i)); in test2_get()
75 for (int i = 0; i < 100; i++) { in test3_get()
76 Bits.set(bits, i, (i % 5) == 0); in test3_get()
79 for (int i = 0; i < 100; i++) { in test3_get()
80 boolean expect = (i % 5) == 0; in test3_get()
81 assertTrue(label(i), Bits.get(bits, i) == expect); in test3_get()
105 for (int i = 0; i < 100; i++) { in test2_set1()
106 if ((i % 3) == 0) { in test2_set1()
107 Bits.set(bits, i, true); in test2_set1()
111 for (int i = 0; i < 100; i++) { in test2_set1()
112 if ((i % 5) == 0) { in test2_set1()
113 Bits.set(bits, i, false); in test2_set1()
117 for (int i = 0; i < 100; i++) { in test2_set1()
118 if ((i % 7) == 0) { in test2_set1()
119 Bits.set(bits, i, true); in test2_set1()
123 for (int i = 0; i < 100; i++) { in test2_set1()
124 boolean expect = ((i % 7) == 0) || in test2_set1()
125 (((i % 3) == 0) && ((i % 5) != 0)); in test2_set1()
126 assertTrue(label(i), Bits.get(bits, i) == expect); in test2_set1()
133 for (int i = 0; i < 100; i++) { in test_set2()
134 if ((i % 11) == 0) { in test_set2()
135 Bits.set(bits, i); in test_set2()
139 for (int i = 0; i < 100; i++) { in test_set2()
140 boolean expect = (i % 11) == 0; in test_set2()
141 assertTrue(label(i), Bits.get(bits, i) == expect); in test_set2()
147 for (int i = 0; i < bits.length; i++) { in test_clear()
148 bits[i] = -1; in test_clear()
151 for (int i = 0; i < 100; i++) { in test_clear()
152 if ((i % 5) == 0) { in test_clear()
153 Bits.clear(bits, i); in test_clear()
157 for (int i = 0; i < 100; i++) { in test_clear()
158 boolean expect = (i % 5) != 0; in test_clear()
159 assertTrue(label(i), Bits.get(bits, i) == expect); in test_clear()
164 for (int i = 0; i < 10; i++) { in test1_isEmpty()
165 assertTrue(label(i), Bits.isEmpty(new int[i])); in test1_isEmpty()
170 for (int i = 1; i < 1000; i += 11) { in test2_isEmpty()
171 int[] bits = Bits.makeBitSet(i); in test2_isEmpty()
172 for (int j = i % 11; j >= 0; j--) { in test2_isEmpty()
173 int x = i - 1 - (j * 13); in test2_isEmpty()
178 assertFalse(label(i), Bits.isEmpty(bits)); in test2_isEmpty()
183 for (int i = 0; i < 10; i++) { in test1_bitCount()
184 assertEquals(label(i), 0, Bits.bitCount(new int[i])); in test1_bitCount()
189 for (int i = 1; i < 1000; i += 13) { in test2_bitCount()
190 int[] bits = Bits.makeBitSet(i); in test2_bitCount()
192 for (int j = 0; j < i; j += 20) { in test2_bitCount()
196 for (int j = 7; j < i; j += 11) { in test2_bitCount()
202 for (int j = 3; j < i; j += 17) { in test2_bitCount()
208 assertEquals(label(i), count, Bits.bitCount(bits)); in test2_bitCount()
215 for (int i = 0; i < 100; i += 11) { in test1_anyInRange()
216 assertFalse(label(i), Bits.anyInRange(bits, 0, i)); in test1_anyInRange()
223 for (int i = 0; i < 100; i += 11) { in test2_anyInRange()
224 assertFalse(label(i), Bits.anyInRange(bits, i, 100)); in test2_anyInRange()
231 for (int i = 0; i < 50; i += 7) { in test3_anyInRange()
232 assertFalse(label(i), Bits.anyInRange(bits, i, 100 - i)); in test3_anyInRange()
238 for (int i = 0; i < bits.length; i++) { in test4_anyInRange()
239 bits[i] = -1; in test4_anyInRange()
242 for (int i = 1; i < 100; i += 11) { in test4_anyInRange()
243 assertTrue(label(i), Bits.anyInRange(bits, 0, i)); in test4_anyInRange()
249 for (int i = 0; i < bits.length; i++) { in test5_anyInRange()
250 bits[i] = -1; in test5_anyInRange()
253 for (int i = 1; i < 100; i += 11) { in test5_anyInRange()
254 assertTrue(label(i), Bits.anyInRange(bits, i, 100)); in test5_anyInRange()
260 for (int i = 0; i < bits.length; i++) { in test6_anyInRange()
261 bits[i] = -1; in test6_anyInRange()
264 for (int i = 0; i < 50; i += 7) { in test6_anyInRange()
265 assertTrue(label(i), Bits.anyInRange(bits, i, 100 - i)); in test6_anyInRange()
272 for (int i = 0; i < 100; i++) { in test1_findFirst1()
273 assertEquals(label(i), -1, Bits.findFirst(bits, i)); in test1_findFirst1()
279 for (int i = 0; i < bits.length; i++) { in test2_findFirst1()
280 bits[i] = -1; in test2_findFirst1()
283 for (int i = 0; i < 100; i++) { in test2_findFirst1()
284 assertEquals(label(i), i, Bits.findFirst(bits, i)); in test2_findFirst1() local
291 for (int i = 25; i < 80; i++) { in test3_findFirst1()
296 Bits.set(bits, i - 5); in test3_findFirst1()
297 Bits.set(bits, i + 5); in test3_findFirst1()
298 Bits.set(bits, i + 10); in test3_findFirst1()
299 Bits.set(bits, i + 20); in test3_findFirst1()
300 assertEquals(label(i), i + 5, Bits.findFirst(bits, i)); in test3_findFirst1() local
305 for (int i = 0; i < 32; i++) { in test1_findFirst2()
306 assertEquals(label(i), -1, Bits.findFirst(0, i)); in test1_findFirst2()
311 for (int i = 0; i < 32; i++) { in test2_findFirst2()
312 assertEquals(label(i), i, Bits.findFirst(-1, i)); in test2_findFirst2() local
317 for (int i = 0; i < 32; i++) { in test3_findFirst2()
318 assertEquals(label(i), -1, Bits.findFirst((1 << i) >>> 1, i)); in test3_findFirst2()
323 for (int i = 0; i < 32; i++) { in test4_findFirst2()
324 assertEquals(label(i), i, Bits.findFirst(1 << i, i)); in test4_findFirst2() local
329 for (int i = 0; i < 31; i++) { in test5_findFirst2()
330 assertEquals(label(i), i + 1, Bits.findFirst(1 << (i + 1), i)); in test5_findFirst2() local
335 for (int i = 0; i < 32; i++) { in test6_findFirst2()
336 int value = (1 << i); in test6_findFirst2()
338 assertEquals(label(i), i, Bits.findFirst(value, i)); in test6_findFirst2() local