mirror of
https://github.com/aaru-dps/Aaru.git
synced 2025-12-16 19:24:25 +00:00
Corrected AMIX mappings.
This commit is contained in:
@@ -93,13 +93,13 @@ namespace DiscImageChef.PartPlugins
|
||||
/// </summary>
|
||||
const uint TypeIDFFS2 = 0x444F5307;
|
||||
/// <summary>
|
||||
/// Type ID for Amiga UNIX System V filesystem
|
||||
/// </summary>
|
||||
const uint TypeIDAMIXSysV = 0x554E4900;
|
||||
/// <summary>
|
||||
/// Type ID for Amiga UNIX boot filesystem
|
||||
/// </summary>
|
||||
const uint TypeIDAMIXBoot = 0x554E4901;
|
||||
const uint TypeIDAMIXBoot = 0x554E4900;
|
||||
/// <summary>
|
||||
/// Type ID for Amiga UNIX System V filesystem
|
||||
/// </summary>
|
||||
const uint TypeIDAMIXSysV = 0x554E4901;
|
||||
/// <summary>
|
||||
/// Type ID for Amiga UNIX BSD filesystem
|
||||
/// </summary>
|
||||
|
||||
1485
DiscImageChef.Tests/Filesystems/AFFS.cs
Normal file
1485
DiscImageChef.Tests/Filesystems/AFFS.cs
Normal file
File diff suppressed because it is too large
Load Diff
122
DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs
Normal file
122
DiscImageChef.Tests/Filesystems/AFFS2_RDB.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SFS_RDB.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 SFS_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"uae.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1024128,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
127000,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.SFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
System.Console.WriteLine("{0}", partitions[j].PartitionType);
|
||||
if(partitions[j].PartitionType == "\"SFS\\0\"")
|
||||
{
|
||||
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("SmartFileSystem", 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
124
DiscImageChef.Tests/Filesystems/AFFS_MBR.cs
Normal file
124
DiscImageChef.Tests/Filesystems/AFFS_MBR.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS_RDB.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 AFFS_RDB
|
||||
{
|
||||
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 = {
|
||||
1020064,1020064,407232,407232,
|
||||
1020064,1020064,1020064,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512,512,512,512,
|
||||
512,512,512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label","Volume label","Volume label",
|
||||
"Volume label","Volume label","Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
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", "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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
System.Console.WriteLine("{0}", partitions[j].PartitionType);
|
||||
if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
116
DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs
Normal file
116
DiscImageChef.Tests/Filesystems/AFFS_MBR_RDB.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS_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 AFFS_MBR
|
||||
{
|
||||
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 = {
|
||||
null,null,
|
||||
};
|
||||
|
||||
[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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0x2D")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
122
DiscImageChef.Tests/Filesystems/AFFS_RDB.cs
Normal file
122
DiscImageChef.Tests/Filesystems/AFFS_RDB.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SFS_RDB.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 SFS_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"uae.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1024128,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
127000,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.SFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
System.Console.WriteLine("{0}", partitions[j].PartitionType);
|
||||
if(partitions[j].PartitionType == "\"SFS\\0\"")
|
||||
{
|
||||
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("SmartFileSystem", 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
106
DiscImageChef.Tests/Filesystems/AOFS.cs
Normal file
106
DiscImageChef.Tests/Filesystems/AOFS.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS.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 AFFS
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz",
|
||||
};
|
||||
|
||||
readonly MediaType[] mediatypes = {
|
||||
MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD,
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1760, 1760,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
1760, 1760,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "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", "affs", 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 AmigaDOSPlugin();
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
124
DiscImageChef.Tests/Filesystems/AOFS_MBR.cs
Normal file
124
DiscImageChef.Tests/Filesystems/AOFS_MBR.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS_RDB.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 AFFS_RDB
|
||||
{
|
||||
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 = {
|
||||
1020064,1020064,407232,407232,
|
||||
1020064,1020064,1020064,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512,512,512,512,
|
||||
512,512,512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label","Volume label","Volume label",
|
||||
"Volume label","Volume label","Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
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", "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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
System.Console.WriteLine("{0}", partitions[j].PartitionType);
|
||||
if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
116
DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs
Normal file
116
DiscImageChef.Tests/Filesystems/AOFS_MBR_RDB.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AOFS_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 AOFS_MBR
|
||||
{
|
||||
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 = {
|
||||
null,null,
|
||||
};
|
||||
|
||||
[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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0x2C")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
122
DiscImageChef.Tests/Filesystems/AOFS_RDB.cs
Normal file
122
DiscImageChef.Tests/Filesystems/AOFS_RDB.cs
Normal file
@@ -0,0 +1,122 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SFS_RDB.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 SFS_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"uae.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1024128,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
127000,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.SFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
System.Console.WriteLine("{0}", partitions[j].PartitionType);
|
||||
if(partitions[j].PartitionType == "\"SFS\\0\"")
|
||||
{
|
||||
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("SmartFileSystem", 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
DiscImageChef.Tests/Filesystems/BeFS_GPT.cs
Normal file
121
DiscImageChef.Tests/Filesystems/BeFS_GPT.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : BeFS_APM.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 BeFS_APM
|
||||
{
|
||||
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 = {
|
||||
786400, 785232,
|
||||
};
|
||||
|
||||
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]);
|
||||
PartPlugin parts = new AppleMap();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.BeFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "Be_BFS")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
DiscImageChef.Tests/Filesystems/FAT16_Atari.cs
Normal file
121
DiscImageChef.Tests/Filesystems/FAT16_Atari.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FAT16_APM.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 FAT16_APM
|
||||
{
|
||||
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]);
|
||||
PartPlugin parts = new AppleMap();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FAT();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "DOS_FAT_16")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
123
DiscImageChef.Tests/Filesystems/FAT16_RDB.cs
Normal file
123
DiscImageChef.Tests/Filesystems/FAT16_RDB.cs
Normal file
@@ -0,0 +1,123 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS_RDB.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 AFFS_RDB
|
||||
{
|
||||
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 = {
|
||||
1020064,1020064,407232,407232,
|
||||
1020064,1020064,1020064,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512,512,512,512,
|
||||
512,512,512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label","Volume label","Volume label",
|
||||
"Volume label","Volume label","Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
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", "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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs
Normal file
121
DiscImageChef.Tests/Filesystems/HAMMER_MBR.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HFSX_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 HFSX_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
393216, 409600, 262144, 262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512, 512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
102390, 153590, 32512, 32512,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
4096, 4096, 4096, 4096
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "Volume label", "Volume label", "Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"UNKNOWN","UNKNOWN","0000000000000000","0000000000000000"
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
"10.0","HFSJ","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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0xAF")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
1622
DiscImageChef.Tests/Filesystems/HFS.cs
Normal file
1622
DiscImageChef.Tests/Filesystems/HFS.cs
Normal file
File diff suppressed because it is too large
Load Diff
116
DiscImageChef.Tests/Filesystems/HFS_APM.cs
Normal file
116
DiscImageChef.Tests/Filesystems/HFS_APM.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HFS_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 HFS_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"linux.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
65018,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"0000000000000000",
|
||||
};
|
||||
|
||||
[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]);
|
||||
PartPlugin parts = new MBR();
|
||||
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 == "0xAF")
|
||||
{
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
124
DiscImageChef.Tests/Filesystems/HFS_RDB.cs
Normal file
124
DiscImageChef.Tests/Filesystems/HFS_RDB.cs
Normal file
@@ -0,0 +1,124 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : FAT16_RDB.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;
|
||||
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 FAT16_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"amigaos_3.9.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1024128
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
1020064
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"VOLUMELABEL"
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"UNKNOWN ",
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
"CDP 5.0",
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here.");
|
||||
/*
|
||||
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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FAT();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "\"RES\\86\"")
|
||||
{
|
||||
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("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]);
|
||||
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
119
DiscImageChef.Tests/Filesystems/LFS_MBR.cs
Normal file
119
DiscImageChef.Tests/Filesystems/LFS_MBR.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HAMMER_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;
|
||||
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 HAMMER_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
104857600, 104857600,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
104856192, 104856192,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"UNKNOWN","UNKNOWN",
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
throw new NotImplementedException("HAMMER filesystem is not yet implemented");
|
||||
/*
|
||||
for(int i = 0; i < testfiles.Length; i++)
|
||||
{
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_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.HAMMER();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0xA5")
|
||||
{
|
||||
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("HAMMER", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
114
DiscImageChef.Tests/Filesystems/MFS.cs
Normal file
114
DiscImageChef.Tests/Filesystems/MFS.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HFS.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 HFS
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"macos_1.1_mf2dd.img.lz","macos_2.0_mf2dd.img.lz","macos_6.0.7_mf2dd.img.lz","nextstep_3.3_mf2hd.img.lz",
|
||||
"openstep_4.0_mf2hd.img.lz","openstep_4.2_mf2hd.img.lz","rhapsody_dr1_mf2hd.img.lz",
|
||||
};
|
||||
|
||||
readonly MediaType[] mediatypes = {
|
||||
MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.DOS_35_HD,
|
||||
MediaType.DOS_35_HD, MediaType.DOS_35_HD, MediaType.DOS_35_HD,
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1600, 1600, 1600, 2880,
|
||||
2880, 2880, 2880,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
1594, 1594, 1594, 2874,
|
||||
2874, 2874, 2874,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label","Volume label","Volume label",
|
||||
"Volume label","Volume label","Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
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", 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 AppleHFS();
|
||||
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("HFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
130
DiscImageChef.Tests/Filesystems/NTFS_GPT.cs
Normal file
130
DiscImageChef.Tests/Filesystems/NTFS_GPT.cs
Normal file
@@ -0,0 +1,130 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : NTFS_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 NTFS_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"win10.vdi.lz", "win2000.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", "linux.vdi.lz",
|
||||
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
524288, 2097152, 1024000, 524288,
|
||||
524288, 524288, 524288, 262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
65263, 1046511, 1023057, 524256,
|
||||
524256, 524096, 64767, 32512,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
4096, 1024, 512, 512,
|
||||
512, 512, 4096, 4096,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
null, null, null, null,
|
||||
null, null, null, null,
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"C46C1B3C6C1B28A6","8070C8EC70C8E9CC","10CC6AC6CC6AA5A6","7A14F50014F4BFE5",
|
||||
"24884447884419A6","822C288D2C287E73","E20AF54B0AF51D6B","065BB96B7C1BCFDA",
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
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", "ntfs_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.NTFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0x07")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
119
DiscImageChef.Tests/Filesystems/NWFS386.cs
Normal file
119
DiscImageChef.Tests/Filesystems/NWFS386.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HAMMER_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;
|
||||
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 HAMMER_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
104857600, 104857600,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
104856192, 104856192,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"UNKNOWN","UNKNOWN",
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
throw new NotImplementedException("HAMMER filesystem is not yet implemented");
|
||||
/*
|
||||
for(int i = 0; i < testfiles.Length; i++)
|
||||
{
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_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.HAMMER();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0xA5")
|
||||
{
|
||||
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("HAMMER", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
119
DiscImageChef.Tests/Filesystems/OCFS2.cs
Normal file
119
DiscImageChef.Tests/Filesystems/OCFS2.cs
Normal file
@@ -0,0 +1,119 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HAMMER_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;
|
||||
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 HAMMER_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
104857600, 104857600,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
104856192, 104856192,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"UNKNOWN","UNKNOWN",
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
throw new NotImplementedException("HAMMER filesystem is not yet implemented");
|
||||
/*
|
||||
for(int i = 0; i < testfiles.Length; i++)
|
||||
{
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_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.HAMMER();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0xA5")
|
||||
{
|
||||
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("HAMMER", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
151
DiscImageChef.Tests/Filesystems/ProDOS_APM.cs
Normal file
151
DiscImageChef.Tests/Filesystems/ProDOS_APM.cs
Normal file
@@ -0,0 +1,151 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : HFS_APM.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_APM
|
||||
{
|
||||
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",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1024128,409600,409600,409600,
|
||||
409600,41820,41820,81648,
|
||||
1024000,1024000,1024000,1024000,
|
||||
1024000,1024000,1024000,1024000,
|
||||
1024000,1024000,1024000,1024000,
|
||||
409600,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
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,39991,39991,39991,
|
||||
63954,63990,63954,63954,
|
||||
63954,63922,63922,63922,
|
||||
63922,63884,63883,63883,
|
||||
58506,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
8192,4096,4096,3584,
|
||||
3584,1024,1024,1024,
|
||||
8192,8192,8192,8192,
|
||||
8192,8192,8192,8192,
|
||||
8192,8192,8192,8192,
|
||||
3584,
|
||||
};
|
||||
|
||||
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"
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
null,null,null,null,
|
||||
"AAFE1382AF5AA898",null,null,null,
|
||||
null,null,null,null,
|
||||
null,null,null,null,
|
||||
null,"5A7C38B0CAF279C4","FB49083EBD150509","632C0B1DB46FD188",
|
||||
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]);
|
||||
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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
121
DiscImageChef.Tests/Filesystems/SFS_MBR.cs
Normal file
121
DiscImageChef.Tests/Filesystems/SFS_MBR.cs
Normal file
@@ -0,0 +1,121 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SFS_RDB.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 SFS_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"uae.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1024128,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
127000,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
null,
|
||||
};
|
||||
|
||||
readonly string[] oemid = {
|
||||
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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.SFS();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "\"SFS\\0\"" || partitions[j].PartitionType == "\"SFS\\2\"")
|
||||
{
|
||||
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("SmartFileSystem", 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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
118
DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs
Normal file
118
DiscImageChef.Tests/Filesystems/SFS_MBR_RDB.cs
Normal file
@@ -0,0 +1,118 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS_MBR_RDB.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;
|
||||
using System;
|
||||
|
||||
namespace DiscImageChef.Tests.Filesystems
|
||||
{
|
||||
[TestFixture]
|
||||
public class AFFS_MBR_RDB
|
||||
{
|
||||
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 = {
|
||||
null,null,
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here.");
|
||||
/* 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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0x2D")
|
||||
{
|
||||
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("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]);
|
||||
}*/
|
||||
}
|
||||
}
|
||||
}
|
||||
106
DiscImageChef.Tests/Filesystems/SysV.cs
Normal file
106
DiscImageChef.Tests/Filesystems/SysV.cs
Normal file
@@ -0,0 +1,106 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS.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 AFFS
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz",
|
||||
};
|
||||
|
||||
readonly MediaType[] mediatypes = {
|
||||
MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD,
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
1760, 1760,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
1760, 1760,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "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", "affs", 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 AmigaDOSPlugin();
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DiscImageChef.Tests/Filesystems/SysV_MBR.cs
Normal file
120
DiscImageChef.Tests/Filesystems/SysV_MBR.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : SysV_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 SysV_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"amix.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
409600,409600,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
511488,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
1024,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label",
|
||||
};
|
||||
|
||||
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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "\"UNI\\1\"")
|
||||
{
|
||||
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(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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
116
DiscImageChef.Tests/Filesystems/SysV_RDB.cs
Normal file
116
DiscImageChef.Tests/Filesystems/SysV_RDB.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : AFFS_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 AFFS_MBR
|
||||
{
|
||||
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 = {
|
||||
null,null,
|
||||
};
|
||||
|
||||
[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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "0x2D")
|
||||
{
|
||||
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("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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
114
DiscImageChef.Tests/Filesystems/UFS.cs
Normal file
114
DiscImageChef.Tests/Filesystems/UFS.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MFS.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 MFS
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"macos_0.1_mf1dd.img.lz","macos_0.5_mf1dd.img.lz","macos_1.1_mf1dd.img.lz","macos_2.0_mf1dd.img.lz",
|
||||
"macos_6.0.7_mf1dd.img.lz",
|
||||
};
|
||||
|
||||
readonly MediaType[] mediatypes = {
|
||||
MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS,
|
||||
MediaType.AppleSonySS
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
800, 800, 800, 800,
|
||||
800,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
391, 391, 391, 391,
|
||||
391,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
1024, 1024, 1024, 1024,
|
||||
1024,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label","Volume label","Volume label",
|
||||
"Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
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", "mfs", 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.AppleMFS.AppleMFS();
|
||||
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("MFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
116
DiscImageChef.Tests/Filesystems/UFS_APM.cs
Normal file
116
DiscImageChef.Tests/Filesystems/UFS_APM.cs
Normal file
@@ -0,0 +1,116 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UFS_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 UFS_MBR
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
262144, 262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
65024, 65018,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048, 2048
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label", "Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"59588B778E9ACDEF", "UNKNOWN",
|
||||
};
|
||||
|
||||
[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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
|
||||
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("UFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
176
DiscImageChef.Tests/Filesystems/UFS_NeXT.cs
Normal file
176
DiscImageChef.Tests/Filesystems/UFS_NeXT.cs
Normal file
@@ -0,0 +1,176 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UFS_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 UFS_MBR
|
||||
{
|
||||
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_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",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
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, 262144,
|
||||
262144,
|
||||
};
|
||||
|
||||
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, 65018, 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, 65018,
|
||||
65024,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
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, 2048,
|
||||
2048,
|
||||
};
|
||||
|
||||
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", "Volume label",
|
||||
"Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"59588B778E9ACDEF", "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", "UNKNOWN",
|
||||
"UNKNOWN",
|
||||
};
|
||||
|
||||
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]);
|
||||
PartPlugin parts = new MBR();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
|
||||
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(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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
136
DiscImageChef.Tests/Filesystems/UFS_RDB.cs
Normal file
136
DiscImageChef.Tests/Filesystems/UFS_RDB.cs
Normal file
@@ -0,0 +1,136 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UFS_APM.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 UFS_APM
|
||||
{
|
||||
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 = {
|
||||
262144, 262144, 262144, 262144,
|
||||
262144, 262144, 262144, 262144,
|
||||
262144, 262144, 262144,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
65024, 65018, 65024, 65018,
|
||||
65024, 65018, 65024, 65018,
|
||||
65024, 65018, 65024,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
2048, 2048, 2048, 2048,
|
||||
2048, 2048, 2048, 2048,
|
||||
2048, 2048, 2048,
|
||||
};
|
||||
|
||||
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",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
|
||||
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
|
||||
"UNKNOWN", "UNKNOWN", "UNKNOWN",
|
||||
};
|
||||
|
||||
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]);
|
||||
PartPlugin parts = new AppleMap();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "Apple_UFS")
|
||||
{
|
||||
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(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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DiscImageChef.Tests/Filesystems/UFS_Suni86.cs
Normal file
120
DiscImageChef.Tests/Filesystems/UFS_Suni86.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UFS_RDB.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 UFS_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"amix.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
262144,
|
||||
};
|
||||
|
||||
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", "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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "\"UNI\\2\"")
|
||||
{
|
||||
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(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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
111
DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs
Normal file
111
DiscImageChef.Tests/Filesystems/UNIXBFS_MBR.cs
Normal file
@@ -0,0 +1,111 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : unixbfs.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 unixbfs
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"linux.vdi.lz","amix.adf.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
262144,1760,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512,512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
260096,1760,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
512,512,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Label","Label",
|
||||
};
|
||||
|
||||
[Test]
|
||||
public void Test()
|
||||
{
|
||||
for(int i = 0; i < testfiles.Length; i++)
|
||||
{
|
||||
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs", 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.BFS();
|
||||
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("BFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
120
DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs
Normal file
120
DiscImageChef.Tests/Filesystems/UNIXBFS_RDB.cs
Normal file
@@ -0,0 +1,120 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : UFS_RDB.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 UFS_RDB
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"amix.vdi.lz",
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
262144,
|
||||
};
|
||||
|
||||
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", "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]);
|
||||
PartPlugin parts = new AmigaRigidDiskBlock();
|
||||
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
|
||||
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
|
||||
int part = -1;
|
||||
for(int j = 0; j < partitions.Count; j++)
|
||||
{
|
||||
if(partitions[j].PartitionType == "\"UNI\\2\"")
|
||||
{
|
||||
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(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]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
114
DiscImageChef.Tests/Filesystems/ZFS.cs
Normal file
114
DiscImageChef.Tests/Filesystems/ZFS.cs
Normal file
@@ -0,0 +1,114 @@
|
||||
// /***************************************************************************
|
||||
// The Disc Image Chef
|
||||
// ----------------------------------------------------------------------------
|
||||
//
|
||||
// Filename : MFS.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 MFS
|
||||
{
|
||||
readonly string[] testfiles = {
|
||||
"macos_0.1_mf1dd.img.lz","macos_0.5_mf1dd.img.lz","macos_1.1_mf1dd.img.lz","macos_2.0_mf1dd.img.lz",
|
||||
"macos_6.0.7_mf1dd.img.lz",
|
||||
};
|
||||
|
||||
readonly MediaType[] mediatypes = {
|
||||
MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS,
|
||||
MediaType.AppleSonySS
|
||||
};
|
||||
|
||||
readonly ulong[] sectors = {
|
||||
800, 800, 800, 800,
|
||||
800,
|
||||
};
|
||||
|
||||
readonly uint[] sectorsize = {
|
||||
512, 512, 512, 512,
|
||||
512, 512, 512,
|
||||
};
|
||||
|
||||
readonly long[] clusters = {
|
||||
391, 391, 391, 391,
|
||||
391,
|
||||
};
|
||||
|
||||
readonly int[] clustersize = {
|
||||
1024, 1024, 1024, 1024,
|
||||
1024,
|
||||
};
|
||||
|
||||
readonly string[] volumename = {
|
||||
"Volume label","Volume label","Volume label","Volume label",
|
||||
"Volume label",
|
||||
};
|
||||
|
||||
readonly string[] volumeserial = {
|
||||
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", "mfs", 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.AppleMFS.AppleMFS();
|
||||
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("MFS", fs.XmlFSType.Type, testfiles[i]);
|
||||
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
|
||||
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user