Make class public.

This commit is contained in:
2017-07-05 06:54:50 +01:00
parent 5319b3440b
commit 857eceef2d
45 changed files with 6322 additions and 9 deletions

View File

@@ -32,7 +32,7 @@
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
/// <summary>
/// Lisa FS v1, from Lisa OS 1.0 (Workshop or Office)

View File

@@ -37,7 +37,7 @@ using DiscImageChef.Decoders;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
/// <summary>
/// Solves a symbolic link.

View File

@@ -37,7 +37,7 @@ using DiscImageChef.Decoders;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
public override Errno MapBlock(string path, long fileBlock, ref long deviceBlock)
{

View File

@@ -37,7 +37,7 @@ using DiscImageChef.Decoders;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
public override Errno GetAttributes(string path, ref FileAttributes attributes)
{

View File

@@ -38,7 +38,7 @@ using DiscImageChef.ImagePlugins;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
public override bool Identify(ImagePlugin imagePlugin, ulong partitionStart, ulong partitionEnd)
{

View File

@@ -40,7 +40,7 @@ namespace DiscImageChef.Filesystems.LisaFS
{
// All information by Natalia Portillo
// Variable names from Lisa API
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
bool mounted;
bool debug;

View File

@@ -33,7 +33,7 @@
using System;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
/// <summary>
/// The MDDF is the most import block on a Lisa FS volume.

View File

@@ -38,7 +38,7 @@ using DiscImageChef.Decoders;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
/// <summary>
/// Mounts an Apple Lisa filesystem

View File

@@ -38,7 +38,7 @@ using DiscImageChef.Decoders;
namespace DiscImageChef.Filesystems.LisaFS
{
partial class LisaFS : Filesystem
public partial class LisaFS : Filesystem
{
/// <summary>
/// Lists all extended attributes, alternate data streams and forks of the given file.

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class BeFS
{
public BeFS()
{
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_APM.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class BeFS_APM
{
public BeFS_APM()
{
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class BeFS_MBR
{
public BeFS_MBR()
{
}
}
}

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : FAT16_APM.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class FAT16_APM
{
public FAT16_APM()
{
}
}
}

View File

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

View File

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

View File

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

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_APM.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class HFSPlus_APM
{
public HFSPlus_APM()
{
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_GPT.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class HFSPlus_GPT
{
public HFSPlus_GPT()
{
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class BeFS_MBR
{
readonly string[] testfiles = {
"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz",
};
readonly ulong[] sectors = {
1572864, 1572864,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
786400, 785232,
};
readonly int[] clustersize = {
1024, 1024,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
null,null,
};
readonly string[] oemid = {
null,null,
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xEB")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_APM.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFSPlus_APM
{
readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz",
};
readonly ulong[] sectors = {
1572864, 1024000,
};
readonly uint[] sectorsize = {
512, 512
};
readonly long[] clusters = {
51190, 76790,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ"
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new AppleMap();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "Apple_HFS")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS+", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_GPT.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFSPlus_GPT
{
readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz",
};
readonly ulong[] sectors = {
1572864, 1024000,
};
readonly uint[] sectorsize = {
512, 512
};
readonly long[] clusters = {
51190, 76790,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ"
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_apm", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new GuidPartitionTable();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "Apple HFS")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS+", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFSPlus_MBR
{
readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz",
};
readonly ulong[] sectors = {
1572864, 1572864,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
37878, 44021,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xAF")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS+", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFSPlus_MBR
{
readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz",
};
readonly ulong[] sectors = {
303104, 352256,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
37878, 44021,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xAF")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS+", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : LisaFS.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class LisaFS
{
public LisaFS()
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : JFS2.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class JFS2
{
readonly string[] testfiles = {
"linux.vdi.lz","linux_caseinsensitive.vdi.lz",
};
readonly ulong[] sectors = {
262144, 262144,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
257632, 257632,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume labe", "Volume labe",
};
readonly string[] volumeserial = {
"8033b783-0cd1-1645-8ecc-f8f113ad6a47", "d6cd91e9-3899-7e40-8468-baab688ee2e2",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "jfs2", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.JFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83" || partitions[j].PartitionType == "0x07")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("JFS filesystem", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFSX_MBR
{
readonly string[] testfiles = {
/*"macosx.vdi.lz", */"macosx_journal.vdi.lz",
};
readonly ulong[] sectors = {
393216, 409600,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
102390, 153590,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsx_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xAF")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFSX", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : PFS3_RDB.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class PFS3_RDB
{
public PFS3_RDB()
{
}
}
}

View File

@@ -0,0 +1,130 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : NTFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class NTFS_MBR
{
readonly string[] testfiles = {
"win10.vdi.lz", "win2000.vdi.lz", "winnt_3.10.vdi.lz", "winnt_3.50.vdi.lz",
"winnt_3.51.vdi.lz", "winnt_4.00.vdi.lz", "winvista.vdi.lz",
};
readonly ulong[] sectors = {
524288, 2097152, 1024000, 524288,
524288, 524288, 524288,
};
readonly uint[] sectorsize = {
512, 512, 512, 512,
512, 512, 512
};
readonly long[] clusters = {
65263, 1046511, 1023057, 524256,
524256, 524096, 64767,
};
readonly int[] clustersize = {
4096, 1024, 512, 512,
512, 512, 4096,
};
readonly string[] volumename = {
null, null, null, null,
null, null, null,
};
readonly string[] volumeserial = {
"C46C1B3C6C1B28A6","8070C8EC70C8E9CC","10CC6AC6CC6AA5A6","7A14F50014F4BFE5",
"24884447884419A6","822C288D2C287E73","E20AF54B0AF51D6B",
};
readonly string[] oemid = {
null, null, null, null,
null, null, null,
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ntfs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.NTFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x07")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("NTFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : SFS_RDB.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class SFS_RDB
{
public SFS_RDB()
{
}
}
}

File diff suppressed because it is too large Load Diff

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFS_MBR
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
65018,
};
readonly int[] clustersize = {
2048,
};
readonly string[] volumename = {
"Volume label",
};
readonly string[] volumeserial = {
"0000000000000000",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xAF")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,116 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : btrfs.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class btrfs
{
readonly string[] testfiles = {
"linux.vdi.lz",
};
readonly ulong[] sectors = {
262144,
};
readonly uint[] sectorsize = {
512,
};
readonly long[] clusters = {
32512,
};
readonly int[] clustersize = {
4096,
};
readonly string[] volumename = {
"VolumeLabel",
};
readonly string[] volumeserial = {
"a4fc5201-85cc-6840-8a68-998cab9ae897",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "btrfs", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BTRFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0x83")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("B-tree file system", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : BeFS_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class BeFS_MBR
{
readonly string[] testfiles = {
"beos_r3.1.vdi.lz", "beos_r4.5.vdi.lz",
};
readonly ulong[] sectors = {
1572864, 1572864,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
786400, 785232,
};
readonly int[] clustersize = {
1024, 1024,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
null,null,
};
readonly string[] oemid = {
null,null,
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "befs_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.BeFS();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xEB")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("BeFS", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

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

View File

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

View File

@@ -0,0 +1,121 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : HFSPlus_MBR.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System.Collections.Generic;
using System.IO;
using DiscImageChef.CommonTypes;
using DiscImageChef.DiscImages;
using DiscImageChef.Filesystems;
using DiscImageChef.Filters;
using DiscImageChef.ImagePlugins;
using DiscImageChef.PartPlugins;
using NUnit.Framework;
namespace DiscImageChef.Tests.Filesystems
{
[TestFixture]
public class HFSPlus_MBR
{
readonly string[] testfiles = {
"macosx.vdi.lz", "macosx_journal.vdi.lz",
};
readonly ulong[] sectors = {
303104, 352256,
};
readonly uint[] sectorsize = {
512, 512,
};
readonly long[] clusters = {
37878, 44021,
};
readonly int[] clustersize = {
4096, 4096,
};
readonly string[] volumename = {
"Volume label","Volume label",
};
readonly string[] volumeserial = {
"UNKNOWN","UNKNOWN",
};
readonly string[] oemid = {
"10.0","HFSJ",
};
[Test]
public void Test()
{
for(int i = 0; i < testfiles.Length; i++)
{
string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "hfsplus_mbr", testfiles[i]);
Filter filter = new LZip();
filter.Open(location);
ImagePlugin image = new VDI();
Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]);
Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]);
Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]);
PartPlugin parts = new MBR();
Assert.AreEqual(true, parts.GetInformation(image, out List<Partition> partitions), testfiles[i]);
Filesystem fs = new DiscImageChef.Filesystems.AppleHFSPlus();
int part = -1;
for(int j = 0; j < partitions.Count; j++)
{
if(partitions[j].PartitionType == "0xAF")
{
part = j;
break;
}
}
Assert.AreNotEqual(-1, part, "Partition not found");
Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]);
fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information);
Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]);
Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]);
Assert.AreEqual("HFS+", fs.XmlFSType.Type, testfiles[i]);
Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]);
Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]);
Assert.AreEqual(oemid[i], fs.XmlFSType.SystemIdentifier, testfiles[i]);
}
}
}
}

View File

@@ -0,0 +1,47 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : ext2.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests.Filesystems
{
public class ext2
{
public ext2()
{
}
}
}