Added more tests.

This commit is contained in:
2017-07-05 06:55:25 +01:00
parent ec7b077327
commit dab93a2bad
40 changed files with 1125 additions and 3131 deletions

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Filename : Reiser3.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -48,34 +48,30 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
public class Reiser3
{
readonly string[] testfiles = {
"linux.vdi.lz",
"linux_r3.5.vdi.lz", "linux_r3.6.vdi.lz"
};
readonly ulong[] sectors = {
262144,
262144, 262144,
};
readonly uint[] sectorsize = {
512,
512, 512,
};
readonly long[] clusters = {
32512,
32512, 32512,
};
readonly int[] clustersize = {
4096,
4096, 4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
readonly string[] reiserversion = {
"Reiser 3.5 filesystem", "Reiser 3.6 filesystem"
};
[Test]
@@ -83,7 +79,7 @@ namespace DiscImageChef.Tests.Filesystems
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "reiser3", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
@@ -92,7 +88,7 @@ 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.BTRFS();
Filesystem fs = new DiscImageChef.Filesystems.Reiser();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
@@ -107,9 +103,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("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(reiserversion[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}