1 21 package com.db4o.db4ounit.common.foundation; 22 23 import com.db4o.foundation.*; 24 25 import db4ounit.Assert; 26 import db4ounit.TestCase; 27 28 public class BitMap4TestCase implements TestCase { 29 30 public void test() { 31 32 byte[] buffer = new byte[100]; 33 34 for (int i = 0; i < 17; i++) { 35 BitMap4 map = new BitMap4(i); 36 map.writeTo(buffer, 11); 37 38 BitMap4 reReadMap = new BitMap4(buffer,11, i); 39 40 for (int j = 0; j < i; j++) { 41 tBit(map, j); 42 tBit(reReadMap, j); 43 } 44 } 45 46 } 47 48 private void tBit(BitMap4 map, int bit) { 49 map.setTrue(bit); 50 Assert.isTrue(map.isTrue(bit)); 51 map.setFalse(bit); 52 Assert.isFalse(map.isTrue(bit)); 53 map.setTrue(bit); 54 Assert.isTrue(map.isTrue(bit)); 55 56 } 57 58 } 59 | Popular Tags |