public void Create() { ChsAddress g = new ChsAddress(100, 16, 63); Assert.AreEqual(100, g.Cylinder); Assert.AreEqual(16, g.Head); Assert.AreEqual(63, g.Sector); }
public void LBARoundTrip() { Geometry g = new Geometry(100, 16, 63); const int TestCylinder = 54; const int TestHead = 15; const int TestSector = 63; long lba = g.ToLogicalBlockAddress(TestCylinder, TestHead, TestSector); ChsAddress chs = g.ToChsAddress(lba); Assert.AreEqual(TestCylinder, chs.Cylinder); Assert.AreEqual(TestHead, chs.Head); Assert.AreEqual(TestSector, chs.Sector); }
/// <summary> /// Converts a CHS (Cylinder,Head,Sector) address to a LBA (Logical Block Address). /// </summary> /// <param name="chsAddress">The CHS address to convert</param> /// <returns>The Logical Block Address (in sectors)</returns> public long ToLogicalBlockAddress(ChsAddress chsAddress) { return(ToLogicalBlockAddress(chsAddress.Cylinder, chsAddress.Head, chsAddress.Sector)); }
/// <summary> /// Converts a CHS (Cylinder,Head,Sector) address to a LBA (Logical Block Address). /// </summary> /// <param name="chsAddress">The CHS address to convert</param> /// <returns>The Logical Block Address (in sectors)</returns> public long ToLogicalBlockAddress(ChsAddress chsAddress) { return ToLogicalBlockAddress(chsAddress.Cylinder, chsAddress.Head, chsAddress.Sector); }