Added more tests.

This commit is contained in:
2017-07-08 19:24:07 +01:00
parent adf4549371
commit ef10f16d96
64 changed files with 1014 additions and 3596 deletions

View File

@@ -104,6 +104,41 @@
<Compile Include="Filesystems\Reiser4.cs" /> <Compile Include="Filesystems\Reiser4.cs" />
<Compile Include="Filesystems\UNIXBFS.cs" /> <Compile Include="Filesystems\UNIXBFS.cs" />
<Compile Include="Filesystems\UFS_MBR.cs" /> <Compile Include="Filesystems\UFS_MBR.cs" />
<Compile Include="Filesystems\AFFS.cs" />
<Compile Include="Filesystems\AFFS_RDB.cs" />
<Compile Include="Filesystems\AFFS2_RDB.cs" />
<Compile Include="Filesystems\AOFS_RDB.cs" />
<Compile Include="Filesystems\AOFS.cs" />
<Compile Include="Filesystems\AFFS_MBR.cs" />
<Compile Include="Filesystems\AOFS_MBR.cs" />
<Compile Include="Filesystems\AFFS_MBR_RDB.cs" />
<Compile Include="Filesystems\AOFS_MBR_RDB.cs" />
<Compile Include="Filesystems\BeFS_GPT.cs" />
<Compile Include="Filesystems\FAT16_Atari.cs" />
<Compile Include="Filesystems\FAT16_RDB.cs" />
<Compile Include="Filesystems\HAMMER_MBR.cs" />
<Compile Include="Filesystems\HFS.cs" />
<Compile Include="Filesystems\HFS_APM.cs" />
<Compile Include="Filesystems\HFS_RDB.cs" />
<Compile Include="Filesystems\LFS_MBR.cs" />
<Compile Include="Filesystems\MFS.cs" />
<Compile Include="Filesystems\NTFS_GPT.cs" />
<Compile Include="Filesystems\NWFS386.cs" />
<Compile Include="Filesystems\OCFS2.cs" />
<Compile Include="Filesystems\ProDOS_APM.cs" />
<Compile Include="Filesystems\SysV.cs" />
<Compile Include="Filesystems\SysV_RDB.cs" />
<Compile Include="Filesystems\SysV_MBR.cs" />
<Compile Include="Filesystems\SFS_MBR_RDB.cs" />
<Compile Include="Filesystems\SFS_MBR.cs" />
<Compile Include="Filesystems\UFS.cs" />
<Compile Include="Filesystems\UFS_APM.cs" />
<Compile Include="Filesystems\UFS_NeXT.cs" />
<Compile Include="Filesystems\UFS_RDB.cs" />
<Compile Include="Filesystems\UFS_Suni86.cs" />
<Compile Include="Filesystems\UNIXBFS_RDB.cs" />
<Compile Include="Filesystems\UNIXBFS_MBR.cs" />
<Compile Include="Filesystems\ZFS.cs" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="packages.config" /> <None Include="packages.config" />

File diff suppressed because it is too large Load Diff

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : SFS_RDB.cs // Filename : AFFS2_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,10 +48,10 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class SFS_RDB public class AFFS2_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"uae.vdi.lz", "amigaos_4.0.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
@@ -63,31 +63,27 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
127000, 1022080,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null,
}; };
readonly string[] oemid = {
null,
};
[Test] [Test]
public void Test() public void Test()
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs2_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -96,12 +92,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.SFS(); Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
System.Console.WriteLine("{0}", partitions[j].PartitionType); if(partitions[j].PartitionType == "\"DOS\\7\"")
if(partitions[j].PartitionType == "\"SFS\\0\"")
{ {
part = j; part = j;
break; break;
@@ -112,10 +107,9 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga FFS2", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS_RDB.cs // Filename : AFFS_MBR.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,41 +48,34 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS_RDB public class AFFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_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 = { readonly ulong[] sectors = {
1024128,1024128,409600,409600, 409600,409600,
1024128,1024128,1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512,512,512, 512,512,
512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1020064,1020064,407232,407232, 408240,408240,
1020064,1020064,1020064,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512,512,512,512, 512,512,
512,512,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label","Volume label", "Volume label","Volume label",
"Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null,null,null, null,null,
null,null,null,
}; };
[Test] [Test]
@@ -90,21 +83,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
System.Console.WriteLine("{0}", partitions[j].PartitionType); if(partitions[j].PartitionType == "0x2D")
if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"")
{ {
part = j; part = j;
break; break;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS_MBR.cs // Filename : AFFS_MBR_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -44,11 +44,12 @@ using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins; using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins; using DiscImageChef.PartPlugins;
using NUnit.Framework; using NUnit.Framework;
using System;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS_MBR public class AFFS_MBR_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"aros.vdi.lz","aros_intl.vdi.lz", "aros.vdi.lz","aros_intl.vdi.lz",
@@ -81,9 +82,10 @@ namespace DiscImageChef.Tests.Filesystems
[Test] [Test]
public void Test() public void Test()
{ {
for(int i = 0; i < testfiles.Length; i++) 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", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -110,7 +112,7 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }*/
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : SFS_RDB.cs // Filename : AFFS_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,38 +48,41 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class SFS_RDB public class AFFS_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"uae.vdi.lz", "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 = { readonly ulong[] sectors = {
1024128, 1024128,1024128,409600,409600,
1024128,1024128,1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512,512,512,512,
512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
127000, 1020064,1020064,407232,407232,
1020064,1020064,1020064,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 512,512,512,512,
512,512,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, "Volume label","Volume label","Volume label","Volume label",
"Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null,null,null,null,
}; null,null,null,
readonly string[] oemid = {
null,
}; };
[Test] [Test]
@@ -87,7 +90,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -96,12 +99,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.SFS(); Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) 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\"")
if(partitions[j].PartitionType == "\"SFS\\0\"")
{ {
part = j; part = j;
break; break;
@@ -112,10 +114,9 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS.cs // Filename : AOFS.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -45,7 +45,7 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS public class AOFS
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz", "amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz",
@@ -84,7 +84,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new ZZZRawImage(); ImagePlugin image = new ZZZRawImage();
@@ -97,7 +97,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS_RDB.cs // Filename : AOFS_MBR.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,41 +48,34 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS_RDB public class AOFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_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 = { readonly ulong[] sectors = {
1024128,1024128,409600,409600, 409600,409600,
1024128,1024128,1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512,512,512, 512,512,
512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1020064,1020064,407232,407232, 408240,408240,
1020064,1020064,1020064,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512,512,512,512, 512,512,
512,512,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label","Volume label", "Volume label","Volume label",
"Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null,null,null, null,null,
null,null,null,
}; };
[Test] [Test]
@@ -90,21 +83,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
System.Console.WriteLine("{0}", partitions[j].PartitionType); if(partitions[j].PartitionType == "0x2C")
if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"")
{ {
part = j; part = j;
break; break;
@@ -115,7 +107,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AOFS_MBR.cs // Filename : AOFS_MBR_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -35,6 +35,7 @@
// Copyright (C) 2011-2015 Claunia.com // Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/ // ****************************************************************************/
// //$Id$ // //$Id$
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
@@ -48,7 +49,7 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AOFS_MBR public class AOFS_MBR_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"aros.vdi.lz","aros_intl.vdi.lz", "aros.vdi.lz","aros_intl.vdi.lz",
@@ -81,7 +82,8 @@ namespace DiscImageChef.Tests.Filesystems
[Test] [Test]
public void Test() public void Test()
{ {
for(int i = 0; i < testfiles.Length; i++) 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", "aofs_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
@@ -110,7 +112,7 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }*/
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : SFS_RDB.cs // Filename : AOFS_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,38 +48,34 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class SFS_RDB public class AOFS_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"uae.vdi.lz", "amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_intl.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1024128, 1024128,1024128,409600,409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512,512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
127000, 1020064,1020064,407232,407232,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 512,512,512,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, "Volume label","Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null,null,null,null,
};
readonly string[] oemid = {
null,
}; };
[Test] [Test]
@@ -87,7 +83,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "aofs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -96,12 +92,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.SFS(); Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
System.Console.WriteLine("{0}", partitions[j].PartitionType); if(partitions[j].PartitionType == "\"DOS\\0\"" || partitions[j].PartitionType == "\"DOS\\2\"" || partitions[j].PartitionType == "\"DOS\\4\"")
if(partitions[j].PartitionType == "\"SFS\\0\"")
{ {
part = j; part = j;
break; break;
@@ -112,10 +107,9 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga OFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : BeFS_APM.cs // Filename : BeFS_GPT.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,59 +48,55 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class BeFS_APM public class BeFS_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "haiku_hrev51259.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1572864, 1572864, 8388608,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
786400, 785232, 2096640,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024, 2048
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null, null,null,
}; };
readonly string[] oemid = {
null,null,
};
[Test] [Test]
public void Test() public void Test()
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_apm", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_gpt", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AppleMap(); PartPlugin parts = new GuidPartitionTable();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BeFS(); Filesystem fs = new DiscImageChef.Filesystems.BeFS();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "Be_BFS") if(partitions[j].PartitionType == "Haiku BFS")
{ {
part = j; part = j;
break; break;
@@ -114,7 +110,6 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -51,35 +51,35 @@ namespace DiscImageChef.Tests.Filesystems
public class BeFS_MBR public class BeFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz", "haiku_hrev51259.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1572864, 1572864, 1572864, 1572864,8388608,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
786400, 785232, 786400, 785232, 2096640,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024, 1024, 1024, 2048,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label", "Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null, null,null,null,
}; };
readonly string[] oemid = { readonly string[] oemid = {
null,null, null,null,null,
}; };
[Test] [Test]

View File

@@ -235,6 +235,22 @@ namespace DiscImageChef.Tests.Filesystems
"winvista_dsdd.img.lz","winvista_dshd.img.lz","winvista_mf2dd.img.lz","winvista_mf2ed.img.lz","winvista_mf2hd.img.lz", "winvista_dsdd.img.lz","winvista_dshd.img.lz","winvista_mf2dd.img.lz","winvista_mf2ed.img.lz","winvista_mf2hd.img.lz",
// BeOS R4.5 // BeOS R4.5
"beos_r4.5_mf2hd.img.lz", "beos_r4.5_mf2hd.img.lz",
// Hatari
"hatari_mf1dd.st.lz","hatari_mf1dd_10.st.lz","hatari_mf1dd_11.st.lz",
"hatari_mf2dd.st.lz","hatari_mf2dd_10.st.lz","hatari_mf2dd_11.st.lz",
"hatari_mf2ed.st.lz","hatari_mf2hd.st.lz",
// Atari TOS 1.04
"tos_1.04_mf1dd.st.lz","tos_1.04_mf2dd.st.lz",
// NetBSD 1.6
"netbsd_1.6_mf2dd.img.lz","netbsd_1.6_mf2hd.img.lz",
// NeXTStep 3.3
"nextstep_3.3_mf2dd.img.lz","nextstep_3.3_mf2hd.img.lz",
// OpenStep for Mach 4.0
"openstep_4.0_mf2dd.img.lz","openstep_4.0_mf2hd.img.lz",
// OpenStep for Mach 4.2
"openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.lz",
// Solaris 2.4
"solaris_2.4_mf2dd.img.lz","solaris_2.4_mf2hd.img.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
@@ -419,6 +435,23 @@ namespace DiscImageChef.Tests.Filesystems
MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD, MediaType.DOS_525_DS_DD_9,MediaType.DOS_525_HD,MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_ED,MediaType.DOS_35_HD,
// BeOS R4.5 // BeOS R4.5
MediaType.DOS_35_HD, MediaType.DOS_35_HD,
// Hatari
// TODO: Incorrect media types
MediaType.DOS_35_SS_DD_9,MediaType.GENERIC_HDD,MediaType.GENERIC_HDD,
MediaType.DOS_35_DS_DD_9,MediaType.ATARI_35_DS_DD,MediaType.GENERIC_HDD,
MediaType.DOS_35_ED,MediaType.DOS_35_HD,
// Atari TOS 1.04
MediaType.DOS_35_SS_DD_9,MediaType.DOS_35_DS_DD_9,
// NetBSD 1.6
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// NeXTStep 3.3
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// OpenStep for Mach 4.0
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// OpenStep for Mach 4.2
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
// Solaris 2.4
MediaType.DOS_35_DS_DD_9,MediaType.DOS_35_HD,
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
@@ -564,6 +597,20 @@ namespace DiscImageChef.Tests.Filesystems
720,2400,1440,5760,2880, 720,2400,1440,5760,2880,
// BeOS R4.5 // BeOS R4.5
2880, 2880,
// Hatari
720,800,880,1440,1600,1760,5760,2880,
// Atari TOS 1.04
720,1440,
// NetBSD 1.6
1440,2880,
// NeXTStep 3.3
1440,2880,
// OpenStep for Mach 4.0
1440,2880,
// OpenStep for Mach 4.2
1440,2880,
// Solaris 2.4
1440,2880,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -709,6 +756,20 @@ namespace DiscImageChef.Tests.Filesystems
512,512,512,512,512, 512,512,512,512,512,
// BeOS R4.5 // BeOS R4.5
512, 512,
// Hatari
512,512,512,512,512,512,512,512,
// Atari TOS 1.04
512,512,
// NetBSD 1.6
512,512,
// NeXTStep 3.3
512,512,
// OpenStep for Mach 4.0
512,512,
// OpenStep for Mach 4.2
512,512,
// Solaris 2.4
512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
@@ -854,6 +915,20 @@ namespace DiscImageChef.Tests.Filesystems
360,2400,720,2880,2880, 360,2400,720,2880,2880,
// BeOS R4.5 // BeOS R4.5
2880, 2880,
// Hatari
360,400,440,720,800,880,2880,1440,
// Atari TOS 1.04
360,720,
// NetBSD 1.6
720,2880,
// NeXTStep 3.3
720,2880,
// OpenStep for Mach 4.0
720,2880,
// OpenStep for Mach 4.2
720,2880,
// Solaris 2.4
720,2880,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -999,6 +1074,20 @@ namespace DiscImageChef.Tests.Filesystems
1024,512,1024,1024,512, 1024,512,1024,1024,512,
// BeOS R4.5 // BeOS R4.5
512, 512,
// Hatari
1024,1024,1024,1024,1024,1024,1024,1024,
// Atari TOS 1.04
1024,1024,
// NetBSD 1.6
1024,512,
// NeXTStep 3.3
1024,512,
// OpenStep for Mach 4.0
1024,512,
// OpenStep for Mach 4.2
1024,512,
// Solaris 2.4
1024,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -1151,6 +1240,22 @@ namespace DiscImageChef.Tests.Filesystems
"NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ", "NO NAME ","NO NAME ","NO NAME ","NO NAME ","NO NAME ",
// BeOS R4.5 // BeOS R4.5
"NO NAME ", "NO NAME ",
// Hatari
null,null,null,
null,null,null,
null,null,
// Atari TOS 1.04
null,null,
// NetBSD 1.6
"VOLUMELABEL","VOLUMELABEL",
// NeXTStep 3.3
null,null,
// OpenStep for Mach 4.0
null,null,
// OpenStep for Mach 4.2
null,null,
// Solaris 2.4
null,null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
@@ -1303,6 +1408,22 @@ namespace DiscImageChef.Tests.Filesystems
"3C9F0BD2","3A8E465C","B2EFB822","3C30C632","16DAB07A", "3C9F0BD2","3A8E465C","B2EFB822","3C30C632","16DAB07A",
// BeOS R4.5 // BeOS R4.5
"00000000", "00000000",
// Hatari
null,null,null,
null,null,null,
null,null,
// Atari TOS 1.04
null,null,
// NetBSD 1.6
"EEB51A0C","CCFD1A06",
// NeXTStep 3.3
null,null,
// OpenStep for Mach 4.0
null,null,
// OpenStep for Mach 4.2
null,null,
// Solaris 2.4
null,null,
}; };
readonly string[] oemid = { readonly string[] oemid = {
@@ -1455,6 +1576,22 @@ namespace DiscImageChef.Tests.Filesystems
"MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0", "MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0","MSDOS5.0",
// BeOS R4.5 // BeOS R4.5
"BeOS ", "BeOS ",
// Hatari
null,null,null,
null,null,null,
null,null,
// Atari TOS 1.04
null,null,
// NetBSD 1.6
"BSD 4.4","BSD 4.4",
// NeXTStep 3.3
"NEXT ","NEXT ",
// OpenStep for Mach 4.0
"NEXT ","NEXT ",
// OpenStep for Mach 4.2
"NEXT ","NEXT ",
// Solaris 2.4
"MSDOS3.3","MSDOS3.3",
}; };
[Test] [Test]

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class FAT12_APM public class FAT12_APM
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class FAT12_GPT public class FAT12_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -61,11 +61,12 @@ namespace DiscImageChef.Tests.Filesystems
"pcdos610.vdi.lz", "pcdos630.vdi.lz", "toshibamsdos330.vdi.lz", "toshibamsdos401.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz", "toshibamsdos330.vdi.lz", "toshibamsdos401.vdi.lz",
"msos2_1.21.vdi.lz", "msos2_1.30.1.vdi.lz", "multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz", "msos2_1.21.vdi.lz", "msos2_1.30.1.vdi.lz", "multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz",
"os2_1.30.vdi.lz", "os2_6.307.vdi.lz", "os2_6.514.vdi.lz", "os2_6.617.vdi.lz", "os2_1.30.vdi.lz", "os2_6.307.vdi.lz", "os2_6.514.vdi.lz", "os2_6.617.vdi.lz",
"os2_8.162.vdi.lz", "os2_9.023.vdi.lz", "ecs.vdi.lz", "macosx.vdi.lz", "os2_8.162.vdi.lz", "os2_9.023.vdi.lz", "ecs.vdi.lz", "macosx_10.11.vdi.lz",
"win10.vdi.lz", "win2000.vdi.lz","win95.vdi.lz","win95osr2.1.vdi.lz", "win10.vdi.lz", "win2000.vdi.lz","win95.vdi.lz","win95osr2.1.vdi.lz",
"win95osr2.5.vdi.lz","win95osr2.vdi.lz","win98.vdi.lz","win98se.vdi.lz", "win95osr2.5.vdi.lz","win95osr2.vdi.lz","win98.vdi.lz","win98se.vdi.lz",
"winme.vdi.lz","winnt_3.10.vdi.lz","winnt_3.50.vdi.lz","winnt_3.51.vdi.lz", "winme.vdi.lz","winnt_3.10.vdi.lz","winnt_3.50.vdi.lz","winnt_3.51.vdi.lz",
"winnt_4.00.vdi.lz","winvista.vdi.lz","beos_r4.5.vdi.lz","linux.vdi.lz", "winnt_4.00.vdi.lz","winvista.vdi.lz","beos_r4.5.vdi.lz","linux.vdi.lz",
"freebsd_6.1.vdi.lz","freebsd_7.0.vdi.lz","freebsd_8.2.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
@@ -84,6 +85,7 @@ namespace DiscImageChef.Tests.Filesystems
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 16384, 16384, 16384, 16384, 16384, 16384,
16384, 16384, 16384,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -102,6 +104,7 @@ namespace DiscImageChef.Tests.Filesystems
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
@@ -120,6 +123,7 @@ namespace DiscImageChef.Tests.Filesystems
2008, 2008, 2044, 2044, 2008, 2008, 2044, 2044,
2044, 4016, 2044, 2044, 2044, 4016, 2044, 2044,
4016, 3072, 2040, 3584, 4016, 3072, 2040, 3584,
2044, 2044, 2044,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -138,6 +142,7 @@ namespace DiscImageChef.Tests.Filesystems
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 2048, 4096, 4096, 4096, 2048, 4096, 4096,
2048, 2048, 4096, 2048, 2048, 2048, 4096, 2048,
4096, 4096, 4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -156,6 +161,7 @@ namespace DiscImageChef.Tests.Filesystems
"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",
"VOLUMELABEL","NO NAME ","NO NAME ","NO NAME ", "VOLUMELABEL","NO NAME ","NO NAME ","NO NAME ",
"NO NAME ","NO NAME ","NO NAME ","VolumeLabel", "NO NAME ","NO NAME ","NO NAME ","VolumeLabel",
"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
@@ -174,6 +180,7 @@ namespace DiscImageChef.Tests.Filesystems
"074C0DFC","33640D18","0E121460","094C0EED", "074C0DFC","33640D18","0E121460","094C0EED",
"38310F02","50489A1B","2CE52101","94313E7E", "38310F02","50489A1B","2CE52101","94313E7E",
"BC184FE6","BAD08A1E","00000000","8D418102", "BC184FE6","BAD08A1E","00000000","8D418102",
"8FC80E0A","34FA0E0B","02140E0B",
}; };
readonly string[] oemid = { readonly string[] oemid = {
@@ -192,6 +199,7 @@ namespace DiscImageChef.Tests.Filesystems
"MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1",
"MSWIN4.1", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0",
"MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat", "MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat",
"BSD 4.4", "BSD 4.4", "BSD4.4 ",
}; };
[Test] [Test]

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : FAT16_APM.cs // Filename : FAT16_Atari.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,38 +48,38 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class FAT16_APM public class FAT16_Atari
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "tos_1.04.vdi.lz","tos_1.04_small.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1024000, 16384, 81920,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
63995, 16382, 81918,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
8192, 512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"VOLUMELABEL", null, null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"063D1F09", null, null,
}; };
readonly string[] oemid = { readonly string[] oemid = {
"BSD 4.4", null, null,
}; };
[Test] [Test]
@@ -87,20 +87,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_apm", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_atari", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AppleMap(); PartPlugin parts = new AtariPartitions();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FAT(); Filesystem fs = new DiscImageChef.Filesystems.FAT();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "DOS_FAT_16") if(partitions[j].PartitionType == "GEM" || partitions[j].PartitionType == "BGM")
{ {
part = j; part = j;
break; break;

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class FAT16_GPT public class FAT16_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -59,11 +59,14 @@ namespace DiscImageChef.Tests.Filesystems
"pcdos500.vdi.lz", "pcdos502.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz", "pcdos500.vdi.lz", "pcdos502.vdi.lz", "pcdos610.vdi.lz", "pcdos630.vdi.lz",
"msos2_1.21.vdi.lz", "msos2_1.30.1.vdi.lz", "multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz", "msos2_1.21.vdi.lz", "msos2_1.30.1.vdi.lz", "multiuserdos_7.22r4.vdi.lz", "os2_1.20.vdi.lz",
"os2_1.30.vdi.lz", "os2_6.307.vdi.lz", "os2_6.514.vdi.lz", "os2_6.617.vdi.lz", "os2_1.30.vdi.lz", "os2_6.307.vdi.lz", "os2_6.514.vdi.lz", "os2_6.617.vdi.lz",
"os2_8.162.vdi.lz", "os2_9.023.vdi.lz", "ecs.vdi.lz", "macosx.vdi.lz", "os2_8.162.vdi.lz", "os2_9.023.vdi.lz", "ecs.vdi.lz", "macosx_10.11.vdi.lz",
"win10.vdi.lz", "win2000.vdi.lz", "win95osr2.1.vdi.lz", "win95osr2.5.vdi.lz", "win10.vdi.lz", "win2000.vdi.lz", "win95osr2.1.vdi.lz", "win95osr2.5.vdi.lz",
"win95osr2.vdi.lz", "win95.vdi.lz", "win98se.vdi.lz", "win98.vdi.lz", "win95osr2.vdi.lz", "win95.vdi.lz", "win98se.vdi.lz", "win98.vdi.lz",
"winme.vdi.lz", "winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", "winnt_3.51.vdi.lz", "winme.vdi.lz", "winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", "winnt_3.51.vdi.lz",
"winnt_4.00.vdi.lz", "winvista.vdi.lz", "beos_r4.5.vdi.lz", "linux.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz", "beos_r4.5.vdi.lz", "linux.vdi.lz",
"amigaos_3.9.vdi.lz","aros.vdi.lz","freebsd_6.1.vdi.lz","freebsd_7.0.vdi.lz",
"freebsd_8.2.vdi.lz","macos_7.5.3.vdi.lz","macos_7.5.vdi.lz","macos_7.6.vdi.lz",
"macos_8.0.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
@@ -80,6 +83,9 @@ namespace DiscImageChef.Tests.Filesystems
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 262144, 1024000, 1024000, 1024000, 262144,
1024128, 1024000, 1024000, 1024000,
1024000, 1024000, 1024000, 1024000,
1024000,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -96,6 +102,9 @@ namespace DiscImageChef.Tests.Filesystems
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
@@ -112,6 +121,9 @@ namespace DiscImageChef.Tests.Filesystems
63941, 63941, 63998, 63998, 63941, 63941, 63998, 63998,
63998, 63941, 63998, 63998, 63998, 63941, 63998, 63998,
63941, 63616, 63996, 65024, 63941, 63616, 63996, 65024,
63941, 63882, 63998, 63998,
31999, 63941, 63941, 63941,
63941,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -128,6 +140,9 @@ namespace DiscImageChef.Tests.Filesystems
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 8192, 8192, 8192, 8192, 8192, 8192,
8192, 8192, 8192, 2048, 8192, 8192, 8192, 2048,
8192, 8192, 8192, 8192,
16384, 8192, 8192, 8192,
8192,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -144,6 +159,9 @@ namespace DiscImageChef.Tests.Filesystems
"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL", "VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",
"VOLUMELABEL","NO NAME ","NO NAME ","NO NAME ", "VOLUMELABEL","NO NAME ","NO NAME ","NO NAME ",
"NO NAME ","NO NAME ","NO NAME ","VolumeLabel", "NO NAME ","NO NAME ","NO NAME ","VolumeLabel",
"EMPTY ","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",
"VOLUMELABEL","VOLUMELABEL","VOLUMELABEL","VOLUMELABEL",
"VOLUMELABEL",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
@@ -160,6 +178,9 @@ namespace DiscImageChef.Tests.Filesystems
"38270D18","2E620D0C","0B4F0EED","0E122464", "38270D18","2E620D0C","0B4F0EED","0E122464",
"3B5F0F02","C84CB6F2","D0E9AD4E","C039A2EC", "3B5F0F02","C84CB6F2","D0E9AD4E","C039A2EC",
"501F9FA6","9AAA4216","00000000","A132D985", "501F9FA6","9AAA4216","00000000","A132D985",
"374D3BD1","52BEA34A","3CF10E0D","C6C30E0D",
"44770E0D","27761816","27761816","27761816",
"27761816",
}; };
readonly string[] oemid = { readonly string[] oemid = {
@@ -176,6 +197,9 @@ namespace DiscImageChef.Tests.Filesystems
"MSWIN4.1", "MSWIN4.0", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.0", "MSWIN4.1", "MSWIN4.1",
"MSWIN4.1", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "MSDOS5.0", "MSDOS5.0", "MSDOS5.0",
"MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat", "MSDOS5.0", "MSDOS5.0", "BeOS ", "mkfs.fat",
"CDP 5.0", "MSWIN4.1", "BSD 4.4", "BSD 4.4",
"BSD4.4 ", "PCX 2.0 ", "PCX 2.0 ", "PCX 2.0 ",
"PCX 2.0 ",
}; };
[Test] [Test]

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS_RDB.cs // Filename : FAT16_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -35,6 +35,7 @@
// Copyright (C) 2011-2015 Claunia.com // Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/ // ****************************************************************************/
// //$Id$ // //$Id$
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
@@ -48,49 +49,48 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS_RDB public class FAT16_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amigaos_3.9.vdi.lz","amigaos_3.9_intl.vdi.lz","aros.vdi.lz","aros_intl.vdi.lz", "amigaos_3.9.vdi.lz",
"amigaos_4.0.vdi.lz","amigaos_4.0_intl.vdi.lz","amigaos_4.0_cache.vdi.lz"
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1024128,1024128,409600,409600, 1024128
1024128,1024128,1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512,512,512, 512,
512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1020064,1020064,407232,407232, 1020064
1020064,1020064,1020064,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512,512,512,512, 512,
512,512,512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label","Volume label", "VOLUMELABEL"
"Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null,null,null, "UNKNOWN ",
null,null,null, };
readonly string[] oemid = {
"CDP 5.0",
}; };
[Test] [Test]
public void 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++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -99,11 +99,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.FAT();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "\"DOS\\1\"" || partitions[j].PartitionType == "\"DOS\\3\"" || partitions[j].PartitionType == "\"DOS\\5\"") if(partitions[j].PartitionType == "\"RES\\86\"")
{ {
part = j; part = j;
break; break;
@@ -117,7 +117,8 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}*/
} }
} }
} }

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class FAT32_APM public class FAT32_APM
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class FAT32_GPT public class FAT32_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,59 +51,67 @@ namespace DiscImageChef.Tests.Filesystems
public class FAT32_MBR public class FAT32_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"drdos_7.03.vdi.lz", "drdos_8.00.vdi.lz", "msdos_7.10.vdi.lz", "macosx.vdi.lz", "drdos_7.03.vdi.lz", "drdos_8.00.vdi.lz", "msdos_7.10.vdi.lz", "macosx_10.11.vdi.lz",
"win10.vdi.lz", "win2000.vdi.lz", "win95osr2.1.vdi.lz", "win95osr2.5.vdi.lz", "win10.vdi.lz", "win2000.vdi.lz", "win95osr2.1.vdi.lz", "win95osr2.5.vdi.lz",
"win95osr2.vdi.lz", "win98se.vdi.lz", "win98.vdi.lz", "winme.vdi.lz", "win95osr2.vdi.lz", "win98se.vdi.lz", "win98.vdi.lz", "winme.vdi.lz",
"winvista.vdi.lz", "beos_r4.5.vdi.lz", "linux.vdi.lz", "winvista.vdi.lz", "beos_r4.5.vdi.lz", "linux.vdi.lz","aros.vdi.lz",
"freebsd_6.1.vdi.lz","freebsd_7.0.vdi.lz","freebsd_8.2.vdi.lz","freedos_1.2.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
8388608, 8388608, 8388608, 4194304, 8388608, 8388608, 8388608, 4194304,
4194304, 8388608, 4194304, 4194304, 4194304, 8388608, 4194304, 4194304,
4194304, 4194304, 4194304, 4194304, 4194304, 4194304, 4194304, 4194304,
4194304, 4194304, 262144, 4194304, 4194304, 262144, 4194304,
4194304, 4194304, 4194304, 8388608,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1048233, 1048233, 1048233, 524287, 1048233, 1048233, 1048233, 524287,
524016, 1048233, 524152, 524152, 524016, 1048233, 524152, 524152,
524152, 524112, 524112, 524112, 524152, 524112, 524112, 524112,
523520, 1048560, 260096, 523520, 1048560, 260096, 524160,
524112, 524112, 65514, 1048233,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 2048, 512 4096, 2048, 512, 4096,
4096, 4096, 32768, 4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null,null,null,null, null,null,null,null,
null,null,null,null, null,null,null,null,
null,null,null,null, null,null,null,null,
null,null,null, null,null,null,null,
null,null,null,null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"5955996C","1BFB1A43","3B331809","42D51EF1", "5955996C","1BFB1A43","3B331809","42D51EF1",
"48073346","EC62E6DE","2A310DE4","0C140DFC", "48073346","EC62E6DE","2A310DE4","0C140DFC",
"3E310D18","0D3D0EED","0E131162","3F500F02", "3E310D18","0D3D0EED","0E131162","3F500F02",
"82EB4C04","00000000","B488C502" "82EB4C04","00000000","B488C502","5CAC9B4E",
"41540E0E","4E600E0F","26E20E0F","3E0C1BE8",
}; };
readonly string[] oemid = { readonly string[] oemid = {
"DRDOS7.X", "IBM 7.1", "MSWIN4.1", "BSD 4.4", "DRDOS7.X", "IBM 7.1", "MSWIN4.1", "BSD 4.4",
"MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "MSWIN4.1", "MSDOS5.0", "MSDOS5.0", "MSWIN4.1", "MSWIN4.1",
"MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1", "MSWIN4.1",
"MSDOS5.0", "BeOS ", "mkfs.fat", "MSDOS5.0", "BeOS ", "mkfs.fat", "MSWIN4.1",
"BSD 4.4", "BSD 4.4", "BSD4.4 ", "FRDOS4.1",
}; };
[Test] [Test]

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HFSX_MBR.cs // Filename : HAMMER_MBR.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -35,6 +35,7 @@
// Copyright (C) 2011-2015 Claunia.com // Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/ // ****************************************************************************/
// //$Id$ // //$Id$
using System;
using System.Collections.Generic; using System.Collections.Generic;
using System.IO; using System.IO;
using DiscImageChef.CommonTypes; using DiscImageChef.CommonTypes;
@@ -48,46 +49,44 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HFSX_MBR public class HAMMER_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz", "dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
393216, 409600, 262144, 262144, 104857600, 104857600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
102390, 153590, 32512, 32512, 104856192, 104856192,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 4096, 4096, 4096 512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN","0000000000000000","0000000000000000" "UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ","10.0","10.0"
}; };
[Test] [Test]
public void Test() public void Test()
{ {
throw new NotImplementedException("HAMMER filesystem is not yet implemented");
/*
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -96,11 +95,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus(); Filesystem fs = new DiscImageChef.Filesystems.HAMMER();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0xAF") if(partitions[j].PartitionType == "0xA5")
{ {
part = j; part = j;
break; break;
@@ -111,11 +110,10 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]); }*/
}
} }
} }
} }

File diff suppressed because it is too large Load Diff

View File

@@ -51,35 +51,75 @@ namespace DiscImageChef.Tests.Filesystems
public class HFSPlus_APM public class HFSPlus_APM
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz", "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz","darwin_1.3.1.vdi.lz","darwin_1.3.1_wrapped.vdi.lz",
"darwin_1.4.1.vdi.lz","darwin_1.4.1_wrapped.vdi.lz","darwin_6.0.2.vdi.lz","darwin_6.0.2_wrapped.vdi.lz",
"darwin_8.0.1_journal.vdi.lz","darwin_8.0.1.vdi.lz","darwin_8.0.1_wrapped.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_journal.vdi.lz","macosx_10.3.vdi.lz","macosx_10.4_journal.vdi.lz",
"macosx_10.4.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
409600, 614400, 409600, 614400, 819200, 614400,
819200, 614400, 819200, 614400,
1228800, 819200, 614400, 4194304,
4194304, 4194304,4194304,4194304,
4194304, 2097152, 4194304, 2097152,
4194304
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
51190, 76790, 51190, 76790, 51190, 76790,
51190, 76790, 51190, 76790,
51190, 76790, 51190, 76790,
51190, 76790, 51190, 76790,
51190, 76790, 51190, 76790,
51190,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096,
4096,
}; };
readonly string[] volumename = { 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",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"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[] oemid = { readonly string[] oemid = {
"10.0","HFSJ" "10.0","HFSJ","10.0","HFSJ",
"10.0","HFSJ","10.0","HFSJ",
"10.0","HFSJ","10.0","HFSJ",
"10.0","HFSJ","10.0","HFSJ",
"10.0","HFSJ","10.0","HFSJ",
"10.0",
}; };
[Test] [Test]

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class HFSPlus_GPT public class HFSPlus_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz", "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,35 +51,59 @@ namespace DiscImageChef.Tests.Filesystems
public class HFSPlus_MBR public class HFSPlus_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz", "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
"darwin_1.3.1.vdi.lz","darwin_1.3.1_wrapped.vdi.lz","darwin_1.4.1.vdi.lz","darwin_1.4.1_wrapped.vdi.lz",
"darwin_6.0.2.vdi.lz","darwin_6.0.2_wrapped.vdi.lz","darwin_8.0.1_journal.vdi.lz","darwin_8.0.1.vdi.lz",
"darwin_8.0.1_wrapped.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
303104, 352256, 262144, 262144, 303104, 352256, 262144, 262144,
303104, 352256, 262144, 262144,
303104, 352256, 262144, 262144,
303104,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
37878, 44021, 32512, 32512, 37878, 44021, 32512, 32512,
37878, 44021, 32512, 32512,
37878, 44021, 32512, 32512,
37878,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 4096, 4096, 4096, 4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096,
4096, 4096, 4096, 4096,
4096,
}; };
readonly string[] volumename = { 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",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN","0000000000000000","0000000000000000", "UNKNOWN","UNKNOWN","0000000000000000","0000000000000000",
"UNKNOWN","UNKNOWN","0000000000000000","0000000000000000",
"UNKNOWN","UNKNOWN","0000000000000000","0000000000000000",
"UNKNOWN",
}; };
readonly string[] oemid = { readonly string[] oemid = {
"10.0","HFSJ","10.0","10.0", "10.0","HFSJ","10.0","10.0",
"10.0","HFSJ","10.0","10.0",
"10.0","HFSJ","10.0","10.0",
"10.0",
}; };
[Test] [Test]

View File

@@ -51,35 +51,43 @@ namespace DiscImageChef.Tests.Filesystems
public class HFSX_APM public class HFSX_APM
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz", "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz","darwin_8.0.1_journal.vdi.lz","darwin_8.0.1.vdi.lz",
"macosx_10.4_journal.vdi.lz","macosx_10.4.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
819200, 1228800, 819200, 1228800,
819200, 1228800, 819200, 1228800,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512 512, 512, 512, 512,
512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
102390, 153590,102390, 153590,
102390, 153590, 102390, 153590,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 4096,4096, 4096,
4096, 4096, 4096, 4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label","Volume label",
"Volume label","Volume label", "Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN","UNKNOWN","UNKNOWN",
"UNKNOWN","UNKNOWN", "UNKNOWN","UNKNOWN",
}; };
readonly string[] oemid = { readonly string[] oemid = {
"10.0","HFSJ" "10.0","HFSJ","10.0","HFSJ",
"10.0","HFSJ",
}; };
[Test] [Test]

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class HFSX_GPT public class HFSX_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz", "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,35 +51,43 @@ namespace DiscImageChef.Tests.Filesystems
public class HFSX_MBR public class HFSX_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz", "macosx_10.11.vdi.lz", "macosx_10.11_journal.vdi.lz", "linux.vdi.lz", "linux_journal.vdi.lz",
"darwin_8.0.1_journal.vdi.lz","darwin_8.0.1.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
393216, 409600, 262144, 262144, 393216, 409600, 262144, 262144,
262144, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512, 512,
512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
102390, 153590, 32512, 32512, 102390, 153590, 32512, 32512,
32512, 32512,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 4096, 4096, 4096 4096, 4096, 4096, 4096,
4096, 4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN","0000000000000000","0000000000000000" "UNKNOWN","UNKNOWN","0000000000000000","0000000000000000",
"UNKNOWN","UNKNOWN",
}; };
readonly string[] oemid = { readonly string[] oemid = {
"10.0","HFSJ","10.0","10.0" "10.0","HFSJ","10.0","10.0",
"10.0","10.0",
}; };
[Test] [Test]

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HFS_MBR.cs // Filename : HFS_APM.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,34 +48,69 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HFS_MBR public class HFS_APM
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux.vdi.lz", "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 = { readonly ulong[] sectors = {
262144, 1024128,409600,409600,409600,
409600,41820,41820,81648,
1024000,1024000,1024000,1024000,
1024000,1024000,1024000,1024000,
1024000,1024000,1024000,1024000,
409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512,512,512,
512,512,512,512,
512,512,512,512,
512,512,512,512,
512,512,512,512,
512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65018, 64003,51189,51189,58502,
58502,39991,39991,39991,
63954,63990,63954,63954,
63954,63922,63922,63922,
63922,63884,63883,63883,
58506,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 8192,4096,4096,3584,
3584,1024,1024,1024,
8192,8192,8192,8192,
8192,8192,8192,8192,
8192,8192,8192,8192,
3584,
}; };
readonly string[] volumename = { 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"
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"0000000000000000", null,null,null,null,
"AAFE1382AF5AA898",null,null,null,
null,null,null,null,
null,null,null,null,
null,"5A7C38B0CAF279C4","FB49083EBD150509","632C0B1DB46FD188",
null,
}; };
[Test] [Test]
@@ -83,20 +118,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_apm", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new AppleMap();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); Filesystem fs = new DiscImageChef.Filesystems.AppleHFS();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0xAF") if(partitions[j].PartitionType == "Apple_HFS")
{ {
part = j; part = j;
break; break;

View File

@@ -52,30 +52,37 @@ namespace DiscImageChef.Tests.Filesystems
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux.vdi.lz", "linux.vdi.lz",
"darwin_1.3.1.vdi.lz","darwin_1.4.1.vdi.lz","darwin_6.0.2.vdi.lz","darwin_8.0.1.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144, 262144,
409600,409600,409600,409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512,
512,512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65018, 65018,
51145,51145,58452,58502,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 2048,
4096,4096,3584,3584,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label",
"Volume label","Volume label","Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"0000000000000000", null,
null,null,null,"81FE805D61458753",
}; };
[Test] [Test]
@@ -83,7 +90,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : FAT16_RDB.cs // Filename : HFS_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -49,7 +49,7 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class FAT16_RDB public class HFS_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amigaos_3.9.vdi.lz", "amigaos_3.9.vdi.lz",
@@ -72,15 +72,11 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly string[] volumename = { readonly string[] volumename = {
"VOLUMELABEL" "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN ", null,
};
readonly string[] oemid = {
"CDP 5.0",
}; };
[Test] [Test]
@@ -90,7 +86,7 @@ namespace DiscImageChef.Tests.Filesystems
/* /*
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HAMMER_MBR.cs // Filename : LFS_MBR.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -49,40 +49,40 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HAMMER_MBR public class LFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz", "netbsd_1.6.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
104857600, 104857600, 409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
104856192, 104856192, 409600
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN", null,
}; };
[Test] [Test]
public void Test() public void Test()
{ {
throw new NotImplementedException("HAMMER filesystem is not yet implemented"); throw new NotImplementedException("LFS filesystem is not yet implemented");
/* /*
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
@@ -95,11 +95,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); Filesystem fs = new DiscImageChef.Filesystems.LFS();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0xA5") if(partitions[j].PartitionType == "0xA9")
{ {
part = j; part = j;
break; break;
@@ -110,7 +110,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("LFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}*/ }*/

View File

@@ -87,6 +87,8 @@ namespace DiscImageChef.Tests.Filesystems
[Test] [Test]
public void Test() public void Test()
{ {
throw new NotImplementedException("Locus filesystem is not yet implemented");
/*
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "locus", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "locus", testfiles[i]);
@@ -97,8 +99,6 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
throw new NotImplementedException("Locus filesystem is not yet implemented");
/*
Filesystem fs = new DiscImageChef.Filesystems.Locus(); Filesystem fs = new DiscImageChef.Filesystems.Locus();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
@@ -107,8 +107,8 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("Locus", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("Locus", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);*/ Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }*/
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HFS.cs // Filename : MFS.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -45,21 +45,21 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HFS public class MFS
{ {
readonly string[] testfiles = { 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", "macos_0.1_mf1dd.img.lz","macos_0.5_mf1dd.img.lz","macos_1.1_mf1dd.img.lz","macos_2.0_mf1dd.img.lz",
"openstep_4.0_mf2hd.img.lz","openstep_4.2_mf2hd.img.lz","rhapsody_dr1_mf2hd.img.lz", "macos_6.0.7_mf1dd.img.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.AppleSonyDS, MediaType.DOS_35_HD, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS,
MediaType.DOS_35_HD, MediaType.DOS_35_HD, MediaType.DOS_35_HD, MediaType.AppleSonySS
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1600, 1600, 1600, 2880, 800, 800, 800, 800,
2880, 2880, 2880, 800,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -68,18 +68,18 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
1594, 1594, 1594, 2874, 391, 391, 391, 391,
2874, 2874, 2874, 391,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 512, 512, 1024, 1024, 1024, 1024,
512, 512, 512, 1024,
}; };
readonly string[] volumename = { 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",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
@@ -92,7 +92,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "mfs", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new ZZZRawImage(); ImagePlugin image = new ZZZRawImage();
@@ -100,12 +100,12 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
Filesystem fs = new AppleHFS(); Filesystem fs = new DiscImageChef.Filesystems.AppleMFS.AppleMFS();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("MFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : NTFS_MBR.cs // Filename : NTFS_GPT.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,32 +48,27 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class NTFS_MBR public class NTFS_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"win10.vdi.lz", "win2000.vdi.lz", "winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", "haiku_hrev51259.vdi.lz",
"winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz", "linux.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
524288, 2097152, 1024000, 524288, 2097152,
524288, 524288, 524288, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512,
512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65263, 1046511, 1023057, 524256, 261887,
524256, 524096, 64767, 32512,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 1024, 512, 512, 4096,
512, 512, 4096, 4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -82,13 +77,11 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"C46C1B3C6C1B28A6","8070C8EC70C8E9CC","10CC6AC6CC6AA5A6","7A14F50014F4BFE5", "106DA7693F7F6B3F",
"24884447884419A6","822C288D2C287E73","E20AF54B0AF51D6B","065BB96B7C1BCFDA",
}; };
readonly string[] oemid = { readonly string[] oemid = {
null, null, null, null, null,
null, null, null, null,
}; };
[Test] [Test]
@@ -96,20 +89,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ntfs_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ntfs_gpt", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new GuidPartitionTable();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.NTFS(); Filesystem fs = new DiscImageChef.Filesystems.NTFS();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x07") if(partitions[j].PartitionType == "Microsoft Basic data")
{ {
part = j; part = j;
break; break;

View File

@@ -53,42 +53,49 @@ namespace DiscImageChef.Tests.Filesystems
readonly string[] testfiles = { readonly string[] testfiles = {
"win10.vdi.lz", "win2000.vdi.lz", "winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz", "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", "winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz", "linux.vdi.lz",
"haiku_hrev51259.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
524288, 2097152, 1024000, 524288, 524288, 2097152, 1024000, 524288,
524288, 524288, 524288, 262144, 524288, 524288, 524288, 262144,
2097152,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65263, 1046511, 1023057, 524256, 65263, 1046511, 1023057, 524256,
524256, 524096, 64767, 32512, 524256, 524096, 64767, 32511,
261887,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
4096, 1024, 512, 512, 4096, 1024, 512, 512,
512, 512, 4096, 4096, 512, 512, 4096, 4096,
4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"C46C1B3C6C1B28A6","8070C8EC70C8E9CC","10CC6AC6CC6AA5A6","7A14F50014F4BFE5", "C46C1B3C6C1B28A6","8070C8EC70C8E9CC","10CC6AC6CC6AA5A6","7A14F50014F4BFE5",
"24884447884419A6","822C288D2C287E73","E20AF54B0AF51D6B","065BB96B7C1BCFDA", "24884447884419A6","822C288D2C287E73","E20AF54B0AF51D6B","065BB96B7C1BCFDA",
"46EC796749C6FA66",
}; };
readonly string[] oemid = { readonly string[] oemid = {
null, null, null, null, null, null, null, null,
null, null, null, null, null, null, null, null,
null,
}; };
[Test] [Test]
@@ -109,7 +116,9 @@ namespace DiscImageChef.Tests.Filesystems
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x07") if(partitions[j].PartitionType == "0x07" ||
// Value incorrectly set by Haiku
partitions[j].PartitionType == "0x86")
{ {
part = j; part = j;
break; break;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HAMMER_MBR.cs // Filename : NWFS386.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -49,44 +49,44 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HAMMER_MBR public class NWFS386
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz", "netware_3.12.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
104857600, 104857600, 104857600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
104856192, 104856192, 104856192,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN", "UNKNOWN",
}; };
[Test] [Test]
public void Test() public void Test()
{ {
throw new NotImplementedException("HAMMER filesystem is not yet implemented"); throw new NotImplementedException("NWFS386 filesystem is not yet implemented");
/* /*
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "nwfs386", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -95,11 +95,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); Filesystem fs = new DiscImageChef.Filesystems.NetWare();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0xA5") if(partitions[j].PartitionType == "0x65")
{ {
part = j; part = j;
break; break;
@@ -110,7 +110,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("NWFS386", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}*/ }*/

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HAMMER_MBR.cs // Filename : OCFS2.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -49,44 +49,44 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HAMMER_MBR public class OCFS2
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"dflybsd_3.6.1.vdi.lz","dflybsd_4.0.5.vdi.lz", "linux.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
104857600, 104857600, 104857600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
104856192, 104856192, 104856192,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN", "UNKNOWN",
}; };
[Test] [Test]
public void Test() public void Test()
{ {
throw new NotImplementedException("HAMMER filesystem is not yet implemented"); throw new NotImplementedException("OCFS2 filesystem is not yet implemented");
/* /*
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hammer_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ocfs2", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -95,11 +95,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.HAMMER(); Filesystem fs = new DiscImageChef.Filesystems.OCFS2();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0xA5") if(partitions[j].PartitionType == "0x83")
{ {
part = j; part = j;
break; break;
@@ -110,7 +110,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HAMMER", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("OCFS2", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}*/ }*/

View File

@@ -100,7 +100,6 @@ namespace DiscImageChef.Tests.Filesystems
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
System.Console.WriteLine("{0}", partitions[j].PartitionType);
if(partitions[j].PartitionType == "\"PFS\\1\"") if(partitions[j].PartitionType == "\"PFS\\1\"")
{ {
part = j; part = j;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : HFS_APM.cs // Filename : ProDOS_APM.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,69 +48,41 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class HFS_APM public class ProDOS_APM
{ {
readonly string[] testfiles = { 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", "macos_7.5.3.vdi.lz","macos_7.6.vdi.lz","macos_8.0.vdi.lz","macos_8.1.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_9.0.4.vdi.lz","macos_9.1.vdi.lz","macos_9.2.1.vdi.lz","macos_9.2.2.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 = { readonly ulong[] sectors = {
1024128,409600,409600,409600, 49152,49152,49152,49152,
409600,41820,41820,81648, 49152,49152,49152,49152,
1024000,1024000,1024000,1024000,
1024000,1024000,1024000,1024000,
1024000,1024000,1024000,1024000,
409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512,512,512, 512,512,512,512,
512,512,512,512, 512,512,512,512,
512,512,512,512,
512,512,512,512,
512,512,512,512,
512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
64003,51189,51189,58502, 48438,48438,48438,48438,
58502,39991,39991,39991, 46326,46326,46326,46326,
63954,63990,63954,63954,
63954,63922,63922,63922,
63922,63884,63883,63883,
58506,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
8192,4096,4096,3584, 512,512,512,512,
3584,1024,1024,1024, 512,512,512,512,
8192,8192,8192,8192,
8192,8192,8192,8192,
8192,8192,8192,8192,
3584,
}; };
readonly string[] volumename = { 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 = { readonly string[] volumeserial = {
null,null,null,null, null,null,null,null,
"AAFE1382AF5AA898",null,null,null,
null,null,null,null, null,null,null,null,
null,null,null,null,
null,"5A7C38B0CAF279C4","FB49083EBD150509","632C0B1DB46FD188",
null,
}; };
[Test] [Test]
@@ -118,7 +90,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfs_apm", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "prodos_apm", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -127,11 +99,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AppleMap(); PartPlugin parts = new AppleMap();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFS(); Filesystem fs = new DiscImageChef.Filesystems.ProDOSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "Apple_HFS") if(partitions[j].PartitionType == "Apple_ProDOS")
{ {
part = j; part = j;
break; break;
@@ -142,7 +114,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("ProDOS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : SFS_RDB.cs // Filename : SFS_MBR.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,14 +48,14 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class SFS_RDB public class SFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"uae.vdi.lz", "aros.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1024128, 409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -63,11 +63,11 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
127000, 408240,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
@@ -78,29 +78,25 @@ namespace DiscImageChef.Tests.Filesystems
null, null,
}; };
readonly string[] oemid = {
null,
};
[Test] [Test]
public void Test() public void Test()
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.SFS(); Filesystem fs = new DiscImageChef.Filesystems.SFS();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "\"SFS\\0\"" || partitions[j].PartitionType == "\"SFS\\2\"") if(partitions[j].PartitionType == "0x2F")
{ {
part = j; part = j;
break; break;
@@ -114,7 +110,6 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS_MBR_RDB.cs // Filename : SFS_MBR_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -49,34 +49,34 @@ using System;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS_MBR_RDB public class SFS_MBR_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"aros.vdi.lz","aros_intl.vdi.lz", "aros.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
409600,409600, 409600,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
408240,408240, 408240,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512,512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label", null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null, null,
}; };
[Test] [Test]
@@ -85,7 +85,7 @@ namespace DiscImageChef.Tests.Filesystems
throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here."); throw new NotImplementedException("Partition schemes inside partitions are not yet implemented, and should be tested here.");
/* for(int i = 0; i < testfiles.Length; i++) /* for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_mbr_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -98,7 +98,7 @@ namespace DiscImageChef.Tests.Filesystems
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x2D") if(partitions[j].PartitionType == "SFS")
{ {
part = j; part = j;
break; break;
@@ -109,7 +109,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}*/ }*/

View File

@@ -51,35 +51,31 @@ namespace DiscImageChef.Tests.Filesystems
public class SFS_RDB public class SFS_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"uae.vdi.lz", "uae.vdi.lz","aros.vdi.lz","amigaos_4.0.vdi.lz","amigaos_4.0_sfs2.vdi.lz"
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1024128, 1024128,409600,1024128,1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512,512,512,512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
127000, 127000,407232,511040,511040,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 2048,512,1024,1024,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, null,null,null,null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null,null,null,null,
};
readonly string[] oemid = {
null,
}; };
[Test] [Test]
@@ -87,7 +83,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "sfs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -100,8 +96,7 @@ namespace DiscImageChef.Tests.Filesystems
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
System.Console.WriteLine("{0}", partitions[j].PartitionType); if(partitions[j].PartitionType == "\"SFS\\0\"" || partitions[j].PartitionType == "\"SFS\\2\"")
if(partitions[j].PartitionType == "\"SFS\\0\"")
{ {
part = j; part = j;
break; break;
@@ -115,7 +110,6 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("SmartFileSystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
} }
} }
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS.cs // Filename : SysV.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -45,38 +45,42 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS public class SysV
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amigaos_3.9.adf.lz", "amigaos_3.9_intl.adf.lz", "amix.adf.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD, MediaType.CBM_AMIGA_35_DD,
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1760, 1760, 1760,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1760, 1760, 880,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512, 512, 1024,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null, null,
};
readonly string[] type = {
"SVR4 fs",
}; };
[Test] [Test]
@@ -84,7 +88,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new ZZZRawImage(); ImagePlugin image = new ZZZRawImage();
@@ -92,12 +96,12 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
Filesystem fs = new AmigaDOSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -51,11 +51,11 @@ namespace DiscImageChef.Tests.Filesystems
public class SysV_MBR public class SysV_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amix.vdi.lz", "xenix_2.3.2d.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
409600,409600, 40960,40960,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -63,23 +63,23 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
511488, 19624,19624,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024,1024,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label","Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null,null,
}; };
readonly string[] type = { readonly string[] type = {
"SVR4 fs", "XENIX fs","XENIX fs",
}; };
[Test] [Test]
@@ -87,20 +87,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "\"UNI\\1\"") if(partitions[j].PartitionType == "0x02")
{ {
part = j; part = j;
break; break;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : AFFS_MBR.cs // Filename : SysV_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,34 +48,38 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class AFFS_MBR public class SysV_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"aros.vdi.lz","aros_intl.vdi.lz", "amix.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
409600,409600, 1024128,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
408240,408240, 511488,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512,512, 1024,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null,null, null,
};
readonly string[] type = {
"SVR4 fs",
}; };
[Test] [Test]
@@ -83,20 +87,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "affs_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "s5fs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AmigaDOSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.SysVfs();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x2D") if(partitions[j].PartitionType == "\"UNI\\1\"")
{ {
part = j; part = j;
break; break;
@@ -107,7 +111,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("Amiga FFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -50,55 +50,64 @@ namespace DiscImageChef.Tests.Filesystems
readonly string[] testfiles = { readonly string[] testfiles = {
"1.02/linux.vdi.lz", "1.02/macosx.vdi.lz", "1.50/linux.vdi.lz", "1.50/macosx.vdi.lz", "1.02/linux.vdi.lz", "1.02/macosx.vdi.lz", "1.50/linux.vdi.lz", "1.50/macosx.vdi.lz",
"2.00/linux.vdi.lz", "2.00/macosx.vdi.lz", "2.01/linux.vdi.lz", "2.01/macosx.vdi.lz", "2.00/linux.vdi.lz", "2.00/macosx.vdi.lz", "2.01/linux.vdi.lz", "2.01/macosx.vdi.lz",
"2.50/linux.vdi.lz", "2.50/macosx.vdi.lz", "2.60/macosx.vdi.lz", "2.50/linux.vdi.lz", "2.50/macosx.vdi.lz", "2.60/macosx.vdi.lz", "1.50/solaris_7.vdi.lz",
"1.50/solaris_9.vdi.lz", "2.01/netbsd_7.1.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
1024000, 204800, 1024000, 409600, 1024000, 204800, 1024000, 409600,
1024000, 614400, 1024000, 819200, 1024000, 614400, 1024000, 819200,
1024000, 1024000, 1228800, 1024000, 1024000, 1228800, 8388608,
8388608, 8388608,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512,
512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
1024000, 204800, 1024000, 409600, 1024000, 204800, 1024000, 409600,
1024000, 614400, 1024000, 819200, 1024000, 614400, 1024000, 819200,
1024000, 1024000, 1228800, 1024000, 1024000, 1228800, 8388608,
8388608, 8388608,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
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 string[] udfversion = { readonly string[] udfversion = {
"UDF v1.02", "UDF v1.02", "UDF v1.50", "UDF v1.50", "UDF v1.02", "UDF v1.02", "UDF v1.50", "UDF v1.50",
"UDF v2.00", "UDF v2.00", "UDF v2.01", "UDF v2.01", "UDF v2.00", "UDF v2.00", "UDF v2.01", "UDF v2.01",
"UDF v2.50", "UDF v2.50", "UDF v2.50", "UDF v2.50", "UDF v2.50", "UDF v2.50", "UDF v1.50",
"UDF v1.50", "UDF v2.01",
}; };
readonly string[] volumename = { 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", "*NoLabel*",
"*NoLabel*", "anonymous",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"595c5cfa38ce8b66LinuxUDF", "6D02A231 (Mac OS X newfs_udf) UDF Volume Set", "595c5d00c5b3405aLinuxUDF", "4DD0458B (Mac OS X newfs_udf) UDF Volume Set", "595c5cfa38ce8b66LinuxUDF", "6D02A231 (Mac OS X newfs_udf) UDF Volume Set", "595c5d00c5b3405aLinuxUDF", "4DD0458B (Mac OS X newfs_udf) UDF Volume Set",
"595c5d07f4fc8e8dLinuxUDF", "5D91CB4F (Mac OS X newfs_udf) UDF Volume Set", "595c5d0bee60c3bbLinuxUDF", "48847EB3 (Mac OS X newfs_udf) UDF Volume Set", "595c5d07f4fc8e8dLinuxUDF", "5D91CB4F (Mac OS X newfs_udf) UDF Volume Set", "595c5d0bee60c3bbLinuxUDF", "48847EB3 (Mac OS X newfs_udf) UDF Volume Set",
"595c5d0e4f338552LinuxUDF", "709E84A1 (Mac OS X newfs_udf) UDF Volume Set", "78CE3237 (Mac OS X newfs_udf) UDF Volume Set", "595c5d0e4f338552LinuxUDF", "709E84A1 (Mac OS X newfs_udf) UDF Volume Set", "78CE3237 (Mac OS X newfs_udf) UDF Volume Set","595EB2A9",
"595EB55A", "7cc94d726669d773",
}; };
readonly string[] oemid = { readonly string[] oemid = {
"*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS",
"*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS",
"*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Apple Mac OS X UDF FS", "*Linux UDFFS", "*Apple Mac OS X UDF FS", "*Apple Mac OS X UDF FS","*SUN SOLARIS UDF",
"*SUN SOLARIS UDF", "*NetBSD userland UDF",
}; };
[Test] [Test]

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : MFS.cs // Filename : UFS.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -45,46 +45,42 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class MFS public class UFS
{ {
readonly string[] testfiles = { 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", "amix_mf2dd.adf.lz","netbsd_1.6_mf2hd.img.lz",
"macos_6.0.7_mf1dd.img.lz",
}; };
readonly MediaType[] mediatypes = { readonly MediaType[] mediatypes = {
MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.CBM_AMIGA_35_DD, MediaType.DOS_35_HD,
MediaType.AppleSonySS
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
800, 800, 800, 800, 1760, 2880,
800,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512,
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
391, 391, 391, 391, 1760, 2880,
391,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024, 1024, 1024, 512, 512,
1024,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label","Volume label", null, null,
"Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null, null, null, null, null,
null, null, null, };
readonly string[] type = {
"UFS", "UFS",
}; };
[Test] [Test]
@@ -92,7 +88,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "mfs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new ZZZRawImage(); ImagePlugin image = new ZZZRawImage();
@@ -100,12 +96,12 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]); Assert.AreEqual(mediatypes[i], image.ImageInfo.mediaType, testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleMFS.AppleMFS(); Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("MFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : UFS_MBR.cs // Filename : UFS_APM.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,34 +48,54 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class UFS_MBR public class UFS_APM
{ {
readonly string[] testfiles = { 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",
"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 = { readonly ulong[] sectors = {
262144, 262144, 262144, 262144, 262144, 262144,
262144, 262144, 262144, 262144,
262144, 262144, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65024, 65018, 65024, 65018, 65024, 65018,
65024, 65018, 65024, 65018,
65024, 65018, 65024,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 2048 2048, 2048, 2048, 2048,
2048, 2048, 2048, 2048,
2048, 2048, 2048,
}; };
readonly string[] volumename = { 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",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"59588B778E9ACDEF", "UNKNOWN", "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] [Test]
@@ -83,20 +103,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_apm", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new AppleMap();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x83") if(partitions[j].PartitionType == "Apple_UFS")
{ {
part = j; part = j;
break; break;
@@ -107,7 +127,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("UFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -51,31 +51,91 @@ namespace DiscImageChef.Tests.Filesystems
public class UFS_MBR public class UFS_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"ufs1/linux.vdi.lz", "ufs2/linux.vdi.lz", "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 = { 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, 262144,
262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512,
}; };
readonly long[] clusters = { 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, 65018,
65024,
}; };
readonly int[] clustersize = { 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, 2048,
2048,
}; };
readonly string[] volumename = { 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", "Volume label",
"Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"59588B778E9ACDEF", "UNKNOWN", "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] [Test]
@@ -107,7 +167,7 @@ namespace DiscImageChef.Tests.Filesystems
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("UFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : UFS_MBR.cs // Filename : UFS_NeXT.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,94 +48,70 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class UFS_MBR public class UFS_NeXT
{ {
readonly string[] testfiles = { 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", "nextstep_3.3.vdi.lz","nextstep_3.3_mf2dd.img.lz","nextstep_3.3_mf2hd.img.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", "openstep_4.0.vdi.lz","openstep_4.0_mf2dd.img.lz","openstep_4.0_mf2hd.img.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", "openstep_4.2.vdi.lz","openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.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", "rhapsody_dr1.vdi.lz","rhapsody_dr1_mf2dd.img.lz","rhapsody_dr1_mf2hd.img.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", "rhapsody_dr2.vdi.lz","rhapsody_dr2_mf2dd.img.lz","rhapsody_dr2_mf2hd.img.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 = { readonly ulong[] sectors = {
262144, 262144, 262144, 262144, 262144, 1440, 2880,
262144, 262144, 262144, 262144, 262144, 1440, 2880,
262144, 262144, 262144, 262144, 262144, 1440, 2880,
262144, 262144, 262144, 262144, 262144, 1440, 2880,
262144, 262144, 262144, 262144, 262144, 1440, 2880,
262144, 262144, 262144, 262144,
262144, 262144, 262144, 262144,
262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512, 512,
512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65024, 65018, 65024, 65018, 131072, 720, 1440,
65024, 65018, 65024, 65018, 131072, 720, 1440,
65024, 65018, 65024, 65018, 131072, 720, 1440,
65024, 65018, 65024, 65018, 131072, 720, 1440,
65024, 65018, 65024, 65018, 131072, 720, 1440,
65024, 65018, 65024, 65018,
65024, 65018, 65024, 65018,
65024,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 2048, 2048, 2048, 1024, 1024, 1024,
2048, 2048, 2048, 2048, 1024, 1024, 1024,
2048, 2048, 2048, 2048, 1024, 1024, 1024,
2048, 2048, 2048, 2048, 1024, 1024, 1024,
2048, 2048, 2048, 2048, 1024, 1024, 1024,
2048, 2048, 2048, 2048,
2048, 2048, 2048, 2048,
2048,
}; };
readonly string[] volumename = { 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", "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 = { 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", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN",
}; };
readonly string[] type = { 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", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS",
"UFS", "UFS2", "UFS2", "UFS2",
"UFS2",
}; };
[Test] [Test]
@@ -143,20 +119,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_mbr", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_next", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); PartPlugin parts = new NeXTDisklabel();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "0x83") if(partitions[j].PartitionType == "4.3BSD" || partitions[j].PartitionType == "4.4BSD")
{ {
part = j; part = j;
break; break;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : UFS_APM.cs // Filename : UFS_RDB.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,54 +48,38 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class UFS_APM public class UFS_RDB
{ {
readonly string[] testfiles = { 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", "amix.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 = { readonly ulong[] sectors = {
262144, 262144, 262144, 262144, 262144,
262144, 262144, 262144, 262144,
262144, 262144, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512,
512, 512, 512, 512,
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65024, 65018, 65024, 65018, 65024,
65024, 65018, 65024, 65018,
65024, 65018, 65024,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 2048, 2048, 2048, 2048,
2048, 2048, 2048, 2048,
2048, 2048, 2048,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label", "Volume label", "Volume label", "Volume label", null,
"Volume label", "Volume label", "Volume label", "Volume label",
"Volume label", "Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
"UNKNOWN", "UNKNOWN", "UNKNOWN",
}; };
readonly string[] type = { readonly string[] type = {
"UFS", "UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS", "UFS",
"UFS", "UFS", "UFS",
}; };
[Test] [Test]
@@ -103,20 +87,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_apm", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AppleMap(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "Apple_UFS") if(partitions[j].PartitionType == "\"UNI\\2\"")
{ {
part = j; part = j;
break; break;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : UFS_RDB.cs // Filename : UFS_Suni86.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,38 +48,38 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class UFS_RDB public class UFS_Suni86
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amix.vdi.lz", "solaris_2.4_mf2dd.img.lz","solaris_2.4_mf2hd.img.lz","solaris_7.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144, 1440, 2880, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
65024, 720, 1440, 65024,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
2048, 1024, 1024, 2048,
}; };
readonly string[] volumename = { readonly string[] volumename = {
null, null, null, null,
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN",
}; };
readonly string[] type = { readonly string[] type = {
"UFS", "UFS", "UFS", "UFS",
}; };
[Test] [Test]
@@ -87,20 +87,20 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_suni86", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new SunDisklabel();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "\"UNI\\2\"") if(partitions[j].PartitionType != "Empty")
{ {
part = j; part = j;
break; break;

View File

@@ -51,11 +51,15 @@ namespace DiscImageChef.Tests.Filesystems
public class unixbfs public class unixbfs
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux.vdi.lz", "amix.adf.lz",
};
readonly MediaType[] mediatypes = {
MediaType.CBM_AMIGA_35_DD,
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144, 1760,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
@@ -63,7 +67,7 @@ namespace DiscImageChef.Tests.Filesystems
}; };
readonly long[] clusters = { readonly long[] clusters = {
260096, 1760,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
@@ -82,25 +86,14 @@ namespace DiscImageChef.Tests.Filesystems
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new ZZZRawImage();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); 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(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR(); Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BFS(); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
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(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("BFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("BFS", fs.XmlFSType.Type, testfiles[i]);

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : unixbfs.cs // Filename : unixbfs_mbr.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -48,30 +48,30 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class unixbfs public class unixbfs_mbr
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux.vdi.lz","amix.adf.lz", "linux.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144,1760, 262144,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512,512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
260096,1760, 260096,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
512,512, 512,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Label","Label", "Label",
}; };
[Test] [Test]
@@ -79,7 +79,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs_mbr", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();

View File

@@ -48,7 +48,7 @@ using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class UFS_RDB public class UNIXBFS_RDB
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"amix.vdi.lz", "amix.vdi.lz",
@@ -87,7 +87,7 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_rdb", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "unixbfs_rdb", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new VDI(); ImagePlugin image = new VDI();
@@ -96,11 +96,11 @@ namespace DiscImageChef.Tests.Filesystems
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AmigaRigidDiskBlock(); PartPlugin parts = new AmigaRigidDiskBlock();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]); Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); Filesystem fs = new DiscImageChef.Filesystems.BFS();
int part = -1; int part = -1;
for(int j = 0; j < partitions.Count; j++) for(int j = 0; j < partitions.Count; j++)
{ {
if(partitions[j].PartitionType == "\"UNI\\2\"") if(partitions[j].PartitionType == "\"UNI\\0\"")
{ {
part = j; part = j;
break; break;

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef // The Disc Image Chef
// ---------------------------------------------------------------------------- // ----------------------------------------------------------------------------
// //
// Filename : MFS.cs // Filename : ZFS.cs
// Version : 1.0 // Version : 1.0
// Author(s) : Natalia Portillo // Author(s) : Natalia Portillo
// //
@@ -41,50 +41,39 @@ using DiscImageChef.Filesystems;
using DiscImageChef.Filters; using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins; using DiscImageChef.ImagePlugins;
using NUnit.Framework; using NUnit.Framework;
using DiscImageChef.DiscImages;
namespace DiscImageChef.Tests.Filesystems namespace DiscImageChef.Tests.Filesystems
{ {
[TestFixture] [TestFixture]
public class MFS public class ZFS
{ {
readonly string[] testfiles = { 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", "netbsd_7.1.vdi.lz",
"macos_6.0.7_mf1dd.img.lz",
};
readonly MediaType[] mediatypes = {
MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS, MediaType.AppleSonySS,
MediaType.AppleSonySS
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
800, 800, 800, 800, 33554432,
800,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512,
512, 512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
391, 391, 391, 391, 0,
391,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024, 1024, 1024, 0,
1024,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"Volume label","Volume label","Volume label","Volume label", "NetBSD 7.1",
"Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
null, null, null, null, "2639895335654686206",
null, null, null,
}; };
[Test] [Test]
@@ -92,20 +81,19 @@ namespace DiscImageChef.Tests.Filesystems
{ {
for(int i = 0; i < testfiles.Length; i++) for(int i = 0; i < testfiles.Length; i++)
{ {
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "mfs", testfiles[i]); string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "zfs", testfiles[i]);
Filter filter = new LZip(); Filter filter = new LZip();
filter.Open(location); filter.Open(location);
ImagePlugin image = new ZZZRawImage(); ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); 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(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleMFS.AppleMFS(); Filesystem fs = new DiscImageChef.Filesystems.ZFS();
Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]); Assert.AreEqual(true, fs.Identify(image, 0, image.ImageInfo.sectors - 1), testfiles[i]);
fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information); fs.GetInformation(image, 0, image.ImageInfo.sectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("MFS", fs.XmlFSType.Type, testfiles[i]); Assert.AreEqual("ZFS filesystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
} }

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class exFAT_APM public class exFAT_APM
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class exFAT_GPT public class exFAT_GPT
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_10.11.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -51,7 +51,7 @@ namespace DiscImageChef.Tests.Filesystems
public class exFAT_MBR public class exFAT_MBR
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux.vdi.lz", "macosx.vdi.lz", "win10.vdi.lz", "winvista.vdi.lz", "linux.vdi.lz", "macosx_10.11.vdi.lz", "win10.vdi.lz", "winvista.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {

View File

@@ -52,34 +52,42 @@ namespace DiscImageChef.Tests.Filesystems
{ {
readonly string[] testfiles = { readonly string[] testfiles = {
"linux_ext2.vdi.lz", "linux_ext3.vdi.lz","linux_ext4.vdi.lz", "linux_ext2.vdi.lz", "linux_ext3.vdi.lz","linux_ext4.vdi.lz",
"netbsd_7.1.vdi.lz", "netbsd_7.1_r0.vdi.lz",
}; };
readonly ulong[] sectors = { readonly ulong[] sectors = {
262144, 262144, 262144, 262144, 262144, 262144,
8388608, 2097152,
}; };
readonly uint[] sectorsize = { readonly uint[] sectorsize = {
512, 512, 512, 512, 512, 512,
512, 512,
}; };
readonly long[] clusters = { readonly long[] clusters = {
130048, 130048, 130048, 130048, 130048, 130048,
1046567, 260135,
}; };
readonly int[] clustersize = { readonly int[] clustersize = {
1024, 1024, 1024, 1024, 1024, 1024,
4096, 4096,
}; };
readonly string[] volumename = { readonly string[] volumename = {
"VolumeLabel", "VolumeLabel", "VolumeLabel", "VolumeLabel", "VolumeLabel", "VolumeLabel",
"Volume label", "Volume label",
}; };
readonly string[] volumeserial = { readonly string[] volumeserial = {
"cf92398e-987d-4ae4-b753-0591a35913eb", "1615411b-1554-424b-95e6-1a247056a960", "05f3f8b2-0f77-47ad-abe4-f0484aa319e9", "cf92398e-987d-4ae4-b753-0591a35913eb", "1615411b-1554-424b-95e6-1a247056a960", "05f3f8b2-0f77-47ad-abe4-f0484aa319e9",
"05ee2ae7-7b62-e711-a573-0800272a08ec", "f2562707-7c62-e711-a573-0800272a08ec",
}; };
readonly string[] extversion = { readonly string[] extversion = {
"ext2", "ext3", "ext4", "ext2", "ext3", "ext4",
"ext2", "ext2"
}; };
[Test] [Test]