public void BitmapToPosTest() { var sectorsize = 768; var reservedsectors = 1; int v = 3; Assert.IsTrue(BitmapSector.BitmapToPos(v, sectorsize) == (reservedsectors + v) * sectorsize); }
public void PosToBitmapTest() { var sectorsize = 1845; var reservedsectors = 1; int v = 7; var bix = BitmapSector.PosToBitmap(v, sectorsize); Assert.IsTrue(bix == -reservedsectors + 0); v = 8423; bix = BitmapSector.PosToBitmap(v, sectorsize); Assert.IsTrue(bix == -reservedsectors + (int)Math.Floor((double)v / sectorsize)); }