@Test public void testGetBoolean() { final TransformationStrategy<Long> fixedLong = TransformationStrategies.fixedLong(); BitVector p = fixedLong.toBitVector(Long.valueOf(0)); for (int i = Long.SIZE; i-- != 0; ) assertFalse(p.getBoolean(i)); p = fixedLong.toBitVector(Long.valueOf(0xDEADBEEFDEADF00DL)); for (int i = Long.SIZE; i-- != 0; ) assertTrue(p.getBoolean(i) == ((0xDEADBEEFDEADF00DL & 1L << Long.SIZE - 1 - i) != 0)); }
@Test public void testGetLong() { final TransformationStrategy<Long> fixedLong = TransformationStrategies.fixedLong(); BitVector p = fixedLong.toBitVector(Long.valueOf(Long.reverse(0xDEADBEEFDEADF00DL))); for (int from = Long.SIZE; from-- != 0; ) for (int to = Long.SIZE; from < to--; ) assertTrue( p.getLong(from, to) == LongArrayBitVector.wrap(new long[] {0xDEADBEEFDEADF00DL}).getLong(from, to)); }