mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Added more tests.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HFS_MBR.cs
|
||||
// Filename : UFS_MBR.cs
|
||||
// Version : 1.0
|
||||
// Author(s) : Natalia Portillo
|
||||
//
|
||||
@@ -48,34 +48,34 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Filesystems
|
||||
{
|
||||
[TestFixture]
|
||||
public class HFS_MBR
|
||||
public class UFS_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"linux.vdi.lz",
|
||||
"ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
262144,
|
||||
262144, 262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
65018,
|
||||
65024, 65018,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048,
|
||||
2048, 2048
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label",
|
||||
"Volume label", "Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"0000000000000000",
|
||||
"59588B778E9ACDEF", "UNKNOWN",
|
||||
};
|
||||
|
||||
[Test]
|
||||
@@ -83,7 +83,7 @@ namespace DiscImageChef.Tests.Filesystems
|
||||
{
|
||||
for(int i = 0; i < testfiles.Length; i++)
|
||||
{
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]);
|
||||
Filter filter = new LZip();
|
||||
filter.Open(location);
|
||||
ImagePlugin image = new VDI();
|
||||
@@ -92,11 +92,11 @@ namespace DiscImageChef.Tests.Filesystems
|
||||
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]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AppleHFS();
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0xAF")
|
||||
if(partitions[j].PartitionType == "0x83")
|
||||
{
|
||||
part = j;
|
||||
break;
|
||||
@@ -107,7 +107,7 @@ namespace DiscImageChef.Tests.Filesystems
|
||||
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
|
||||
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
|
||||
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
|
||||
Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual("UFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user