Added more tests.

This commit is contained in:
2017-07-13 00:17:18 +01:00
parent 14baa50ae1
commit ed03a9dceb
21 changed files with 1338 additions and 49 deletions

View File

@@ -98,7 +98,7 @@
<Compile Include="Filesystems\FAT12_GPT.cs" /> <Compile Include="Filesystems\FAT12_GPT.cs" />
<Compile Include="Filesystems\HFS_MBR.cs" /> <Compile Include="Filesystems\HFS_MBR.cs" />
<Compile Include="Filesystems\JFS2.cs" /> <Compile Include="Filesystems\JFS2.cs" />
<Compile Include="Filesystems\MINIX.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" />
@@ -142,6 +142,17 @@
<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\FAT16.cs" />
<Compile Include="Filesystems\HFS_CDROM.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_MBR.cs" />
<Compile Include="Filesystems\XFS_MBR.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />

View File

@@ -0,0 +1,119 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Atheros_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class Atheos_MBR
{
readonly string[] testfiles = {
"syllable_0.6.7.vdi.lz",
};
readonly ulong[] sectors = {
1572864,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
786400,
};
readonly int[] clustersize = {
1024,
};
readonly string[] volumename = {
"Volume label",
};
readonly string[] volumeserial = {
null,
};
[Test]
public void Test()
{
throw new System.NotImplementedException("Atheos filesystem is not yet implemented");
/*
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "atheos_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]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.Atheros();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x2A")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Atheros", 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

@@ -63,7 +63,7 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
786400, 785232, 786336, 786336,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {

View File

@@ -51,35 +51,31 @@ namespace DiscImageChef.Tests.Filesystems
public class BeFS_MBR public class BeFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "haiku_hrev51259.vdi.lz", "beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "haiku_hrev51259.vdi.lz","syllable_0.6.7.vdi.lz"
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1572864, 1572864,8388608, 1572864, 1572864, 8388608, 2097152,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
786400, 785232, 2096640, 786400, 785232, 2096640, 524272,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024, 2048, 1024, 1024, 2048, 2048,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label", "Volume label","Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null,null, null,null,null,null,
};
readonly string[] oemid = {
null,null,null,
}; };
[Test] [Test]
@@ -114,7 +110,6 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -251,6 +251,10 @@ namespace DiscImageChef.Tests.Filesystems
"openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.lz", "openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.lz",
// Solaris 2.4 // Solaris 2.4
"solaris_2.4_mf2dd.img.lz","solaris_2.4_mf2hd.img.lz", "solaris_2.4_mf2dd.img.lz","solaris_2.4_mf2hd.img.lz",
// COHERENT UNIX 4.2.10
"coherentunix_4.2.10_dsdd.img.lz","coherentunix_4.2.10_dshd.img.lz","coherentunix_4.2.10_mf2dd.img.lz","coherentunix_4.2.10_mf2hd.img.lz",
// SCO OpenServer 5.0.7Hw
"scoopenserver_5.0.7hw_dshd.img.lz","scoopenserver_5.0.7hw_mf2dd.img.lz","scoopenserver_5.0.7hw_mf2hd.img.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
@@ -436,7 +440,6 @@ namespace DiscImageChef.Tests.Filesystems
// BeOS R4.5 // BeOS R4.5
MediaType.DOS_35_HD, MediaType.DOS_35_HD,
// Hatari // Hatari
// TODO: Incorrect media types
MediaType.DOS_35_SS_DD_9,MediaType.ATARI_35_SS_DD,MediaType.ATARI_35_SS_DD_11, MediaType.DOS_35_SS_DD_9,MediaType.ATARI_35_SS_DD,MediaType.ATARI_35_SS_DD_11,
MediaType.DOS_35_DS_DD_9,MediaType.ATARI_35_DS_DD,MediaType.ATARI_35_DS_DD_11, MediaType.DOS_35_DS_DD_9,MediaType.ATARI_35_DS_DD,MediaType.ATARI_35_DS_DD_11,
MediaType.DOS_35_ED,MediaType.DOS_35_HD, MediaType.DOS_35_ED,MediaType.DOS_35_HD,
@@ -452,6 +455,10 @@ namespace DiscImageChef.Tests.Filesystems
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// Solaris 2.4 // Solaris 2.4
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD, MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// COHERENT UNIX 4.2.10
MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// SCO OpenServer 5.0.7Hw
MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
@@ -611,6 +618,10 @@ namespace DiscImageChef.Tests.Filesystems
1440,2880, 1440,2880,
// Solaris 2.4 // Solaris 2.4
1440,2880, 1440,2880,
// COHERENT UNIX 4.2.10
720,2400,1440,2880,
// SCO OpenServer 5.0.7Hw
2400,1440,2880,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -770,6 +781,10 @@ namespace DiscImageChef.Tests.Filesystems
512,512, 512,512,
// Solaris 2.4 // Solaris 2.4
512,512, 512,512,
// COHERENT UNIX 4.2.10
512,512,512,512,
// SCO OpenServer 5.0.7Hw
512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
@@ -929,6 +944,10 @@ namespace DiscImageChef.Tests.Filesystems
720,2880, 720,2880,
// Solaris 2.4 // Solaris 2.4
720,2880, 720,2880,
// COHERENT UNIX 4.2.10
360,2400,720,2880,
// SCO OpenServer 5.0.7Hw
2400,1440,2880,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -1088,6 +1107,10 @@ namespace DiscImageChef.Tests.Filesystems
1024,512, 1024,512,
// Solaris 2.4 // Solaris 2.4
1024,512, 1024,512,
// COHERENT UNIX 4.2.10
1024,512,1024,512,
// SCO OpenServer 5.0.7Hw
512,512,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -1256,6 +1279,10 @@ namespace DiscImageChef.Tests.Filesystems
null,null, null,null,
// Solaris 2.4 // Solaris 2.4
null,null, null,null,
// COHERENT UNIX 4.2.10
"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",
// SCO OpenServer 5.0.7Hw
null,null,null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
@@ -1424,6 +1451,10 @@ namespace DiscImageChef.Tests.Filesystems
null,null, null,null,
// Solaris 2.4 // Solaris 2.4
null,null, null,null,
// COHERENT UNIX 4.2.10
null,null,null,null,
// SCO OpenServer 5.0.7Hw
null,null,null,
}; };
readonly string[] oemid = { readonly string[] oemid = {
@@ -1592,6 +1623,10 @@ namespace DiscImageChef.Tests.Filesystems
"NEXT ","NEXT ", "NEXT ","NEXT ",
// Solaris 2.4 // Solaris 2.4
"MSDOS3.3","MSDOS3.3", "MSDOS3.3","MSDOS3.3",
// COHERENT UNIX 4.2.10
"COHERENT","COHERENT","COHERENT","COHERENT",
// SCO OpenServer 5.0.7Hw
"SCO BOOT","SCO BOOT","SCO BOOT",
}; };
[Test] [Test]

View File

@@ -0,0 +1,138 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class FAT16
{
readonly string[] testfiles = {
// MS-DOS 3.30A
"msdos_3.30A_mf2ed.img.lz",
// MS-DOS 3.31
"msdos_3.31_mf2ed.img.lz",
};
readonly MediaType[] mediatypes = {
// MS-DOS 3.30A
MediaType.DOS_35_ED,
// MS-DOS 3.31
MediaType.DOS_35_ED,
};
readonly ulong[] sectors = {
// MS-DOS 3.30A
5760,
// MS-DOS 3.31
5760,
};
readonly uint[] sectorsize = {
// MS-DOS 3.30A
512,
// MS-DOS 3.31
512,
};
readonly long[] clusters = {
// MS-DOS 3.30A
5760,
// MS-DOS 3.31
5760,
};
readonly int[] clustersize = {
// MS-DOS 3.30A
512,
// MS-DOS 3.31
512,
};
readonly string[] volumename = {
// MS-DOS 3.30A
null,
// MS-DOS 3.31
null,
};
readonly string[] volumeserial = {
// MS-DOS 3.30A
null,
// MS-DOS 3.31
null,
};
readonly string[] oemid = {
// MS-DOS 3.30A
"MSDOS3.3",
// MS-DOS 3.31
"IBM 3.3",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16", 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 FAT();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
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

@@ -56,7 +56,11 @@ namespace DiscImageChef.Tests.Filesystems
"macos_7.5.3.vdi.lz","macos_7.5.vdi.lz","macos_7.6.vdi.lz","macos_8.0.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_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", "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", "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 = { readonly ulong[] sectors = {
@@ -65,10 +69,18 @@ namespace DiscImageChef.Tests.Filesystems
1024000,1024000,1024000,1024000, 1024000,1024000,1024000,1024000,
1024000,1024000,1024000,1024000, 1024000,1024000,1024000,1024000,
1024000,1024000,1024000,1024000, 1024000,1024000,1024000,1024000,
409600, 409600,51200,51200,41820,
41820,54840,54840,54840,
54840,54840,41820,54840,
54840,262144,51200,51200,
54840,
}; };
readonly uint[] sectorsize = { 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,
@@ -79,20 +91,28 @@ namespace DiscImageChef.Tests.Filesystems
readonly long[] clusters = { readonly long[] clusters = {
64003,51189,51189,58502, 64003,51189,51189,58502,
58502,39991,39991,39991, 58502,41788,38950,39991,
63954,63990,63954,63954, 63954,63990,63954,63954,
63954,63922,63922,63922, 63954,63922,63922,63922,
63922,63884,63883,63883, 63922,63884,63883,63883,
58506, 58506,50926,50094,38950,
38950,38950,38950,7673,
38950,38950,38950,38950,
38950,46071,50382,49135,
54643,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
8192,4096,4096,3584, 8192,4096,4096,3584,
3584,1024,1024,1024, 3584,512,512,1024,
8192,8192,8192,8192, 8192,8192,8192,8192,
8192,8192,8192,8192, 8192,8192,8192,8192,
8192,8192,8192,8192, 8192,8192,8192,8192,
3584, 3584,512,512,512,
512,512,512,512,
512,512,512,512,
512,1024,512,512,
512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -101,7 +121,11 @@ namespace DiscImageChef.Tests.Filesystems
"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","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 = { readonly string[] volumeserial = {
@@ -110,6 +134,10 @@ namespace DiscImageChef.Tests.Filesystems
null,null,null,null, null,null,null,null,
null,null,null,null, null,null,null,null,
null,"5A7C38B0CAF279C4","FB49083EBD150509","632C0B1DB46FD188", null,"5A7C38B0CAF279C4","FB49083EBD150509","632C0B1DB46FD188",
null,null,null,null,
null,null,null,null,
null,null,null,null,
null,null,null,null,
null, null,
}; };

View File

@@ -0,0 +1,129 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFS_CDROM.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFS_CDROM
{
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",
// TODO: These two expect the CD-ROM to return 512 bytes sectors, that is something DIC doesn't if the extension is .iso
"toast_3.5.7_hfs_from_files.bin.lz","toast_4.1.3_hfs_from_files.bin.lz",
};
readonly ulong[] sectors = {
942,1880,
943,1882,
6036,6116,
};
readonly uint[] sectorsize = {
2048,2048,
2048,2048,
512,512,
};
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]);
PartPlugin parts = new AppleMap();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "Apple_HFS")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,96 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
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,
};
[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();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Minix v1", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,106 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIX.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MINIXv1_MBR
{
readonly string[] testfiles = {
"linux.vdi.lz","minix_3.1.2a.vdi.lz",
};
readonly ulong[] sectors = {
262144,262144,
};
readonly uint[] sectorsize = {
512,512,
};
readonly long[] clusters = {
130048,130048,
};
readonly int[] clustersize = {
1024,1024,
};
[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]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x81")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Minix V1", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,96 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
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,
};
[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();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Minix v2", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -48,14 +48,14 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class MINIX public class MINIXv2_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux_v1.vdi.lz", "minix_3.1.2a.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144, 1024000,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -63,7 +63,7 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
130048, 1000,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -75,7 +75,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minix", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "minixv2_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -99,7 +99,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Minix V1", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Minix V2", fs.XmlFSType.Type, testfiles[i]);
} }
} }
} }

View File

@@ -0,0 +1,96 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
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 = {
360, 1200, 720, 1440,
};
readonly int[] clustersize = {
1024, 1024, 1024, 1024,
};
[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();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Minix v3", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,106 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIX.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class MINIXv3_MBR
{
readonly string[] testfiles = {
"minix_3.1.2a.vdi.lz",
};
readonly ulong[] sectors = {
4194304,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
4096,
};
readonly int[] clustersize = {
1024,
};
[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]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.MinixFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x81")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Minix V3", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,96 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class QNX4
{
readonly string[] testfiles = {
"qnx_4.24_dsdd.img.lz","qnx_4.24_dshd.img.lz","qnx_4.24_mf2dd.img.lz","qnx_4.24_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 = {
720, 2400, 1440, 2880,
};
readonly int[] clustersize = {
512, 512, 512, 512,
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "qnx4", 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 DiscImageChef.Filesystems.QNX4();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
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,106 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : MINIX.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class QNX4_MBR
{
readonly string[] testfiles = {
"qnx_4.24.vdi.lz",
};
readonly ulong[] sectors = {
1024000,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
1022976,
};
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]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.QNX4();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x4D")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("QNX4 filesystem", fs.XmlFSType.Type, testfiles[i]);
}
}
}
}

View File

@@ -48,38 +48,47 @@ namespace DiscImageChef.Tests.Filesystems
public class UFS public class UFS
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amix_mf2dd.adf.lz","netbsd_1.6_mf2hd.img.lz", "amix_mf2dd.adf.lz","netbsd_1.6_mf2hd.img.lz","att_unix_svr4v2.1_dsdd.img.lz","att_unix_svr4v2.1_dshd.img.lz",
"att_unix_svr4v2.1_mf2dd.img.lz","att_unix_svr4v2.1_mf2hd.img.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
MediaType.CBM_AMIGA_35_DD, MediaType.DOS_35_HD, MediaType.CBM_AMIGA_35_DD, MediaType.DOS_35_HD, MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD,
MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD,
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1760, 2880, 1760, 2880, 720, 2400,
1440, 2880,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512,
512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1760, 2880, 1760, 2880, 720, 2400,
1440, 2880,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 512, 512,
512, 512, 512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, null, null, null, null, null,
null, null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null, null, null,
null, null, null, null,
}; };
readonly string[] type = { readonly string[] type = {
"UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS",
}; };

View File

@@ -58,7 +58,7 @@ namespace DiscImageChef.Tests.Filesystems
"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/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/freebsd_8.2.vdi.lz", "ufs1/netbsd_1.6.vdi.lz", "ufs1/netbsd_7.1.vdi.lz", "ufs1/solaris_7.vdi.lz",
"ufs1/solaris_7.vdi.lz", "ufs2/freebsd_6.1.vdi.lz", "ufs2/freebsd_7.0.vdi.lz", "ufs2/freebsd_8.2.vdi.lz", "ufs1/solaris_7.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", "ufs2/netbsd_7.1.vdi.lz", "ffs43/att_unix_svr4v2.1.vdi",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
@@ -69,7 +69,7 @@ namespace DiscImageChef.Tests.Filesystems
262144, 262144, 262144, 262144, 262144, 262144, 262144, 262144,
262144, 262144, 262144, 262144, 262144, 262144, 262144, 262144,
262144, 262144, 262144, 262144, 262144, 262144, 262144, 262144,
262144, 262144, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -80,7 +80,7 @@ namespace DiscImageChef.Tests.Filesystems
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 = { readonly long[] clusters = {
@@ -91,7 +91,7 @@ namespace DiscImageChef.Tests.Filesystems
65024, 65018, 65024, 65018, 65024, 65018, 65024, 65018,
65024, 65018, 65024, 65018, 65024, 65018, 65024, 65018,
65024, 65018, 65024, 65018, 65024, 65018, 65024, 65018,
65024, 65024, 65024,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -102,7 +102,7 @@ namespace DiscImageChef.Tests.Filesystems
2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
2048, 2048, 2048, 2048, 2048, 2048, 2048, 2048,
2048, 2048, 2048,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -113,7 +113,7 @@ namespace DiscImageChef.Tests.Filesystems
"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", null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
@@ -124,7 +124,7 @@ namespace DiscImageChef.Tests.Filesystems
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", null,
}; };
readonly string[] type = { readonly string[] type = {
@@ -135,7 +135,7 @@ namespace DiscImageChef.Tests.Filesystems
"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS",
"UFS", "UFS2", "UFS2", "UFS2", "UFS", "UFS2", "UFS2", "UFS2",
"UFS2", "UFS2", "UFS",
}; };
[Test] [Test]
@@ -156,7 +156,7 @@ namespace DiscImageChef.Tests.Filesystems
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x83") if(partitions[j].PartitionType == "0x63" || partitions[j].PartitionType == "0xA8" || partitions[j].PartitionType == "0xA5" || partitions[j].PartitionType == "0xA9")
{ {
part = j; part = j;
break; break;

View File

@@ -51,31 +51,38 @@ namespace DiscImageChef.Tests.Filesystems
public class unixbfs public class unixbfs
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amix.adf.lz", "amix_mf2dd.adf.lz","att_unix_svr4v2.1_dsdd.img.lz","att_unix_svr4v2.1_dshd.img.lz","att_unix_svr4v2.1_mf2dd.img.lz",
"att_unix_svr4v2.1_mf2hd.img.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD, MediaType.DOS_525_DS_DD_9, MediaType.DOS_525_HD, MediaType.DOS_35_DS_DD_9,
MediaType.DOS_35_HD,
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1760, 1760, 720, 2400, 1440,
2880,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512,
512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1760, 1760, 720, 2400, 1440,
2880,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 512, 512,
512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Label", "Label",null,null,null,
null,
}; };
[Test] [Test]
@@ -91,7 +98,7 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.BFS();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);

View File

@@ -55,7 +55,7 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144, 1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ 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 (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class XFS_MBR
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
191176,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"unknown",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "xfs_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]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.XFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("XFS filesystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}