use of kodkod.util.ints.IntIterator in project org.alloytools.alloy by AlloyTools.
the class BugTests method testEmina_01192006.
public final void testEmina_01192006() {
IntBitSet s = new IntBitSet(64);
for (int i = 4; i < 8; i++) {
for (int j = 0; j < 4; j++) {
s.add(i * 8 + j);
}
}
// System.out.println(s);
for (int i = 4; i < 8; i++) {
assertTrue(s.iterator(i * 8, (i + 1) * 8 - 1).hasNext());
int count = 0;
for (IntIterator iter = s.iterator(i * 8, (i + 1) * 8 - 1); iter.hasNext(); ) {
count += iter.next() % 8;
}
assertEquals(count, 6);
}
for (int i = 4; i < 8; i++) {
assertTrue(s.iterator((i + 1) * 8 - 1, i * 8).hasNext());
int count = 0;
for (IntIterator iter = s.iterator((i + 1) * 8 - 1, i * 8); iter.hasNext(); ) {
count += iter.next() % 8;
}
assertEquals(count, 6);
}
}
use of kodkod.util.ints.IntIterator in project org.alloytools.alloy by AlloyTools.
the class BugTests method testVincent_02132006.
public final void testVincent_02132006() {
IntTreeSet set = new IntTreeSet();
for (int i = 0; i < 2; i++) {
set.add(i);
}
IntTreeSet set2 = new IntTreeSet();
for (int i = 0; i < 2; i++) {
set2.add(i);
}
set.removeAll(set2);
IntIterator setIterator = set.iterator();
assertFalse(setIterator.hasNext());
assertFalse(setIterator.hasNext());
set.addAll(set2);
assertSameContents(set, 0, 1);
set2.clear();
for (int i = 3; i < 5; i++) {
set2.add(i);
}
set.addAll(set2);
assertSameContents(set, 0, 1, 3, 4);
set2.clear();
for (int i = 1; i < 4; i++) {
set2.add(i);
}
set.addAll(set2);
assertSameContents(set, 0, 1, 2, 3, 4);
}
Aggregations