REFACTOR: Join filesystem tests to a single file per filesystem, instead of per partition.

This commit is contained in:
2017-12-24 04:31:16 +00:00
parent a95ff85c56
commit 7f3b1dfbb7
90 changed files with 3439 additions and 5570 deletions

View File

@@ -70,96 +70,48 @@
<Compile Include="Filters\MacBinary2.cs" /> <Compile Include="Filters\MacBinary2.cs" />
<Compile Include="Filesystems\ADFS.cs" /> <Compile Include="Filesystems\ADFS.cs" />
<Compile Include="Filesystems\FAT12.cs" /> <Compile Include="Filesystems\FAT12.cs" />
<Compile Include="Filesystems\FAT12_MBR.cs" />
<Compile Include="Filesystems\FAT16_MBR.cs" />
<Compile Include="Filesystems\FAT32_MBR.cs" />
<Compile Include="Filesystems\HPFS.cs" /> <Compile Include="Filesystems\HPFS.cs" />
<Compile Include="Filesystems\BeFS.cs" /> <Compile Include="Filesystems\BeFS.cs" />
<Compile Include="Filesystems\BeFS_APM.cs" /> <Compile Include="Filesystems\FAT32.cs" />
<Compile Include="Filesystems\BeFS_MBR.cs" /> <Compile Include="Filesystems\PFS3.cs" />
<Compile Include="Filesystems\FAT16_APM.cs" /> <Compile Include="Filesystems\HFSPlus.cs" />
<Compile Include="Filesystems\FAT16_GPT.cs" /> <Compile Include="Filesystems\HFSX.cs" />
<Compile Include="Filesystems\FAT32_APM.cs" />
<Compile Include="Filesystems\FAT32_GPT.cs" />
<Compile Include="Filesystems\PFS3_RDB.cs" />
<Compile Include="Filesystems\SFS_RDB.cs" />
<Compile Include="Filesystems\HFSPlus_MBR.cs" />
<Compile Include="Filesystems\HFSPlus_APM.cs" />
<Compile Include="Filesystems\HFSPlus_GPT.cs" />
<Compile Include="Filesystems\HFSX_APM.cs" />
<Compile Include="Filesystems\HFSX_GPT.cs" />
<Compile Include="Filesystems\HFSX_MBR.cs" />
<Compile Include="Filesystems\LisaFS.cs" /> <Compile Include="Filesystems\LisaFS.cs" />
<Compile Include="Filesystems\Locus.cs" /> <Compile Include="Filesystems\Locus.cs" />
<Compile Include="Filesystems\NTFS_MBR.cs" /> <Compile Include="Filesystems\ReFS.cs" />
<Compile Include="Filesystems\ReFS_MBR.cs" />
<Compile Include="Filesystems\UDF.cs" /> <Compile Include="Filesystems\UDF.cs" />
<Compile Include="Filesystems\btrfs.cs" /> <Compile Include="Filesystems\btrfs.cs" />
<Compile Include="Filesystems\exFAT_APM.cs" /> <Compile Include="Filesystems\exFAT.cs" />
<Compile Include="Filesystems\exFAT_GPT.cs" />
<Compile Include="Filesystems\exFAT_MBR.cs" />
<Compile Include="Filesystems\ext2.cs" /> <Compile Include="Filesystems\ext2.cs" />
<Compile Include="Filesystems\F2FS.cs" /> <Compile Include="Filesystems\F2FS.cs" />
<Compile Include="Filesystems\FAT12_APM.cs" />
<Compile Include="Filesystems\FAT12_GPT.cs" />
<Compile Include="Filesystems\HFS_MBR.cs" />
<Compile Include="Filesystems\JFS2.cs" /> <Compile Include="Filesystems\JFS2.cs" />
<Compile Include="Filesystems\MINIXv1_MBR.cs" />
<Compile Include="Filesystems\NILFS2.cs" /> <Compile Include="Filesystems\NILFS2.cs" />
<Compile Include="Filesystems\Reiser3.cs" /> <Compile Include="Filesystems\Reiser3.cs" />
<Compile Include="Filesystems\Reiser4.cs" /> <Compile Include="Filesystems\Reiser4.cs" />
<Compile Include="Filesystems\UNIXBFS.cs" /> <Compile Include="Filesystems\UNIXBFS.cs" />
<Compile Include="Filesystems\UFS_MBR.cs" />
<Compile Include="Filesystems\AFFS.cs" /> <Compile Include="Filesystems\AFFS.cs" />
<Compile Include="Filesystems\AFFS_RDB.cs" /> <Compile Include="Filesystems\AFFS2.cs" />
<Compile Include="Filesystems\AFFS2_RDB.cs" />
<Compile Include="Filesystems\AOFS_RDB.cs" />
<Compile Include="Filesystems\AOFS.cs" /> <Compile Include="Filesystems\AOFS.cs" />
<Compile Include="Filesystems\AFFS_MBR.cs" /> <Compile Include="Filesystems\HAMMER.cs" />
<Compile Include="Filesystems\AOFS_MBR.cs" />
<Compile Include="Filesystems\AFFS_MBR_RDB.cs" />
<Compile Include="Filesystems\AOFS_MBR_RDB.cs" />
<Compile Include="Filesystems\BeFS_GPT.cs" />
<Compile Include="Filesystems\FAT16_Atari.cs" />
<Compile Include="Filesystems\FAT16_RDB.cs" />
<Compile Include="Filesystems\HAMMER_MBR.cs" />
<Compile Include="Filesystems\HFS.cs" /> <Compile Include="Filesystems\HFS.cs" />
<Compile Include="Filesystems\HFS_APM.cs" /> <Compile Include="Filesystems\LFS.cs" />
<Compile Include="Filesystems\HFS_RDB.cs" />
<Compile Include="Filesystems\LFS_MBR.cs" />
<Compile Include="Filesystems\MFS.cs" /> <Compile Include="Filesystems\MFS.cs" />
<Compile Include="Filesystems\NTFS_GPT.cs" /> <Compile Include="Filesystems\NTFS.cs" />
<Compile Include="Filesystems\NWFS386.cs" /> <Compile Include="Filesystems\NWFS386.cs" />
<Compile Include="Filesystems\OCFS2.cs" /> <Compile Include="Filesystems\OCFS2.cs" />
<Compile Include="Filesystems\ProDOS_APM.cs" /> <Compile Include="Filesystems\ProDOS.cs" />
<Compile Include="Filesystems\SysV.cs" /> <Compile Include="Filesystems\SysV.cs" />
<Compile Include="Filesystems\SysV_RDB.cs" /> <Compile Include="Filesystems\SFS.cs" />
<Compile Include="Filesystems\SysV_MBR.cs" />
<Compile Include="Filesystems\SFS_MBR_RDB.cs" />
<Compile Include="Filesystems\SFS_MBR.cs" />
<Compile Include="Filesystems\UFS.cs" /> <Compile Include="Filesystems\UFS.cs" />
<Compile Include="Filesystems\UFS_APM.cs" />
<Compile Include="Filesystems\UFS_NeXT.cs" />
<Compile Include="Filesystems\UFS_RDB.cs" />
<Compile Include="Filesystems\UFS_Suni86.cs" />
<Compile Include="Filesystems\UNIXBFS_RDB.cs" />
<Compile Include="Filesystems\UNIXBFS_MBR.cs" />
<Compile Include="Filesystems\ZFS.cs" /> <Compile Include="Filesystems\ZFS.cs" />
<Compile Include="Devices\IomegaJaz.cs" /> <Compile Include="Devices\IomegaJaz.cs" />
<Compile Include="Devices\LS120.cs" /> <Compile Include="Devices\LS120.cs" />
<Compile Include="Devices\PocketZip.cs" /> <Compile Include="Devices\PocketZip.cs" />
<Compile Include="Filesystems\Atheos_MBR.cs" /> <Compile Include="Filesystems\Atheos.cs" />
<Compile Include="Filesystems\FAT16.cs" /> <Compile Include="Filesystems\FAT16.cs" />
<Compile Include="Filesystems\HFS_CDROM.cs" /> <Compile Include="Filesystems\MINIX.cs" />
<Compile Include="Filesystems\MINIXv2_MBR.cs" />
<Compile Include="Filesystems\MINIXv3_MBR.cs" />
<Compile Include="Filesystems\MINIXv1.cs" />
<Compile Include="Filesystems\MINIXv3.cs" />
<Compile Include="Filesystems\MINIXv2.cs" />
<Compile Include="Filesystems\QNX4.cs" /> <Compile Include="Filesystems\QNX4.cs" />
<Compile Include="Filesystems\QNX4_MBR.cs" /> <Compile Include="Filesystems\XFS.cs" />
<Compile Include="Filesystems\XFS_MBR.cs" />
<Compile Include="Filesystems\UFS_NeXT_Floppy.cs" />
<Compile Include="Partitions\AppleMap.cs" /> <Compile Include="Partitions\AppleMap.cs" />
<Compile Include="Partitions\Atari.cs" /> <Compile Include="Partitions\Atari.cs" />
<Compile Include="Partitions\BSD.cs" /> <Compile Include="Partitions\BSD.cs" />
@@ -178,12 +130,6 @@
<Compile Include="Filesystems\DTFS.cs" /> <Compile Include="Filesystems\DTFS.cs" />
<Compile Include="Filesystems\AFS.cs" /> <Compile Include="Filesystems\AFS.cs" />
<Compile Include="Filesystems\EAFS.cs" /> <Compile Include="Filesystems\EAFS.cs" />
<Compile Include="Filesystems\XENIX_MBR.cs" />
<Compile Include="Filesystems\EAFS_MBR.cs" />
<Compile Include="Filesystems\AFS_MBR.cs" />
<Compile Include="Filesystems\COHERENT_MBR.cs" />
<Compile Include="Filesystems\HTFS_MBR.cs" />
<Compile Include="Filesystems\DTFS_MBR.cs" />
<Compile Include="Filesystems\ISO9660.cs" /> <Compile Include="Filesystems\ISO9660.cs" />
<Compile Include="Images\2MG.cs" /> <Compile Include="Images\2MG.cs" />
<Compile Include="Images\Anex86.cs" /> <Compile Include="Images\Anex86.cs" />

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -84,4 +85,167 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class AffsMbr
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {408240, 408240};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A582DCA4", "A582BC91"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x2D" || partitions[j].Type == "0x2E")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
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]);
}
}
}
[TestFixture]
public class AffsMbrRdb
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {406224, 406224};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A58348CE", "A5833CD0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
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]);
}
}
}
[TestFixture]
public class AffsRdb
{
readonly string[] testfiles =
{
"amigaos_3.9.vdi.lz", "amigaos_3.9_intl.vdi.lz", "aros.vdi.lz", "aros_intl.vdi.lz", "amigaos_4.0.vdi.lz",
"amigaos_4.0_intl.vdi.lz", "amigaos_4.0_cache.vdi.lz"
};
readonly ulong[] sectors = {1024128, 1024128, 409600, 409600, 1024128, 1024128, 1024128};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters = {510032, 510032, 407232, 407232, 511040, 511040, 511040};
readonly int[] clustersize = {1024, 1024, 512, 512, 1024, 1024, 1024};
readonly string[] volumename =
{
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label"
};
readonly string[] volumeserial =
{"A56D0F5C", "A56D049C", "A58307A9", "A58304BE", "A56CC7EE", "A56CDDC4", "A56CC133"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"" ||
partitions[j].Type == "\"DOS\\5\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
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]);
}
}
}
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS2_RDB.cs // Filename : AFFS2.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : AFFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AffsMbr
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {408240, 408240};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A582DCA4", "A582BC91"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x2D" || partitions[j].Type == "0x2E")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
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]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : AFFS_MBR_RD.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AffsMbrRdb
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {406224, 406224};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A58348CE", "A5833CD0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
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]);
}
}
}
}

View File

@@ -1,99 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : AFFS_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AffsRdb
{
readonly string[] testfiles =
{
"amigaos_3.9.vdi.lz", "amigaos_3.9_intl.vdi.lz", "aros.vdi.lz", "aros_intl.vdi.lz", "amigaos_4.0.vdi.lz",
"amigaos_4.0_intl.vdi.lz", "amigaos_4.0_cache.vdi.lz"
};
readonly ulong[] sectors = {1024128, 1024128, 409600, 409600, 1024128, 1024128, 1024128};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters = {510032, 510032, 407232, 407232, 511040, 511040, 511040};
readonly int[] clustersize = {1024, 1024, 512, 512, 1024, 1024, 1024};
readonly string[] volumename =
{
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label"
};
readonly string[] volumeserial =
{"A56D0F5C", "A56D049C", "A58307A9", "A58304BE", "A56CC7EE", "A56CDDC4", "A56CC133"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\1\"" || partitions[j].Type == "\"DOS\\3\"" ||
partitions[j].Type == "\"DOS\\5\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
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]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -96,4 +97,57 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class AfsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null, null};
readonly string[] type = {"Acer Fast Filesystem"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "afs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : AFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AfsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null, null};
readonly string[] type = {"Acer Fast Filesystem"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "afs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -84,4 +85,159 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class AofsMbr
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {408240, 408240};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A582C90C", "A582CE0D"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x2C")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class AofsMbrRdb
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {406224, 406224};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A5833C5B", "A5833085"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\0\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class AofsRdb
{
readonly string[] testfiles =
{"amigaos_3.9.vdi.lz", "amigaos_3.9_intl.vdi.lz", "aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {1024128, 1024128, 409600, 409600};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {510032, 510032, 407232, 407232};
readonly int[] clustersize = {1024, 1024, 512, 512};
readonly string[] volumename = {"Volume label", "Volume label", "Volume label", "Volume label"};
readonly string[] volumeserial = {"A56D13BB", "A56D0415", "A582F3A0", "A5830B06"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\0\"" || partitions[j].Type == "\"DOS\\2\"" ||
partitions[j].Type == "\"DOS\\4\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Settings.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AofsMbr
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {408240, 408240};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A582C90C", "A582CE0D"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x2C")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : AOFS_MBR_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AofsMbrRdb
{
readonly string[] testfiles = {"aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {409600, 409600};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {406224, 406224};
readonly int[] clustersize = {512, 512};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {"A5833C5B", "A5833085"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\0\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : AOFS_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class AofsRdb
{
readonly string[] testfiles =
{"amigaos_3.9.vdi.lz", "amigaos_3.9_intl.vdi.lz", "aros.vdi.lz", "aros_intl.vdi.lz"};
readonly ulong[] sectors = {1024128, 1024128, 409600, 409600};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {510032, 510032, 407232, 407232};
readonly int[] clustersize = {1024, 1024, 512, 512};
readonly string[] volumename = {"Volume label", "Volume label", "Volume label", "Volume label"};
readonly string[] volumeserial = {"A56D13BB", "A56D0415", "A582F3A0", "A5830B06"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AmigaDOSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"DOS\\0\"" || partitions[j].Type == "\"DOS\\2\"" ||
partitions[j].Type == "\"DOS\\4\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : Atheos_MBR.cs // Filename : Atheos.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -87,4 +88,159 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class BeFsApm
{
readonly string[] testfiles = {"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz"};
readonly ulong[] sectors = {1572864, 1572864};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {786336, 786336};
readonly int[] clustersize = {1024, 1024};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {null, null};
readonly string[] oemid = {null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Be_BFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(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]);
}
}
}
[TestFixture]
public class BeFsGpt
{
readonly string[] testfiles = {"haiku_hrev51259.vdi.lz"};
readonly ulong[] sectors = {8388608};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {2096640};
readonly int[] clustersize = {2048};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Haiku BFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class BeFsMbr
{
readonly string[] testfiles =
{"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "haiku_hrev51259.vdi.lz", "syllable_0.6.7.vdi.lz"};
readonly ulong[] sectors = {1572864, 1572864, 8388608, 2097152};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {786400, 785232, 2096640, 524272};
readonly int[] clustersize = {1024, 1024, 2048, 2048};
readonly string[] volumename = {"Volume label", "Volume label", "Volume label", "Volume label"};
readonly string[] volumeserial = {null, null, null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xEB")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class BeFsApm
{
readonly string[] testfiles = {"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz"};
readonly ulong[] sectors = {1572864, 1572864};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {786336, 786336};
readonly int[] clustersize = {1024, 1024};
readonly string[] volumename = {"Volume label", "Volume label"};
readonly string[] volumeserial = {null, null};
readonly string[] oemid = {null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Be_BFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(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]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class BeFsGpt
{
readonly string[] testfiles = {"haiku_hrev51259.vdi.lz"};
readonly ulong[] sectors = {8388608};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {2096640};
readonly int[] clustersize = {2048};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Haiku BFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,90 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class BeFsMbr
{
readonly string[] testfiles =
{"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "haiku_hrev51259.vdi.lz", "syllable_0.6.7.vdi.lz"};
readonly ulong[] sectors = {1572864, 1572864, 8388608, 2097152};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {786400, 785232, 2096640, 524272};
readonly int[] clustersize = {1024, 1024, 2048, 2048};
readonly string[] volumename = {"Volume label", "Volume label", "Volume label", "Volume label"};
readonly string[] volumeserial = {null, null, null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xEB")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -91,4 +92,56 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class CoherentMbr
{
readonly string[] testfiles = {"coherentunix_4.2.10.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"Coherent fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "coherent_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x09")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : COHERENT_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class CoherentMbr
{
readonly string[] testfiles = {"coherentunix_4.2.10.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"Coherent fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "coherent_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x09")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -92,4 +93,56 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class DtfsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"DTFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "dtfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : DTFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class DtfsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"DTFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "dtfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -96,4 +97,56 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class EafsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"Extended Acer Fast Filesystem"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "eafs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : EAFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class EafsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {510048};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"Extended Acer Fast Filesystem"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "eafs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -1734,4 +1735,222 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class Fat12Apm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {16384};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {4076};
readonly int[] clustersize = {2048};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"32181F09"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "DOS_FAT_12")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT12", 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]);
}
}
}
[TestFixture]
public class Fat12Gpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {16384};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {4076};
readonly int[] clustersize = {2048};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"66901F1B"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT12", 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]);
}
}
}
[TestFixture]
public class Fat12Mbr
{
readonly string[] testfiles =
{
"compaqmsdos331.vdi.lz", "drdos_3.40.vdi.lz", "drdos_3.41.vdi.lz", "drdos_5.00.vdi.lz", "drdos_6.00.vdi.lz",
"drdos_7.02.vdi.lz", "drdos_7.03.vdi.lz", "drdos_8.00.vdi.lz", "msdos331.vdi.lz", "msdos401.vdi.lz",
"msdos500.vdi.lz", "msdos600.vdi.lz", "msdos620rc1.vdi.lz", "msdos620.vdi.lz", "msdos621.vdi.lz",
"msdos622.vdi.lz", "msdos710.vdi.lz", "novelldos_7.00.vdi.lz", "opendos_7.01.vdi.lz", "pcdos2000.vdi.lz",
"pcdos200.vdi.lz", "pcdos210.vdi.lz", "pcdos300.vdi.lz", "pcdos310.vdi.lz", "pcdos330.vdi.lz",
"pcdos400.vdi.lz", "pcdos500.vdi.lz", "pcdos502.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz",
"toshibamsdos330.vdi.lz", "toshibamsdos401.vdi.lz", "msos2_1.21.vdi.lz", "msos2_1.30.1.vdi.lz",
"multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz", "os2_1.30.vdi.lz", "os2_6.307.vdi.lz", "os2_6.514.vdi.lz",
"os2_6.617.vdi.lz", "os2_8.162.vdi.lz", "os2_9.023.vdi.lz", "ecs.vdi.lz", "macosx_10.11.vdi.lz",
"win10.vdi.lz", "win2000.vdi.lz", "win95.vdi.lz", "win95osr2.1.vdi.lz", "win95osr2.5.vdi.lz",
"win95osr2.vdi.lz", "win98.vdi.lz", "win98se.vdi.lz", "winme.vdi.lz", "winnt_3.10.vdi.lz",
"winnt_3.50.vdi.lz", "winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz", "beos_r4.5.vdi.lz",
"linux.vdi.lz", "freebsd_6.1.vdi.lz", "freebsd_7.0.vdi.lz", "freebsd_8.2.vdi.lz"
};
readonly ulong[] sectors =
{
8192, 30720, 28672, 28672, 28672, 28672, 28672, 28672, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
16384, 28672, 28672, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 8192,
8192, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
1000, 3654, 3520, 3520, 3520, 3520, 3520, 3520, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 2008, 3520,
3520, 4024, 4031, 4031, 4024, 4024, 4024, 4024, 4024, 4024, 4024, 4024, 1000, 1000, 2008, 2008, 2008, 2008,
2008, 2008, 2008, 2008, 2008, 2008, 1890, 4079, 3552, 4088, 2008, 2008, 2008, 2008, 2044, 2044, 2044, 4016,
2044, 2044, 4016, 3072, 2040, 3584, 2044, 2044, 2044
};
readonly int[] clustersize =
{
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096, 4096, 4096, 4096, 2048, 2048, 2048, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 2048,
4096, 4096, 2048, 2048, 4096, 2048, 4096, 4096, 4096
};
readonly string[] volumename =
{
null, "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", null, null, null,
null, null, "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VolumeLabel", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL"
};
readonly string[] volumeserial =
{
null, null, null, null, null, null, null, "1BFB1273", null, "407D1907", "345D18FB", "332518F4", "395718E9",
"076718EF", "1371181B", "23281816", "2F781809", null, null, "294F100F", null, null, null, null, null,
"0F340FE4", "1A5E0FF9", "1D2F0FFE", "076C1004", "2C481009", null, "3C2319E8", "66CC3C15", "66A54C15", null,
"5C578015", "5B845015", "5C4BF015", "E6B5F414", "E6B15414", "E6A41414", "E6A39414", "E6B0B814", "26A21EF4",
"74F4921D", "C4B64D11", "29200D0C", "234F0DE4", "074C0DFC", "33640D18", "0E121460", "094C0EED", "38310F02",
"50489A1B", "2CE52101", "94313E7E", "BC184FE6", "BAD08A1E", "00000000", "8D418102", "8FC80E0A", "34FA0E0B",
"02140E0B"
};
readonly string[] oemid =
{
"IBM 3.3", "IBM 3.2", "IBM 3.2", "IBM 3.3", "IBM 3.3", "IBM 3.3", "DRDOS 7", "IBM 5.0", "IBM 3.3",
"MSDOS4.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "IBM 3.3",
"IBM 3.3", "IBM 7.0", "IBM 2.0", "IBM 2.0", "IBM 3.0", "IBM 3.1", "IBM 3.3", "IBM 4.0", "IBM 5.0",
"IBM 5.0", "IBM 6.0", "IBM 6.0", "T V3.30 ", "T V4.00 ", "IBM 10.2", "IBM 10.2", "IBM 3.2", "IBM 10.2",
"IBM 10.2", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 4.50", "BSD 4.4", "MSDOS5.0",
"MSDOS5.0", "MSWIN4.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSDOS5.0",
"MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat", "BSD 4.4", "BSD 4.4", "BSD4.4 "
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
Assert.AreEqual(true, fs.Identify(image, partitions[0]), testfiles[i]);
fs.GetInformation(image, partitions[0], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT12", 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]);
}
}
}
} }

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT12_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat12Apm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {16384};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {4076};
readonly int[] clustersize = {2048};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"32181F09"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "DOS_FAT_12")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT12", 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]);
}
}
}
}

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT12_GPM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat12Gpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {16384};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {4076};
readonly int[] clustersize = {2048};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"66901F1B"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT12", 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]);
}
}
}
}

View File

@@ -1,151 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT12_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat12Mbr
{
readonly string[] testfiles =
{
"compaqmsdos331.vdi.lz", "drdos_3.40.vdi.lz", "drdos_3.41.vdi.lz", "drdos_5.00.vdi.lz", "drdos_6.00.vdi.lz",
"drdos_7.02.vdi.lz", "drdos_7.03.vdi.lz", "drdos_8.00.vdi.lz", "msdos331.vdi.lz", "msdos401.vdi.lz",
"msdos500.vdi.lz", "msdos600.vdi.lz", "msdos620rc1.vdi.lz", "msdos620.vdi.lz", "msdos621.vdi.lz",
"msdos622.vdi.lz", "msdos710.vdi.lz", "novelldos_7.00.vdi.lz", "opendos_7.01.vdi.lz", "pcdos2000.vdi.lz",
"pcdos200.vdi.lz", "pcdos210.vdi.lz", "pcdos300.vdi.lz", "pcdos310.vdi.lz", "pcdos330.vdi.lz",
"pcdos400.vdi.lz", "pcdos500.vdi.lz", "pcdos502.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz",
"toshibamsdos330.vdi.lz", "toshibamsdos401.vdi.lz", "msos2_1.21.vdi.lz", "msos2_1.30.1.vdi.lz",
"multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz", "os2_1.30.vdi.lz", "os2_6.307.vdi.lz", "os2_6.514.vdi.lz",
"os2_6.617.vdi.lz", "os2_8.162.vdi.lz", "os2_9.023.vdi.lz", "ecs.vdi.lz", "macosx_10.11.vdi.lz",
"win10.vdi.lz", "win2000.vdi.lz", "win95.vdi.lz", "win95osr2.1.vdi.lz", "win95osr2.5.vdi.lz",
"win95osr2.vdi.lz", "win98.vdi.lz", "win98se.vdi.lz", "winme.vdi.lz", "winnt_3.10.vdi.lz",
"winnt_3.50.vdi.lz", "winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz", "beos_r4.5.vdi.lz",
"linux.vdi.lz", "freebsd_6.1.vdi.lz", "freebsd_7.0.vdi.lz", "freebsd_8.2.vdi.lz"
};
readonly ulong[] sectors =
{
8192, 30720, 28672, 28672, 28672, 28672, 28672, 28672, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
16384, 28672, 28672, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 32768, 8192,
8192, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
1000, 3654, 3520, 3520, 3520, 3520, 3520, 3520, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 1000, 2008, 3520,
3520, 4024, 4031, 4031, 4024, 4024, 4024, 4024, 4024, 4024, 4024, 4024, 1000, 1000, 2008, 2008, 2008, 2008,
2008, 2008, 2008, 2008, 2008, 2008, 1890, 4079, 3552, 4088, 2008, 2008, 2008, 2008, 2044, 2044, 2044, 4016,
2044, 2044, 4016, 3072, 2040, 3584, 2044, 2044, 2044
};
readonly int[] clustersize =
{
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096, 4096, 4096, 4096, 2048, 2048, 2048, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 2048,
4096, 4096, 2048, 2048, 4096, 2048, 4096, 4096, 4096
};
readonly string[] volumename =
{
null, "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", null, null, null,
null, null, "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VolumeLabel", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL"
};
readonly string[] volumeserial =
{
null, null, null, null, null, null, null, "1BFB1273", null, "407D1907", "345D18FB", "332518F4", "395718E9",
"076718EF", "1371181B", "23281816", "2F781809", null, null, "294F100F", null, null, null, null, null,
"0F340FE4", "1A5E0FF9", "1D2F0FFE", "076C1004", "2C481009", null, "3C2319E8", "66CC3C15", "66A54C15", null,
"5C578015", "5B845015", "5C4BF015", "E6B5F414", "E6B15414", "E6A41414", "E6A39414", "E6B0B814", "26A21EF4",
"74F4921D", "C4B64D11", "29200D0C", "234F0DE4", "074C0DFC", "33640D18", "0E121460", "094C0EED", "38310F02",
"50489A1B", "2CE52101", "94313E7E", "BC184FE6", "BAD08A1E", "00000000", "8D418102", "8FC80E0A", "34FA0E0B",
"02140E0B"
};
readonly string[] oemid =
{
"IBM 3.3", "IBM 3.2", "IBM 3.2", "IBM 3.3", "IBM 3.3", "IBM 3.3", "DRDOS 7", "IBM 5.0", "IBM 3.3",
"MSDOS4.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "IBM 3.3",
"IBM 3.3", "IBM 7.0", "IBM 2.0", "IBM 2.0", "IBM 3.0", "IBM 3.1", "IBM 3.3", "IBM 4.0", "IBM 5.0",
"IBM 5.0", "IBM 6.0", "IBM 6.0", "T V3.30 ", "T V4.00 ", "IBM 10.2", "IBM 10.2", "IBM 3.2", "IBM 10.2",
"IBM 10.2", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 4.50", "BSD 4.4", "MSDOS5.0",
"MSDOS5.0", "MSWIN4.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSDOS5.0",
"MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat", "BSD 4.4", "BSD 4.4", "BSD4.4 "
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat12_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
Assert.AreEqual(true, fs.Identify(image, partitions[0]), testfiles[i]);
fs.GetInformation(image, partitions[0], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT12", 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]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -141,4 +142,330 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class Fat16Apm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63995};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"063D1F09"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "DOS_FAT_16")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
[TestFixture]
public class Fat16Atari
{
readonly string[] testfiles = {"tos_1.04.vdi.lz", "tos_1.04_small.vdi.lz"};
readonly ulong[] sectors = {81920, 16384};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {10239, 8191};
readonly int[] clustersize = {4096, 1024};
readonly string[] volumename = {null, null};
readonly string[] volumeserial = {"BA9831", "2019E1"};
readonly string[] oemid = {null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_atari", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "GEM" || partitions[j].Type == "BGM")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
[TestFixture]
public class Fat16Gpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63995};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"2E8A1F1B"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
[TestFixture]
public class Fat16Mbr
{
readonly string[] testfiles =
{
"drdos_3.40.vdi.lz", "drdos_3.41.vdi.lz", "drdos_5.00.vdi.lz", "drdos_6.00.vdi.lz", "drdos_7.02.vdi.lz",
"drdos_7.03.vdi.lz", "drdos_8.00.vdi.lz", "msdos331.vdi.lz", "msdos401.vdi.lz", "msdos500.vdi.lz",
"msdos600.vdi.lz", "msdos620rc1.vdi.lz", "msdos620.vdi.lz", "msdos621.vdi.lz", "msdos622.vdi.lz",
"msdos710.vdi.lz", "novelldos_7.00.vdi.lz", "opendos_7.01.vdi.lz", "pcdos2000.vdi.lz", "pcdos400.vdi.lz",
"pcdos500.vdi.lz", "pcdos502.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz", "msos2_1.21.vdi.lz",
"msos2_1.30.1.vdi.lz", "multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz", "os2_1.30.vdi.lz",
"os2_6.307.vdi.lz", "os2_6.514.vdi.lz", "os2_6.617.vdi.lz", "os2_8.162.vdi.lz", "os2_9.023.vdi.lz",
"ecs.vdi.lz", "macosx_10.11.vdi.lz", "win10.vdi.lz", "win2000.vdi.lz", "win95osr2.1.vdi.lz",
"win95osr2.5.vdi.lz", "win95osr2.vdi.lz", "win95.vdi.lz", "win98se.vdi.lz", "win98.vdi.lz", "winme.vdi.lz",
"winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", "winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz",
"beos_r4.5.vdi.lz", "linux.vdi.lz", "amigaos_3.9.vdi.lz", "aros.vdi.lz", "freebsd_6.1.vdi.lz",
"freebsd_7.0.vdi.lz", "freebsd_8.2.vdi.lz", "macos_7.5.3.vdi.lz", "macos_7.5.vdi.lz", "macos_7.6.vdi.lz",
"macos_8.0.vdi.lz"
};
readonly ulong[] sectors =
{
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 262144, 1024128, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
63882, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941,
63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941,
63941, 63941, 63941, 63941, 63882, 63992, 63864, 63252, 63941, 63941, 63941, 63941, 63998, 63998, 63998,
63941, 63998, 63998, 63941, 63616, 63996, 65024, 63941, 63882, 63998, 63998, 31999, 63941, 63941, 63941,
63941
};
readonly int[] clustersize =
{
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 2048, 8192, 8192,
8192, 8192, 16384, 8192, 8192, 8192, 8192
};
readonly string[] volumename =
{
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
null, "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "NO NAME ", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VolumeLabel", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL"
};
readonly string[] volumeserial =
{
null, null, null, null, null, null, "1BFB0748", null, "217B1909", "0C6D18FC", "382B18F4", "3E2018E9",
"0D2418EF", "195A181B", "27761816", "356B1809", null, null, "2272100F", "07280FE1", "1F630FF9", "18340FFE",
"3F3F1003", "273D1009", "9C162C15", "9C1E2C15", null, "5BE66015", "5BE43015", "5BEAC015", "E6B18414",
"E6C63414", "1C069414", "1C059414", "1BE5B814", "3EF71EF4", "DAF97911", "305637BD", "275B0DE4", "09650DFC",
"38270D18", "2E620D0C", "0B4F0EED", "0E122464", "3B5F0F02", "C84CB6F2", "D0E9AD4E", "C039A2EC", "501F9FA6",
"9AAA4216", "00000000", "A132D985", "374D3BD1", "52BEA34A", "3CF10E0D", "C6C30E0D", "44770E0D", "27761816",
"27761816", "27761816", "27761816"
};
readonly string[] oemid =
{
"IBM 3.2", "IBM 3.2", "IBM 3.3", "IBM 3.3", "IBM 3.3", "DRDOS 7", "IBM 5.0", "IBM 3.3", "MSDOS4.0",
"MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "IBM 3.3", "IBM 3.3",
"IBM 7.0", "IBM 4.0", "IBM 5.0", "IBM 5.0", "IBM 6.0", "IBM 6.0", "IBM 10.2", "IBM 10.2", "IBM 3.2",
"IBM 10.2", "IBM 10.2", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 4.50", "BSD 4.4",
"MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1",
"MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat", "CDP 5.0", "MSWIN4.1",
"BSD 4.4", "BSD 4.4", "BSD4.4 ", "PCX 2.0 ", "PCX 2.0 ", "PCX 2.0 ", "PCX 2.0 "
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
Assert.AreEqual(true, fs.Identify(image, partitions[0]), testfiles[i]);
fs.GetInformation(image, partitions[0], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
[TestFixture]
public class Fat16Rdb
{
readonly string[] testfiles = {"amigaos_3.9.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63689};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"374D40D1"};
readonly string[] oemid = {"CDP 5.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x06")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
} }

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat16Apm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63995};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"063D1F09"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "DOS_FAT_16")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
}

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16_Atari.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat16Atari
{
readonly string[] testfiles = {"tos_1.04.vdi.lz", "tos_1.04_small.vdi.lz"};
readonly ulong[] sectors = {81920, 16384};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {10239, 8191};
readonly int[] clustersize = {4096, 1024};
readonly string[] volumename = {null, null};
readonly string[] volumeserial = {"BA9831", "2019E1"};
readonly string[] oemid = {null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_atari", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "GEM" || partitions[j].Type == "BGM")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
}

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat16Gpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63995};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"2E8A1F1B"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
}

View File

@@ -1,153 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat16Mbr
{
readonly string[] testfiles =
{
"drdos_3.40.vdi.lz", "drdos_3.41.vdi.lz", "drdos_5.00.vdi.lz", "drdos_6.00.vdi.lz", "drdos_7.02.vdi.lz",
"drdos_7.03.vdi.lz", "drdos_8.00.vdi.lz", "msdos331.vdi.lz", "msdos401.vdi.lz", "msdos500.vdi.lz",
"msdos600.vdi.lz", "msdos620rc1.vdi.lz", "msdos620.vdi.lz", "msdos621.vdi.lz", "msdos622.vdi.lz",
"msdos710.vdi.lz", "novelldos_7.00.vdi.lz", "opendos_7.01.vdi.lz", "pcdos2000.vdi.lz", "pcdos400.vdi.lz",
"pcdos500.vdi.lz", "pcdos502.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz", "msos2_1.21.vdi.lz",
"msos2_1.30.1.vdi.lz", "multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz", "os2_1.30.vdi.lz",
"os2_6.307.vdi.lz", "os2_6.514.vdi.lz", "os2_6.617.vdi.lz", "os2_8.162.vdi.lz", "os2_9.023.vdi.lz",
"ecs.vdi.lz", "macosx_10.11.vdi.lz", "win10.vdi.lz", "win2000.vdi.lz", "win95osr2.1.vdi.lz",
"win95osr2.5.vdi.lz", "win95osr2.vdi.lz", "win95.vdi.lz", "win98se.vdi.lz", "win98.vdi.lz", "winme.vdi.lz",
"winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", "winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz",
"beos_r4.5.vdi.lz", "linux.vdi.lz", "amigaos_3.9.vdi.lz", "aros.vdi.lz", "freebsd_6.1.vdi.lz",
"freebsd_7.0.vdi.lz", "freebsd_8.2.vdi.lz", "macos_7.5.3.vdi.lz", "macos_7.5.vdi.lz", "macos_7.6.vdi.lz",
"macos_8.0.vdi.lz"
};
readonly ulong[] sectors =
{
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 262144, 1024128, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
63882, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941,
63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941, 63941,
63941, 63941, 63941, 63941, 63882, 63992, 63864, 63252, 63941, 63941, 63941, 63941, 63998, 63998, 63998,
63941, 63998, 63998, 63941, 63616, 63996, 65024, 63941, 63882, 63998, 63998, 31999, 63941, 63941, 63941,
63941
};
readonly int[] clustersize =
{
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 2048, 8192, 8192,
8192, 8192, 16384, 8192, 8192, 8192, 8192
};
readonly string[] volumename =
{
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
null, "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "NO NAME ", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VolumeLabel", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL",
"VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL", "VOLUMELABEL"
};
readonly string[] volumeserial =
{
null, null, null, null, null, null, "1BFB0748", null, "217B1909", "0C6D18FC", "382B18F4", "3E2018E9",
"0D2418EF", "195A181B", "27761816", "356B1809", null, null, "2272100F", "07280FE1", "1F630FF9", "18340FFE",
"3F3F1003", "273D1009", "9C162C15", "9C1E2C15", null, "5BE66015", "5BE43015", "5BEAC015", "E6B18414",
"E6C63414", "1C069414", "1C059414", "1BE5B814", "3EF71EF4", "DAF97911", "305637BD", "275B0DE4", "09650DFC",
"38270D18", "2E620D0C", "0B4F0EED", "0E122464", "3B5F0F02", "C84CB6F2", "D0E9AD4E", "C039A2EC", "501F9FA6",
"9AAA4216", "00000000", "A132D985", "374D3BD1", "52BEA34A", "3CF10E0D", "C6C30E0D", "44770E0D", "27761816",
"27761816", "27761816", "27761816"
};
readonly string[] oemid =
{
"IBM 3.2", "IBM 3.2", "IBM 3.3", "IBM 3.3", "IBM 3.3", "DRDOS 7", "IBM 5.0", "IBM 3.3", "MSDOS4.0",
"MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "IBM 3.3", "IBM 3.3",
"IBM 7.0", "IBM 4.0", "IBM 5.0", "IBM 5.0", "IBM 6.0", "IBM 6.0", "IBM 10.2", "IBM 10.2", "IBM 3.2",
"IBM 10.2", "IBM 10.2", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 20.0", "IBM 4.50", "BSD 4.4",
"MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1",
"MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat", "CDP 5.0", "MSWIN4.1",
"BSD 4.4", "BSD 4.4", "BSD4.4 ", "PCX 2.0 ", "PCX 2.0 ", "PCX 2.0 ", "PCX 2.0 "
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
Assert.AreEqual(true, fs.Identify(image, partitions[0]), testfiles[i]);
fs.GetInformation(image, partitions[0], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
}

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat16Rdb
{
readonly string[] testfiles = {"amigaos_3.9.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63689};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"374D40D1"};
readonly string[] oemid = {"CDP 5.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x06")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT16", 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]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : FAT32_MBR.cs // Filename : FAT32.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.
@@ -36,6 +36,112 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture]
public class Fat32Apm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {524278};
readonly int[] clustersize = {4096};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"35BD1F0A"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat32_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "DOS_FAT_32")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT32", 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]);
}
}
}
[TestFixture]
public class Fat32Gpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {523775};
readonly int[] clustersize = {4096};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"7ABE1F1B"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat32_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT32", 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]);
}
}
}
[TestFixture] [TestFixture]
public class Fat32Mbr public class Fat32Mbr
{ {

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT32_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat32Apm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {524278};
readonly int[] clustersize = {4096};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"35BD1F0A"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat32_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "DOS_FAT_32")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT32", 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]);
}
}
}
}

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT32_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Fat32Gpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {523775};
readonly int[] clustersize = {4096};
readonly string[] volumename = {"VOLUMELABEL"};
readonly string[] volumeserial = {"7ABE1F1B"};
readonly string[] oemid = {"BSD 4.4"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat32_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("FAT32", 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]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HAMMER_MBR.cs // Filename : HAMMER.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -96,4 +97,255 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class HfsApm
{
readonly string[] testfiles =
{
"amigaos_3.9.vdi.lz", "darwin_1.3.1.vdi.lz", "darwin_1.4.1.vdi.lz", "darwin_6.0.2.vdi.lz",
"darwin_8.0.1.vdi.lz", "macos_1.1.vdi.lz", "macos_2.0.vdi.lz", "macos_6.0.7.vdi.lz", "macos_7.5.3.vdi.lz",
"macos_7.5.vdi.lz", "macos_7.6.vdi.lz", "macos_8.0.vdi.lz", "macos_8.1.vdi.lz", "macos_9.0.4.vdi.lz",
"macos_9.1.vdi.lz", "macos_9.2.1.vdi.lz", "macos_9.2.2.vdi.lz", "macosx_10.2.vdi.lz", "macosx_10.3.vdi.lz",
"macosx_10.4.vdi.lz", "rhapsody_dr1.vdi.lz", "d2_driver.vdi.lz", "hdt_1.8.vdi.lz", "macos_4.2.vdi.lz",
"macos_4.3.vdi.lz", "macos_6.0.2.vdi.lz", "macos_6.0.3.vdi.lz", "macos_6.0.4.vdi.lz", "macos_6.0.5.vdi.lz",
"macos_6.0.8.vdi.lz", "macos_6.0.vdi.lz", "macos_7.0.vdi.lz", "macos_7.1.1.vdi.lz", "parted.vdi.lz",
"silverlining_2.2.1.vdi.lz", "speedtools_3.6.vdi.lz", "vcpformatter_2.1.1.vdi.lz"
};
readonly ulong[] sectors =
{
1024128, 409600, 409600, 409600, 409600, 41820, 41820, 81648, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 409600, 51200, 51200, 41820, 41820, 54840,
54840, 54840, 54840, 54840, 41820, 54840, 54840, 262144, 51200, 51200, 54840
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
64003, 51189, 51189, 58502, 58502, 41788, 38950, 39991, 63954, 63990, 63954, 63954, 63954, 63922, 63922,
63922, 63922, 63884, 63883, 63883, 58506, 50926, 50094, 38950, 38950, 38950, 38950, 7673, 38950, 38950,
38950, 38950, 38950, 46071, 50382, 49135, 54643
};
readonly int[] clustersize =
{
8192, 4096, 4096, 3584, 3584, 512, 512, 1024, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 3584, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 1024, 512, 512, 512
};
readonly string[] volumename =
{
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Test disk", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Untitled", "Untitled #1", "24 MB Disk", "Volume label"
};
readonly string[] volumeserial =
{
null, null, null, null, "AAFE1382AF5AA898", null, null, null, null, null, null, null, null, null, null,
null, null, "5A7C38B0CAF279C4", "FB49083EBD150509", "632C0B1DB46FD188", null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class HfsCdrom
{
readonly string[] testfiles =
{
"toast_3.5.7_hfs_from_volume.iso.lz", "toast_3.5.7_iso9660_hfs.iso.lz",
"toast_4.1.3_hfs_from_volume.iso.lz", "toast_4.1.3_iso9660_hfs.iso.lz", "toast_3.5.7_hfs_from_files.iso.lz",
"toast_4.1.3_hfs_from_files.iso.lz"
};
readonly ulong[] sectors = {942, 1880, 943, 1882, 1509, 1529};
readonly uint[] sectorsize = {2048, 2048, 2048, 2048, 2048, 2048};
readonly long[] clusters = {3724, 931, 931, 931, 249, 249};
readonly int[] clustersize = {512, 2048, 2048, 2048, 12288, 12288};
readonly string[] volumename =
{"Disk utils", "Disk utils", "Disk utils", "Disk utils", "Disk utils", "Disk utils"};
readonly string[] volumeserial = {null, null, null, null, null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_cdrom", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class HfsMbr
{
readonly string[] testfiles =
{
"linux.vdi.lz", "darwin_1.3.1.vdi.lz", "darwin_1.4.1.vdi.lz", "darwin_6.0.2.vdi.lz", "darwin_8.0.1.vdi.lz"
};
readonly ulong[] sectors = {262144, 409600, 409600, 409600, 409600};
readonly uint[] sectorsize = {512, 512, 512, 512, 512};
readonly long[] clusters = {65018, 51145, 51145, 58452, 58502};
readonly int[] clustersize = {2048, 4096, 4096, 3584, 3584};
readonly string[] volumename =
{"Volume label", "Volume label", "Volume label", "Volume label", "Volume label"};
readonly string[] volumeserial = {null, null, null, null, "81FE805D61458753"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xAF")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class HfsRdb
{
readonly string[] testfiles = {"amigaos_3.9.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63752};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"RES\\86\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HFSPlus_APM.cs // Filename : HFSPlus.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.
@@ -123,4 +123,123 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class HfsPlusGpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz"};
readonly ulong[] sectors = {409600, 614400};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {51190, 76790};
readonly int[] clustersize = {4096, 4096};
readonly string[] volumename = {null, null};
readonly string[] volumeserial = {"D8C68470046E67BE", "FD3CB598F3C6294A"};
readonly string[] oemid = {"10.0", "HFSJ"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(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]);
}
}
}
// Mising Darwin 6.0.2 wrapped
[TestFixture]
public class HfsPlusMbr
{
readonly string[] testfiles =
{
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
"darwin_1.3.1.vdi.lz", "darwin_1.3.1_wrapped.vdi.lz", "darwin_1.4.1.vdi.lz", "darwin_1.4.1_wrapped.vdi.lz",
"darwin_6.0.2.vdi.lz", "darwin_8.0.1_journal.vdi.lz", "darwin_8.0.1.vdi.lz", "darwin_8.0.1_wrapped.vdi.lz"
};
readonly ulong[] sectors =
{303104, 352256, 262144, 262144, 819200, 614400, 819200, 614400, 819200, 1228800, 819200, 614400};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters =
{37878, 44021, 32512, 32512, 102178, 76708, 102178, 76708, 102178, 153592, 102392, 76774};
readonly int[] clustersize = {4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null, null, null, null, null, null, null, null, null};
readonly string[] volumeserial =
{
"C84F550907D13F50", "016599F88029F73D", null, null, null, null, null, null, null, "F92964F9B3F64ABB",
"A8FAC484A0A2B177", "D5D5BF1346AD2B8D"
};
readonly string[] oemid =
{"10.0", "HFSJ", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xAF")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(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]);
}
}
}
} }

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsPlusGpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz"};
readonly ulong[] sectors = {409600, 614400};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {51190, 76790};
readonly int[] clustersize = {4096, 4096};
readonly string[] volumename = {null, null};
readonly string[] volumeserial = {"D8C68470046E67BE", "FD3CB598F3C6294A"};
readonly string[] oemid = {"10.0", "HFSJ"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(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]);
}
}
}
}

View File

@@ -1,105 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
// Mising Darwin 6.0.2 wrapped
[TestFixture]
public class HfsPlusMbr
{
readonly string[] testfiles =
{
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
"darwin_1.3.1.vdi.lz", "darwin_1.3.1_wrapped.vdi.lz", "darwin_1.4.1.vdi.lz", "darwin_1.4.1_wrapped.vdi.lz",
"darwin_6.0.2.vdi.lz", "darwin_8.0.1_journal.vdi.lz", "darwin_8.0.1.vdi.lz", "darwin_8.0.1_wrapped.vdi.lz"
};
readonly ulong[] sectors =
{303104, 352256, 262144, 262144, 819200, 614400, 819200, 614400, 819200, 1228800, 819200, 614400};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters =
{37878, 44021, 32512, 32512, 102178, 76708, 102178, 76708, 102178, 153592, 102392, 76774};
readonly int[] clustersize = {4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null, null, null, null, null, null, null, null, null};
readonly string[] volumeserial =
{
"C84F550907D13F50", "016599F88029F73D", null, null, null, null, null, null, null, "F92964F9B3F64ABB",
"A8FAC484A0A2B177", "D5D5BF1346AD2B8D"
};
readonly string[] oemid =
{"10.0", "HFSJ", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0", "10.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xAF")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(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]);
}
}
}
}

View File

@@ -0,0 +1,212 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSX.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsxApm
{
readonly string[] testfiles =
{
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "darwin_8.0.1_journal.vdi.lz", "darwin_8.0.1.vdi.lz",
"macosx_10.4_journal.vdi.lz", "macosx_10.4.vdi.lz"
};
readonly ulong[] sectors = {819200, 1228800, 1638400, 1433600, 4194304, 1024000};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512};
readonly long[] clusters = {102390, 153590, 204792, 179192, 491290, 127770};
readonly int[] clustersize = {4096, 4096, 4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null, null, null};
readonly string[] volumeserial =
{
"CC2D56884950D9AE", "7AF1175D8EA7A072", "BB4ABD7E7E2FF5AF", "E2F212D815EF77B5", "5A8C646A5D77EB16",
"258C51A750F6A485"
};
readonly string[] oemid = {"10.0", "HFSJ", "10.0", "10.0", "HFSJ", "10.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_HFSX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", 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]);
}
}
}
[TestFixture]
public class HfsxGpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz"};
readonly ulong[] sectors = {819200, 1228800};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {102390, 153590};
readonly int[] clustersize = {4096, 4096};
readonly string[] volumename = {null, null};
readonly string[] volumeserial = {"328343989312AE9F", "FB98504073464C5C"};
readonly string[] oemid = {"10.0", "HFSJ"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", 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]);
}
}
}
[TestFixture]
public class HfsxMbr
{
readonly string[] testfiles =
{
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
"darwin_8.0.1_journal.vdi.lz", "darwin_8.0.1.vdi.lz"
};
readonly ulong[] sectors = {393216, 409600, 262144, 262144, 1638400, 1433600};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512};
readonly long[] clusters = {49140, 51187, 32512, 32512, 204792, 179192};
readonly int[] clustersize = {4096, 4096, 4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null, null, null};
readonly string[] volumeserial =
{"C2BCCCE6DE5BC98D", "AC54CD78C75CC30F", null, null, "7559DD01BCFADD9A", "AEA39CFBBF14C0FF"};
readonly string[] oemid = {"10.0", "HFSJ", "10.0", "10.0", "10.0", "10.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xAF")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", 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]);
}
}
}
}

View File

@@ -1,100 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSX_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsxApm
{
readonly string[] testfiles =
{
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "darwin_8.0.1_journal.vdi.lz", "darwin_8.0.1.vdi.lz",
"macosx_10.4_journal.vdi.lz", "macosx_10.4.vdi.lz"
};
readonly ulong[] sectors = {819200, 1228800, 1638400, 1433600, 4194304, 1024000};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512};
readonly long[] clusters = {102390, 153590, 204792, 179192, 491290, 127770};
readonly int[] clustersize = {4096, 4096, 4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null, null, null};
readonly string[] volumeserial =
{
"CC2D56884950D9AE", "7AF1175D8EA7A072", "BB4ABD7E7E2FF5AF", "E2F212D815EF77B5", "5A8C646A5D77EB16",
"258C51A750F6A485"
};
readonly string[] oemid = {"10.0", "HFSJ", "10.0", "10.0", "HFSJ", "10.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_HFSX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", 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]);
}
}
}
}

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSX_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsxGpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz"};
readonly ulong[] sectors = {819200, 1228800};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {102390, 153590};
readonly int[] clustersize = {4096, 4096};
readonly string[] volumename = {null, null};
readonly string[] volumeserial = {"328343989312AE9F", "FB98504073464C5C"};
readonly string[] oemid = {"10.0", "HFSJ"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", 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]);
}
}
}
}

View File

@@ -1,97 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSX_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsxMbr
{
readonly string[] testfiles =
{
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
"darwin_8.0.1_journal.vdi.lz", "darwin_8.0.1.vdi.lz"
};
readonly ulong[] sectors = {393216, 409600, 262144, 262144, 1638400, 1433600};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512};
readonly long[] clusters = {49140, 51187, 32512, 32512, 204792, 179192};
readonly int[] clustersize = {4096, 4096, 4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null, null, null};
readonly string[] volumeserial =
{"C2BCCCE6DE5BC98D", "AC54CD78C75CC30F", null, null, "7559DD01BCFADD9A", "AEA39CFBBF14C0FF"};
readonly string[] oemid = {"10.0", "HFSJ", "10.0", "10.0", "10.0", "10.0"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xAF")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", 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]);
}
}
}
}

View File

@@ -1,130 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFS_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsApm
{
readonly string[] testfiles =
{
"amigaos_3.9.vdi.lz", "darwin_1.3.1.vdi.lz", "darwin_1.4.1.vdi.lz", "darwin_6.0.2.vdi.lz",
"darwin_8.0.1.vdi.lz", "macos_1.1.vdi.lz", "macos_2.0.vdi.lz", "macos_6.0.7.vdi.lz", "macos_7.5.3.vdi.lz",
"macos_7.5.vdi.lz", "macos_7.6.vdi.lz", "macos_8.0.vdi.lz", "macos_8.1.vdi.lz", "macos_9.0.4.vdi.lz",
"macos_9.1.vdi.lz", "macos_9.2.1.vdi.lz", "macos_9.2.2.vdi.lz", "macosx_10.2.vdi.lz", "macosx_10.3.vdi.lz",
"macosx_10.4.vdi.lz", "rhapsody_dr1.vdi.lz", "d2_driver.vdi.lz", "hdt_1.8.vdi.lz", "macos_4.2.vdi.lz",
"macos_4.3.vdi.lz", "macos_6.0.2.vdi.lz", "macos_6.0.3.vdi.lz", "macos_6.0.4.vdi.lz", "macos_6.0.5.vdi.lz",
"macos_6.0.8.vdi.lz", "macos_6.0.vdi.lz", "macos_7.0.vdi.lz", "macos_7.1.1.vdi.lz", "parted.vdi.lz",
"silverlining_2.2.1.vdi.lz", "speedtools_3.6.vdi.lz", "vcpformatter_2.1.1.vdi.lz"
};
readonly ulong[] sectors =
{
1024128, 409600, 409600, 409600, 409600, 41820, 41820, 81648, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 409600, 51200, 51200, 41820, 41820, 54840,
54840, 54840, 54840, 54840, 41820, 54840, 54840, 262144, 51200, 51200, 54840
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
64003, 51189, 51189, 58502, 58502, 41788, 38950, 39991, 63954, 63990, 63954, 63954, 63954, 63922, 63922,
63922, 63922, 63884, 63883, 63883, 58506, 50926, 50094, 38950, 38950, 38950, 38950, 7673, 38950, 38950,
38950, 38950, 38950, 46071, 50382, 49135, 54643
};
readonly int[] clustersize =
{
8192, 4096, 4096, 3584, 3584, 512, 512, 1024, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 3584, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 1024, 512, 512, 512
};
readonly string[] volumename =
{
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label", "Test disk", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Untitled", "Untitled #1", "24 MB Disk", "Volume label"
};
readonly string[] volumeserial =
{
null, null, null, null, "AAFE1382AF5AA898", null, null, null, null, null, null, null, null, null, null,
null, null, "5A7C38B0CAF279C4", "FB49083EBD150509", "632C0B1DB46FD188", null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,95 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFS_CDROM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsCdrom
{
readonly string[] testfiles =
{
"toast_3.5.7_hfs_from_volume.iso.lz", "toast_3.5.7_iso9660_hfs.iso.lz",
"toast_4.1.3_hfs_from_volume.iso.lz", "toast_4.1.3_iso9660_hfs.iso.lz", "toast_3.5.7_hfs_from_files.iso.lz",
"toast_4.1.3_hfs_from_files.iso.lz"
};
readonly ulong[] sectors = {942, 1880, 943, 1882, 1509, 1529};
readonly uint[] sectorsize = {2048, 2048, 2048, 2048, 2048, 2048};
readonly long[] clusters = {3724, 931, 931, 931, 249, 249};
readonly int[] clustersize = {512, 2048, 2048, 2048, 12288, 12288};
readonly string[] volumename =
{"Disk utils", "Disk utils", "Disk utils", "Disk utils", "Disk utils", "Disk utils"};
readonly string[] volumeserial = {null, null, null, null, null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_cdrom", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_HFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,93 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsMbr
{
readonly string[] testfiles =
{
"linux.vdi.lz", "darwin_1.3.1.vdi.lz", "darwin_1.4.1.vdi.lz", "darwin_6.0.2.vdi.lz", "darwin_8.0.1.vdi.lz"
};
readonly ulong[] sectors = {262144, 409600, 409600, 409600, 409600};
readonly uint[] sectorsize = {512, 512, 512, 512, 512};
readonly long[] clusters = {65018, 51145, 51145, 58452, 58502};
readonly int[] clustersize = {2048, 4096, 4096, 3584, 3584};
readonly string[] volumename =
{"Volume label", "Volume label", "Volume label", "Volume label", "Volume label"};
readonly string[] volumeserial = {null, null, null, null, "81FE805D61458753"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0xAF")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFS_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HfsRdb
{
readonly string[] testfiles = {"amigaos_3.9.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {63752};
readonly int[] clustersize = {8192};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"RES\\86\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
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(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -92,4 +93,56 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class HtfsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {2097152};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {1020096};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"HTFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "htfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HTFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HtfsMbr
{
readonly string[] testfiles = {"scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {2097152};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {1020096};
readonly int[] clustersize = {1024};
readonly string[] volumename = {"Volume label"};
readonly string[] volumeserial = {null};
readonly string[] type = {"HTFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "htfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : LFS_MBR.cs // Filename : LFS.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -0,0 +1,327 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIX.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV1
{
readonly string[] testfiles =
{
"minix_3.1.2a_dsdd.img.lz", "minix_3.1.2a_dshd.img.lz", "minix_3.1.2a_mf2dd.img.lz",
"minix_3.1.2a_mf2hd.img.lz"
};
readonly MediaType[] mediatypes =
{MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD};
readonly ulong[] sectors = {720, 2400, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {360, 1200, 720, 1440};
readonly int[] clustersize = {1024, 1024, 1024, 1024};
readonly string[] types = {"Minix 3 v1", "Minix 3 v1", "Minix 3 v1", "Minix 3 v1"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv1", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Filesystem fs = new MinixFS();
Partition wholePart = new Partition
{
Name = "Whole device",
Length = image.ImageInfo.Sectors,
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
};
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
fs.GetInformation(image, wholePart, out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
[TestFixture]
public class MinixV1Mbr
{
readonly string[] testfiles = {"linux.vdi.lz", "minix_3.1.2a.vdi.lz"};
readonly ulong[] sectors = {262144, 102400};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {65535, 50399};
readonly int[] clustersize = {1024, 1024};
readonly string[] types = {"Minix v1", "Minix 3 v1"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv1_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x80" || partitions[j].Type == "0x81" || partitions[j].Type == "MINIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
[TestFixture]
public class MinixV2
{
readonly string[] testfiles =
{
"minix_3.1.2a_dsdd.img.lz", "minix_3.1.2a_dshd.img.lz", "minix_3.1.2a_mf2dd.img.lz",
"minix_3.1.2a_mf2hd.img.lz"
};
readonly MediaType[] mediatypes =
{MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD};
readonly ulong[] sectors = {720, 2400, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {360, 1200, 720, 1440};
readonly int[] clustersize = {1024, 1024, 1024, 1024};
readonly string[] types = {"Minix 3 v2", "Minix 3 v2", "Minix 3 v2", "Minix 3 v2"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv2", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Filesystem fs = new MinixFS();
Partition wholePart = new Partition
{
Name = "Whole device",
Length = image.ImageInfo.Sectors,
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
};
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
fs.GetInformation(image, wholePart, out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
[TestFixture]
public class MinixV2Mbr
{
readonly string[] testfiles = {"minix_3.1.2a.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {511055};
readonly int[] clustersize = {1024};
readonly string[] types = {"Minix 3 v2"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv2_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
[TestFixture]
public class MinixV3
{
readonly string[] testfiles =
{
"minix_3.1.2a_dsdd.img.lz", "minix_3.1.2a_dshd.img.lz", "minix_3.1.2a_mf2dd.img.lz",
"minix_3.1.2a_mf2hd.img.lz"
};
readonly MediaType[] mediatypes =
{MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD};
readonly ulong[] sectors = {720, 2400, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {90, 300, 180, 360};
readonly int[] clustersize = {4096, 4096, 4096, 4096};
readonly string[] types = {"Minix v3", "Minix v3", "Minix v3", "Minix v3"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv3", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Filesystem fs = new MinixFS();
Partition wholePart = new Partition
{
Name = "Whole device",
Length = image.ImageInfo.Sectors,
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
};
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
fs.GetInformation(image, wholePart, out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
[TestFixture]
public class MinixV3Mbr
{
readonly string[] testfiles = {"minix_3.1.2a.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {523151};
readonly int[] clustersize = {4096};
readonly string[] types = {"Minix v3"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv3_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -1,88 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIXv1.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV1
{
readonly string[] testfiles =
{
"minix_3.1.2a_dsdd.img.lz", "minix_3.1.2a_dshd.img.lz", "minix_3.1.2a_mf2dd.img.lz",
"minix_3.1.2a_mf2hd.img.lz"
};
readonly MediaType[] mediatypes =
{MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD};
readonly ulong[] sectors = {720, 2400, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {360, 1200, 720, 1440};
readonly int[] clustersize = {1024, 1024, 1024, 1024};
readonly string[] types = {"Minix 3 v1", "Minix 3 v1", "Minix 3 v1", "Minix 3 v1"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv1", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Filesystem fs = new MinixFS();
Partition wholePart = new Partition
{
Name = "Whole device",
Length = image.ImageInfo.Sectors,
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
};
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
fs.GetInformation(image, wholePart, out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -1,85 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIXv1_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV1Mbr
{
readonly string[] testfiles = {"linux.vdi.lz", "minix_3.1.2a.vdi.lz"};
readonly ulong[] sectors = {262144, 102400};
readonly uint[] sectorsize = {512, 512};
readonly long[] clusters = {65535, 50399};
readonly int[] clustersize = {1024, 1024};
readonly string[] types = {"Minix v1", "Minix 3 v1"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv1_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x80" || partitions[j].Type == "0x81" || partitions[j].Type == "MINIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -1,88 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIXv2.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV2
{
readonly string[] testfiles =
{
"minix_3.1.2a_dsdd.img.lz", "minix_3.1.2a_dshd.img.lz", "minix_3.1.2a_mf2dd.img.lz",
"minix_3.1.2a_mf2hd.img.lz"
};
readonly MediaType[] mediatypes =
{MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD};
readonly ulong[] sectors = {720, 2400, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {360, 1200, 720, 1440};
readonly int[] clustersize = {1024, 1024, 1024, 1024};
readonly string[] types = {"Minix 3 v2", "Minix 3 v2", "Minix 3 v2", "Minix 3 v2"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv2", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Filesystem fs = new MinixFS();
Partition wholePart = new Partition
{
Name = "Whole device",
Length = image.ImageInfo.Sectors,
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
};
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
fs.GetInformation(image, wholePart, out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -1,85 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIXv2_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV2Mbr
{
readonly string[] testfiles = {"minix_3.1.2a.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {511055};
readonly int[] clustersize = {1024};
readonly string[] types = {"Minix 3 v2"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv2_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -1,88 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIXv3.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV3
{
readonly string[] testfiles =
{
"minix_3.1.2a_dsdd.img.lz", "minix_3.1.2a_dshd.img.lz", "minix_3.1.2a_mf2dd.img.lz",
"minix_3.1.2a_mf2hd.img.lz"
};
readonly MediaType[] mediatypes =
{MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD};
readonly ulong[] sectors = {720, 2400, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {90, 300, 180, 360};
readonly int[] clustersize = {4096, 4096, 4096, 4096};
readonly string[] types = {"Minix v3", "Minix v3", "Minix v3", "Minix v3"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv3", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(mediatypes[i], image.ImageInfo.MediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.Sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.SectorSize, testfiles[i]);
Filesystem fs = new MinixFS();
Partition wholePart = new Partition
{
Name = "Whole device",
Length = image.ImageInfo.Sectors,
Size = image.ImageInfo.Sectors * image.ImageInfo.SectorSize
};
Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
fs.GetInformation(image, wholePart, out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -1,85 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIXv3_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MinixV3Mbr
{
readonly string[] testfiles = {"minix_3.1.2a.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {523151};
readonly int[] clustersize = {4096};
readonly string[] types = {"Minix v3"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv3_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x81" || partitions[j].Type == "MINIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(types[i], fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : NTFS_MBR.cs // Filename : NTFS.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.
@@ -36,6 +36,59 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture]
public class NtfsGpt
{
readonly string[] testfiles = {"haiku_hrev51259.vdi.lz"};
readonly ulong[] sectors = {2097152};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {261887};
readonly int[] clustersize = {4096};
readonly string[] volumename = {null, null, null, null, null, null, null, null};
readonly string[] volumeserial = {"106DA7693F7F6B3F"};
readonly string[] oemid = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ntfs_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new NTFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("NTFS", 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]);
}
}
}
[TestFixture] [TestFixture]
public class NtfsMbr public class NtfsMbr
{ {

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : NTFS_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class NtfsGpt
{
readonly string[] testfiles = {"haiku_hrev51259.vdi.lz"};
readonly ulong[] sectors = {2097152};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {261887};
readonly int[] clustersize = {4096};
readonly string[] volumename = {null, null, null, null, null, null, null, null};
readonly string[] volumeserial = {"106DA7693F7F6B3F"};
readonly string[] oemid = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ntfs_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new NTFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("NTFS", 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]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : PFS3_RDB.cs // Filename : PFS3.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : ProDOS_APM.cs // Filename : ProDOS.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -80,4 +81,49 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class Qnx4Mbr
{
readonly string[] testfiles = {"qnx_4.24.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {1023104};
readonly int[] clustersize = {512};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "qnx4_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new QNX4();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x4D")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("QNX4 filesystem", fs.XmlFSType.Type, testfiles[i]);
}
}
}
} }

View File

@@ -1,83 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : QNX4_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Qnx4Mbr
{
readonly string[] testfiles = {"qnx_4.24.vdi.lz"};
readonly ulong[] sectors = {1024000};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {1023104};
readonly int[] clustersize = {512};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "qnx4_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new QNX4();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x4D")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("QNX4 filesystem", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,189 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class SfsMbr
{
readonly string[] testfiles = {"aros.vdi.lz"};
readonly ulong[] sectors = {409600};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {408240};
readonly int[] clustersize = {512};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x2F")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class SfsMbrRdb
{
readonly string[] testfiles = {"aros.vdi.lz"};
readonly ulong[] sectors = {409600};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {406224};
readonly int[] clustersize = {512};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"SFS\\0\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class SfsRdb
{
readonly string[] testfiles = {"uae.vdi.lz", "aros.vdi.lz", "amigaos_4.0.vdi.lz", "amigaos_4.0_sfs2.vdi.lz"};
readonly ulong[] sectors = {1024128, 409600, 1024128, 1024128};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {127000, 407232, 511040, 511040};
readonly int[] clustersize = {2048, 512, 1024, 1024};
readonly string[] volumename = {null, null, null, null};
readonly string[] volumeserial = {null, null, null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"SFS\\0\"" || partitions[j].Type == "\"SFS\\2\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class SfsMbr
{
readonly string[] testfiles = {"aros.vdi.lz"};
readonly ulong[] sectors = {409600};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {408240};
readonly int[] clustersize = {512};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x2F")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SFS_MBR_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class SfsMbrRdb
{
readonly string[] testfiles = {"aros.vdi.lz"};
readonly ulong[] sectors = {409600};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {406224};
readonly int[] clustersize = {512};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_mbr_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"SFS\\0\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SFS_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class SfsRdb
{
readonly string[] testfiles = {"uae.vdi.lz", "aros.vdi.lz", "amigaos_4.0.vdi.lz", "amigaos_4.0_sfs2.vdi.lz"};
readonly ulong[] sectors = {1024128, 409600, 1024128, 1024128};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {127000, 407232, 511040, 511040};
readonly int[] clustersize = {2048, 512, 1024, 1024};
readonly string[] volumename = {null, null, null, null};
readonly string[] volumeserial = {null, null, null, null};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"SFS\\0\"" || partitions[j].Type == "\"SFS\\2\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -97,4 +98,109 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class SysVMbr
{
readonly string[] testfiles =
{"att_unix_svr4v2.1.vdi.lz", "att_unix_svr4v2.1_2k.vdi.lz", "scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000, 1024000, 2097152};
readonly uint[] sectorsize = {512, 512, 512};
readonly long[] clusters = {511056, 255528, 1020096};
readonly int[] clustersize = {1024, 2048, 1024};
readonly string[] volumename = {"/usr3", "/usr3", "Volume label"};
readonly string[] volumeserial = {null, null, null};
readonly string[] type = {"SVR4 fs", "SVR4 fs", "SVR4 fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "UNIX: /usr" || partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class SysVRdb
{
readonly string[] testfiles = {"amix.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {511424};
readonly int[] clustersize = {1024};
readonly string[] volumename = {""};
readonly string[] volumeserial = {null};
readonly string[] type = {"SVR4 fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"UNI\\1\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,92 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SysV_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class SysVMbr
{
readonly string[] testfiles =
{"att_unix_svr4v2.1.vdi.lz", "att_unix_svr4v2.1_2k.vdi.lz", "scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {1024000, 1024000, 2097152};
readonly uint[] sectorsize = {512, 512, 512};
readonly long[] clusters = {511056, 255528, 1020096};
readonly int[] clustersize = {1024, 2048, 1024};
readonly string[] volumename = {"/usr3", "/usr3", "Volume label"};
readonly string[] volumeserial = {null, null, null};
readonly string[] type = {"SVR4 fs", "SVR4 fs", "SVR4 fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "UNIX: /usr" || partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SysV_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class SysVRdb
{
readonly string[] testfiles = {"amix.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {511424};
readonly int[] clustersize = {1024};
readonly string[] volumename = {""};
readonly string[] volumeserial = {null};
readonly string[] type = {"SVR4 fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"UNI\\1\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -95,4 +96,377 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class UfsApm
{
readonly string[] testfiles =
{
"ffs43/darwin_1.3.1.vdi.lz", "ffs43/darwin_1.4.1.vdi.lz", "ffs43/darwin_6.0.2.vdi.lz",
"ffs43/darwin_8.0.1.vdi.lz", "ufs1/darwin_1.3.1.vdi.lz", "ufs1/darwin_1.4.1.vdi.lz",
"ufs1/darwin_6.0.2.vdi.lz", "ufs1/darwin_8.0.1.vdi.lz", "ufs1/macosx_10.2.vdi.lz",
"ufs1/macosx_10.3.vdi.lz", "ufs1/macosx_10.4.vdi.lz"
};
readonly ulong[] sectors =
{1024000, 1024000, 1024000, 1024000, 204800, 204800, 204800, 204800, 2097152, 2097152, 2097152};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters =
{511488, 511488, 511488, 511488, 102368, 102368, 102368, 102368, 1047660, 1038952, 1038952};
readonly int[] clustersize = {1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024};
readonly string[] volumename = {null, null, null, null, null, null, null, null, null, null, null};
readonly string[] volumeserial = {null, null, null, null, null, null, null, null, null, null, null};
readonly string[] type = {"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_UFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class UfsMbr
{
readonly string[] testfiles =
{
"ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz", "ffs43/darwin_1.3.1.vdi.lz", "ffs43/darwin_1.4.1.vdi.lz",
"ffs43/darwin_6.0.2.vdi.lz", "ffs43/darwin_8.0.1.vdi.lz", "ffs43/dflybsd_1.2.0.vdi.lz",
"ffs43/dflybsd_3.6.1.vdi.lz", "ffs43/dflybsd_4.0.5.vdi.lz", "ffs43/netbsd_1.6.vdi.lz",
"ffs43/netbsd_7.1.vdi.lz", "ufs1/darwin_1.3.1.vdi.lz", "ufs1/darwin_1.4.1.vdi.lz",
"ufs1/darwin_6.0.2.vdi.lz", "ufs1/darwin_8.0.1.vdi.lz", "ufs1/dflybsd_1.2.0.vdi.lz",
"ufs1/dflybsd_3.6.1.vdi.lz", "ufs1/dflybsd_4.0.5.vdi.lz", "ufs1/freebsd_6.1.vdi.lz",
"ufs1/freebsd_7.0.vdi.lz", "ufs1/freebsd_8.2.vdi.lz", "ufs1/netbsd_1.6.vdi.lz", "ufs1/netbsd_7.1.vdi.lz",
"ufs1/solaris_7.vdi.lz", "ufs1/solaris_9.vdi.lz", "ufs2/freebsd_6.1.vdi.lz", "ufs2/freebsd_7.0.vdi.lz",
"ufs2/freebsd_8.2.vdi.lz", "ufs2/netbsd_7.1.vdi.lz"
};
readonly ulong[] sectors =
{
262144, 262144, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 409600, 204800,
204800, 204800, 204800, 2097152, 2097152, 2097152, 2097152, 8388608, 8388608, 2097152, 1024000, 2097152,
2097152, 16777216, 16777216, 16777216, 2097152
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
65024, 65024, 511024, 511024, 511024, 511488, 511950, 255470, 255470, 511992, 204768, 102280, 102280,
102280, 102368, 1048500, 523758, 523758, 262138, 1048231, 2096462, 524284, 511968, 1038240, 1046808,
2096472, 2096472, 4192945, 524272
};
readonly int[] clustersize =
{
2048, 2048, 1024, 1024, 1024, 1024, 1024, 2048, 2048, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 2048, 2048,
4096, 4096, 2048, 2048, 1024, 1024, 1024, 4096, 4096, 2048, 2048
};
readonly string[] volumename =
{
null, "VolumeLabel", null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, "VolumeLabel", "VolumeLabel", "VolumeLabel", ""
};
readonly string[] volumeserial =
{
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null
};
readonly string[] type =
{
"UFS", "UFS2", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS2", "UFS2", "UFS2", "UFS2"
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x63" || partitions[j].Type == "0xA8" || partitions[j].Type == "0xA5" ||
partitions[j].Type == "0xA9" || partitions[j].Type == "0x82" || partitions[j].Type == "0x83" ||
partitions[j].Type == "4.2BSD Fast File System" || partitions[j].Type == "Sun boot")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class UfsNeXt
{
readonly string[] testfiles =
{
"nextstep_3.3.vdi.lz", "openstep_4.0.vdi.lz", "openstep_4.2.vdi.lz", "rhapsody_dr1.vdi.lz",
"rhapsody_dr2.vdi.lz"
};
readonly ulong[] sectors = {409600, 409600, 409600, 409600, 409600};
readonly uint[] sectorsize = {512, 512, 512, 512, 512};
readonly long[] clusters = {204640, 204640, 204640, 204640, 204464};
readonly int[] clustersize = {1024, 1024, 1024, 1024, 1024};
readonly string[] volumename = {null, null, null, null, null};
readonly string[] volumeserial = {null, null, null, null, null};
readonly string[] type = {"UFS", "UFS", "UFS", "UFS", "UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_next", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class UfsNeXtFloppy
{
readonly string[] testfiles =
{
"nextstep_3.3_mf2dd.img.lz", "nextstep_3.3_mf2hd.img.lz", "openstep_4.0_mf2dd.img.lz",
"openstep_4.0_mf2hd.img.lz", "openstep_4.2_mf2dd.img.lz", "openstep_4.2_mf2hd.img.lz",
"rhapsody_dr1_mf2dd.img.lz", "rhapsody_dr1_mf2hd.img.lz", "rhapsody_dr2_mf2dd.img.lz",
"rhapsody_dr2_mf2hd.img.lz"
};
readonly ulong[] sectors = {1440, 2880, 1440, 2880, 1440, 2880, 1440, 2880, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters = {624, 1344, 624, 1344, 624, 1344, 624, 1344, 624, 1344};
readonly int[] clustersize = {1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024};
readonly string[] volumename = {null, null, null, null, null, null, null, null, null, null};
readonly string[] volumeserial = {null, null, null, null, null, null, null, null, null, null};
readonly string[] type = {"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_next", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class UfsRdb
{
readonly string[] testfiles = {"amix.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {511424};
readonly int[] clustersize = {1024};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
readonly string[] type = {"UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"UNI\\2\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class UfsSuni86
{
readonly string[] testfiles = {"solaris_7.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {2063376};
readonly int[] clustersize = {1024};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
readonly string[] type = {"UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_suni86", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Replacement sectors")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,99 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UFS_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UfsApm
{
readonly string[] testfiles =
{
"ffs43/darwin_1.3.1.vdi.lz", "ffs43/darwin_1.4.1.vdi.lz", "ffs43/darwin_6.0.2.vdi.lz",
"ffs43/darwin_8.0.1.vdi.lz", "ufs1/darwin_1.3.1.vdi.lz", "ufs1/darwin_1.4.1.vdi.lz",
"ufs1/darwin_6.0.2.vdi.lz", "ufs1/darwin_8.0.1.vdi.lz", "ufs1/macosx_10.2.vdi.lz",
"ufs1/macosx_10.3.vdi.lz", "ufs1/macosx_10.4.vdi.lz"
};
readonly ulong[] sectors =
{1024000, 1024000, 1024000, 1024000, 204800, 204800, 204800, 204800, 2097152, 2097152, 2097152};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters =
{511488, 511488, 511488, 511488, 102368, 102368, 102368, 102368, 1047660, 1038952, 1038952};
readonly int[] clustersize = {1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024};
readonly string[] volumename = {null, null, null, null, null, null, null, null, null, null, null};
readonly string[] volumeserial = {null, null, null, null, null, null, null, null, null, null, null};
readonly string[] type = {"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Apple_UFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,134 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UfsMbr
{
readonly string[] testfiles =
{
"ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz", "ffs43/darwin_1.3.1.vdi.lz", "ffs43/darwin_1.4.1.vdi.lz",
"ffs43/darwin_6.0.2.vdi.lz", "ffs43/darwin_8.0.1.vdi.lz", "ffs43/dflybsd_1.2.0.vdi.lz",
"ffs43/dflybsd_3.6.1.vdi.lz", "ffs43/dflybsd_4.0.5.vdi.lz", "ffs43/netbsd_1.6.vdi.lz",
"ffs43/netbsd_7.1.vdi.lz", "ufs1/darwin_1.3.1.vdi.lz", "ufs1/darwin_1.4.1.vdi.lz",
"ufs1/darwin_6.0.2.vdi.lz", "ufs1/darwin_8.0.1.vdi.lz", "ufs1/dflybsd_1.2.0.vdi.lz",
"ufs1/dflybsd_3.6.1.vdi.lz", "ufs1/dflybsd_4.0.5.vdi.lz", "ufs1/freebsd_6.1.vdi.lz",
"ufs1/freebsd_7.0.vdi.lz", "ufs1/freebsd_8.2.vdi.lz", "ufs1/netbsd_1.6.vdi.lz", "ufs1/netbsd_7.1.vdi.lz",
"ufs1/solaris_7.vdi.lz", "ufs1/solaris_9.vdi.lz", "ufs2/freebsd_6.1.vdi.lz", "ufs2/freebsd_7.0.vdi.lz",
"ufs2/freebsd_8.2.vdi.lz", "ufs2/netbsd_7.1.vdi.lz"
};
readonly ulong[] sectors =
{
262144, 262144, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 409600, 204800,
204800, 204800, 204800, 2097152, 2097152, 2097152, 2097152, 8388608, 8388608, 2097152, 1024000, 2097152,
2097152, 16777216, 16777216, 16777216, 2097152
};
readonly uint[] sectorsize =
{
512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512
};
readonly long[] clusters =
{
65024, 65024, 511024, 511024, 511024, 511488, 511950, 255470, 255470, 511992, 204768, 102280, 102280,
102280, 102368, 1048500, 523758, 523758, 262138, 1048231, 2096462, 524284, 511968, 1038240, 1046808,
2096472, 2096472, 4192945, 524272
};
readonly int[] clustersize =
{
2048, 2048, 1024, 1024, 1024, 1024, 1024, 2048, 2048, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 2048, 2048,
4096, 4096, 2048, 2048, 1024, 1024, 1024, 4096, 4096, 2048, 2048
};
readonly string[] volumename =
{
null, "VolumeLabel", null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, "VolumeLabel", "VolumeLabel", "VolumeLabel", ""
};
readonly string[] volumeserial =
{
null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null, null, null, null
};
readonly string[] type =
{
"UFS", "UFS2", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS2", "UFS2", "UFS2", "UFS2"
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x63" || partitions[j].Type == "0xA8" || partitions[j].Type == "0xA5" ||
partitions[j].Type == "0xA9" || partitions[j].Type == "0x82" || partitions[j].Type == "0x83" ||
partitions[j].Type == "4.2BSD Fast File System" || partitions[j].Type == "Sun boot")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,95 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UFS_NeXT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UfsNeXt
{
readonly string[] testfiles =
{
"nextstep_3.3.vdi.lz", "openstep_4.0.vdi.lz", "openstep_4.2.vdi.lz", "rhapsody_dr1.vdi.lz",
"rhapsody_dr2.vdi.lz"
};
readonly ulong[] sectors = {409600, 409600, 409600, 409600, 409600};
readonly uint[] sectorsize = {512, 512, 512, 512, 512};
readonly long[] clusters = {204640, 204640, 204640, 204640, 204464};
readonly int[] clustersize = {1024, 1024, 1024, 1024, 1024};
readonly string[] volumename = {null, null, null, null, null};
readonly string[] volumeserial = {null, null, null, null, null};
readonly string[] type = {"UFS", "UFS", "UFS", "UFS", "UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_next", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,97 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UFS_NeXT_Floppy.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UfsNeXtFloppy
{
readonly string[] testfiles =
{
"nextstep_3.3_mf2dd.img.lz", "nextstep_3.3_mf2hd.img.lz", "openstep_4.0_mf2dd.img.lz",
"openstep_4.0_mf2hd.img.lz", "openstep_4.2_mf2dd.img.lz", "openstep_4.2_mf2hd.img.lz",
"rhapsody_dr1_mf2dd.img.lz", "rhapsody_dr1_mf2hd.img.lz", "rhapsody_dr2_mf2dd.img.lz",
"rhapsody_dr2_mf2hd.img.lz"
};
readonly ulong[] sectors = {1440, 2880, 1440, 2880, 1440, 2880, 1440, 2880, 1440, 2880};
readonly uint[] sectorsize = {512, 512, 512, 512, 512, 512, 512, 512, 512, 512};
readonly long[] clusters = {624, 1344, 624, 1344, 624, 1344, 624, 1344, 624, 1344};
readonly int[] clustersize = {1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024, 1024};
readonly string[] volumename = {null, null, null, null, null, null, null, null, null, null};
readonly string[] volumeserial = {null, null, null, null, null, null, null, null, null, null};
readonly string[] type = {"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_next", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new ZZZRawImage();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "4.3BSD" || partitions[j].Type == "4.4BSD")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UFS_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UfsRdb
{
readonly string[] testfiles = {"amix.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {511424};
readonly int[] clustersize = {1024};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
readonly string[] type = {"UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"UNI\\2\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UFS_Suni86.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UfsSuni86
{
readonly string[] testfiles = {"solaris_7.vdi.lz"};
readonly ulong[] sectors = {4194304};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {2063376};
readonly int[] clustersize = {1024};
readonly string[] volumename = {null};
readonly string[] volumeserial = {null};
readonly string[] type = {"UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_suni86", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new FFSPlugin();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Replacement sectors")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -89,4 +90,103 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class UnixbfsMbr
{
readonly string[] testfiles = {"linux.vdi.lz"};
readonly ulong[] sectors = {262144};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {260096};
readonly int[] clustersize = {512};
readonly string[] volumename = {"Label"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x83")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("BFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
}
}
}
[TestFixture]
public class UnixbfsRdb
{
readonly string[] testfiles = {"amix.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {65024};
readonly int[] clustersize = {2048};
readonly string[] volumename = {null};
readonly string[] volumeserial = {"UNKNOWN"};
readonly string[] type = {"UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"UNI\\0\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,86 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UNIXBFS_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UnixbfsMbr
{
readonly string[] testfiles = {"linux.vdi.lz"};
readonly ulong[] sectors = {262144};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {260096};
readonly int[] clustersize = {512};
readonly string[] volumename = {"Label"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x83")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("BFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
}
}
}
}

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : UNIXBFS_RDB.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class UnixbfsRdb
{
readonly string[] testfiles = {"amix.vdi.lz"};
readonly ulong[] sectors = {1024128};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {65024};
readonly int[] clustersize = {2048};
readonly string[] volumename = {null};
readonly string[] volumeserial = {"UNKNOWN"};
readonly string[] type = {"UFS"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs_rdb", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new BFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "\"UNI\\0\"")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -26,6 +26,7 @@
// Copyright © 2011-2018 Natalia Portillo // Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/ // ****************************************************************************/
using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages; using DiscImageChef.DiscImages;
@@ -92,4 +93,56 @@ namespace DiscImageChef.Tests.Filesystems
} }
} }
} }
[TestFixture]
public class XenixMbr
{
readonly string[] testfiles = {"xenix_2.3.2d.vdi.lz", "xenix_2.3.4h.vdi.lz", "scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {40960, 40960, 2097152};
readonly uint[] sectorsize = {512, 512, 512};
readonly long[] clusters = {0, 0, 0, 19624, 19624, 19624};
readonly int[] clustersize = {1024, 1024, 1024};
readonly string[] volumename = {"", "", ""};
readonly string[] volumeserial = {null, null, null};
readonly string[] type = {"XENIX fs", "XENIX fs", "XENIX fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "xenix_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
} }

View File

@@ -1,91 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : XENIX_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class XenixMbr
{
readonly string[] testfiles = {"xenix_2.3.2d.vdi.lz", "xenix_2.3.4h.vdi.lz", "scoopenserver_5.0.7hw.vdi.lz"};
readonly ulong[] sectors = {40960, 40960, 2097152};
readonly uint[] sectorsize = {512, 512, 512};
readonly long[] clusters = {0, 0, 0, 19624, 19624, 19624};
readonly int[] clustersize = {1024, 1024, 1024};
readonly string[] volumename = {"", "", ""};
readonly string[] volumeserial = {null, null, null};
readonly string[] type = {"XENIX fs", "XENIX fs", "XENIX fs"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "xenix_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new SysVfs();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "XENIX")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : XFS_MBR.cs // Filename : XFS.cs
// Author(s) : Natalia Portillo <claunia@claunia.com> // Author(s) : Natalia Portillo <claunia@claunia.com>
// //
// Component : DiscImageChef unit testing. // Component : DiscImageChef unit testing.

View File

@@ -0,0 +1,189 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : exFAT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class ExFatApm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {262144};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {32710};
readonly int[] clustersize = {4096};
readonly string[] volumename = {null};
readonly string[] volumeserial = {"595AC82C"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "exfat_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new exFAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Windows_NTFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("exFAT", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class ExFatGpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {262144};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {32208};
readonly int[] clustersize = {4096};
readonly string[] volumename = {null};
readonly string[] volumeserial = {"595ACC39"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "exfat_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new exFAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("exFAT", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
[TestFixture]
public class ExFatMbr
{
readonly string[] testfiles = {"linux.vdi.lz", "macosx_10.11.vdi.lz", "win10.vdi.lz", "winvista.vdi.lz"};
readonly ulong[] sectors = {262144, 262144, 262144, 262144};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {32464, 32712, 32448, 32208};
readonly int[] clustersize = {4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null};
readonly string[] volumeserial = {"603565AC", "595AC21E", "20126663", "0AC5CA52"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "exfat_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new exFAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x07")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("exFAT", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : exFAT_APM.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class ExFatApm
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {262144};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {32710};
readonly int[] clustersize = {4096};
readonly string[] volumename = {null};
readonly string[] volumeserial = {"595AC82C"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "exfat_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new exFAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Windows_NTFS")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("exFAT", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : exFAT_GPT.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class ExFatGpt
{
readonly string[] testfiles = {"macosx_10.11.vdi.lz"};
readonly ulong[] sectors = {262144};
readonly uint[] sectorsize = {512};
readonly long[] clusters = {32208};
readonly int[] clustersize = {4096};
readonly string[] volumename = {null};
readonly string[] volumeserial = {"595ACC39"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "exfat_gpt", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new exFAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "Microsoft Basic data")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("exFAT", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -1,89 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : exFAT_MBR.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : DiscImageChef unit testing.
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright © 2011-2018 Natalia Portillo
// ****************************************************************************/
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class ExFatMbr
{
readonly string[] testfiles = {"linux.vdi.lz", "macosx_10.11.vdi.lz", "win10.vdi.lz", "winvista.vdi.lz"};
readonly ulong[] sectors = {262144, 262144, 262144, 262144};
readonly uint[] sectorsize = {512, 512, 512, 512};
readonly long[] clusters = {32464, 32712, 32448, 32208};
readonly int[] clustersize = {4096, 4096, 4096, 4096};
readonly string[] volumename = {null, null, null, null};
readonly string[] volumeserial = {"603565AC", "595AC21E", "20126663", "0AC5CA52"};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "exfat_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new Vdi();
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]);
List<Partition> partitions = Core.Partitions.GetAll(image);
Filesystem fs = new exFAT();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
if(partitions[j].Type == "0x07")
{
part = j;
break;
}
Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
fs.GetInformation(image, partitions[part], out _);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("exFAT", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}