mirror of
https://github.com/aaru-dps/Aaru.Server.git
synced 2025-12-16 19:24:27 +00:00
Added more tests.
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : BeFS_MBR.cs
|
||||
// Filename : btrfs.cs
|
||||
// Version : 1.0
|
||||
// Author(s) : Natalia Portillo
|
||||
//
|
||||
@@ -48,38 +48,34 @@ using NUnit.Framework;
|
||||
namespace DiscImageChef.Tests.Filesystems
|
||||
{
|
||||
[TestFixture]
|
||||
public class BeFS_MBR
|
||||
public class btrfs
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz",
|
||||
"linux.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1572864, 1572864,
|
||||
262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
786400, 785232,
|
||||
32512,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
1024, 1024,
|
||||
4096,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label",
|
||||
"VolumeLabel",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
null,null,
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
null,null,
|
||||
"a4fc5201-85cc-6840-8a68-998cab9ae897",
|
||||
};
|
||||
|
||||
[Test]
|
||||
@@ -87,7 +83,7 @@ namespace DiscImageChef.Tests.Filesystems
|
||||
{
|
||||
for(int i = 0; i < testfiles.Length; i++)
|
||||
{
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_mbr", testfiles[i]);
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
|
||||
Filter filter = new LZip();
|
||||
filter.Open(location);
|
||||
ImagePlugin image = new VDI();
|
||||
@@ -96,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.BeFS();
|
||||
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0xEB")
|
||||
if(partitions[j].PartitionType == "0x83")
|
||||
{
|
||||
part = j;
|
||||
break;
|
||||
@@ -111,10 +107,9 @@ 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("BeFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user