Use generic method to search for partitions, supporting

partitions inside partitions. At the same time SGI DVH is
	disabled because it is not working correctly. Fixes #60
This commit is contained in:
2017-07-24 23:35:33 +01:00
parent dad9ea8584
commit 72dd8d9179
108 changed files with 517 additions and 521 deletions

View File

@@ -1,4 +1,4 @@
// /***************************************************************************
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
@@ -64,7 +64,7 @@ namespace DiscImageChef.Tests.Filesystems
};
readonly long[] clusters = {
408240,408240,
406224,406224,
};
readonly int[] clustersize = {
@@ -76,14 +76,13 @@ namespace DiscImageChef.Tests.Filesystems
};
readonly string[] volumeserial = {
null,null,
"A58348CE","A5833CD0",
};
[Test]
public void Test()
{
throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here.");
/* for(int i = 0; i < testfiles.Length; i++)
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
@@ -92,19 +91,18 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x2D")
if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreNotEqual(-1, part, string.Format("Partition not found on {0}", testfiles[i]));
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
@@ -112,7 +110,7 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}*/
}
}
}
}