/** * Test method: void bitmapSize() * * @throws Exception */ public void testBitmapSize() throws Exception { BitMap instance = new BitMap(1000L); int expectedSize = (1000 / 64) + 1; assertEquals(instance.bitmapSize(), expectedSize); }
/** * Test method: LongBuffer getLongBuffer() * * @throws Exception */ public void testGetLongBuffer() throws Exception { BitMap instance = new BitMap(1000L); for (int i = 0; i < 1000; i++) { if ((int) (Math.random() * 2) == 1) { instance.setBit(i); } } LongBuffer bBuf = instance.getLongBuffer(); assertNotNull(bBuf); for (int i = 0; i < instance.bitmapSize(); i++) { assertEquals(bBuf.get(i), instance.data[i]); } }