diff --git a/DiscImageChef.Tests/Filesystems/UFS.cs b/DiscImageChef.Tests/Filesystems/UFS.cs index 84806970..e4b38683 100644 --- a/DiscImageChef.Tests/Filesystems/UFS.cs +++ b/DiscImageChef.Tests/Filesystems/UFS.cs @@ -68,12 +68,12 @@ namespace DiscImageChef.Tests.Filesystems }; readonly long[] clusters = { - 1760, 2880, 720, 2400, + 880, 2880, 720, 2400, 1440, 2880, }; readonly int[] clustersize = { - 512, 512, 512, 512, + 1024, 512, 512, 512, 512, 512, }; diff --git a/DiscImageChef.Tests/Filesystems/UFS_APM.cs b/DiscImageChef.Tests/Filesystems/UFS_APM.cs index 3f3ff26a..28f0997a 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_APM.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_APM.cs @@ -57,9 +57,9 @@ namespace DiscImageChef.Tests.Filesystems }; readonly ulong[] sectors = { - 262144, 262144, 262144, 262144, - 262144, 262144, 262144, 262144, - 262144, 262144, 262144, + 1024000, 1024000, 1024000, 1024000, + 204800, 204800, 204800, 204800, + 2097152, 2097152, 2097152, }; readonly uint[] sectorsize = { @@ -69,27 +69,27 @@ namespace DiscImageChef.Tests.Filesystems }; readonly long[] clusters = { - 65024, 65018, 65024, 65018, - 65024, 65018, 65024, 65018, - 65024, 65018, 65024, + 511488, 511488, 511488, 511488, + 102368, 102368, 102368, 102368, + 1047660, 1038952, 1038952, }; readonly int[] clustersize = { - 2048, 2048, 2048, 2048, - 2048, 2048, 2048, 2048, - 2048, 2048, 2048, + 1024, 1024, 1024, 1024, + 1024, 1024, 1024, 1024, + 1024, 1024, 1024, }; readonly string[] volumename = { - "Volume label", "Volume label", "Volume label", "Volume label", - "Volume label", "Volume label", "Volume label", "Volume label", - "Volume label", "Volume label", "Volume label", + null, null, null, null, + null, null, null, null, + null, null, null, }; readonly string[] volumeserial = { - "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", + null, null, null, null, + null, null, null, null, + null, null, null, }; readonly string[] type = { diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs index 30ba26fa..fcab65ed 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT.cs @@ -51,67 +51,43 @@ namespace DiscImageChef.Tests.Filesystems public class UFS_NeXT { readonly string[] testfiles = { - "nextstep_3.3.vdi.lz","nextstep_3.3_mf2dd.img.lz","nextstep_3.3_mf2hd.img.lz", - "openstep_4.0.vdi.lz","openstep_4.0_mf2dd.img.lz","openstep_4.0_mf2hd.img.lz", - "openstep_4.2.vdi.lz","openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.lz", - "rhapsody_dr1.vdi.lz","rhapsody_dr1_mf2dd.img.lz","rhapsody_dr1_mf2hd.img.lz", - "rhapsody_dr2.vdi.lz","rhapsody_dr2_mf2dd.img.lz","rhapsody_dr2_mf2hd.img.lz", + "nextstep_3.3.vdi.lz","openstep_4.0.vdi.lz","openstep_4.2.vdi.lz", + "rhapsody_dr1.vdi.lz","rhapsody_dr2.vdi.lz", }; readonly ulong[] sectors = { - 262144, 1440, 2880, - 262144, 1440, 2880, - 262144, 1440, 2880, - 262144, 1440, 2880, - 262144, 1440, 2880, + 409600,409600,409600, + 409600,409600, }; readonly uint[] sectorsize = { 512, 512, 512, - 512, 512, 512, - 512, 512, 512, - 512, 512, 512, - 512, 512, 512, + 512, 512, }; readonly long[] clusters = { - 131072, 720, 1440, - 131072, 720, 1440, - 131072, 720, 1440, - 131072, 720, 1440, - 131072, 720, 1440, + 204640,204640,204640, + 204640,204464, }; readonly int[] clustersize = { 1024, 1024, 1024, - 1024, 1024, 1024, - 1024, 1024, 1024, - 1024, 1024, 1024, - 1024, 1024, 1024, + 1024, 1024, }; readonly string[] volumename = { - "Volume label", "Volume label", "Volume label", - "Volume label", "Volume label", "Volume label", - "Volume label", "Volume label", "Volume label", - "Volume label", "Volume label", "Volume label", - "Volume label", "Volume label", "Volume label", + null, null, null, + null, null, }; readonly string[] volumeserial = { - "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", - "UNKNOWN", "UNKNOWN", "UNKNOWN", + null, null, null, + null, null, }; readonly string[] type = { "UFS", "UFS", "UFS", - "UFS", "UFS", "UFS", - "UFS", "UFS", "UFS", - "UFS", "UFS", "UFS", - "UFS", "UFS", "UFS", + "UFS", "UFS", }; [Test] diff --git a/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs b/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs new file mode 100644 index 00000000..a7d6e028 --- /dev/null +++ b/DiscImageChef.Tests/Filesystems/UFS_NeXT_Floppy.cs @@ -0,0 +1,152 @@ +// /*************************************************************************** +// The Disc Image Chef +// ---------------------------------------------------------------------------- +// +// Filename : UFS_NeXT.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 . +// +// ---------------------------------------------------------------------------- +// Copyright (C) 2011-2015 Claunia.com +// ****************************************************************************/ +// //$Id$ +using System.Collections.Generic; +using System.IO; +using DiscImageChef.CommonTypes; +using DiscImageChef.DiscImages; +using DiscImageChef.Filesystems; +using DiscImageChef.Filters; +using DiscImageChef.ImagePlugins; +using DiscImageChef.PartPlugins; +using NUnit.Framework; + +namespace DiscImageChef.Tests.Filesystems +{ + [TestFixture] + public class UFS_NeXT_Floppy + { + readonly string[] testfiles = { + "nextstep_3.3_mf2dd.img.lz","nextstep_3.3_mf2hd.img.lz", + "openstep_4.0_mf2dd.img.lz","openstep_4.0_mf2hd.img.lz", + "openstep_4.2_mf2dd.img.lz","openstep_4.2_mf2hd.img.lz", + "rhapsody_dr1_mf2dd.img.lz","rhapsody_dr1_mf2hd.img.lz", + "rhapsody_dr2_mf2dd.img.lz","rhapsody_dr2_mf2hd.img.lz", + }; + + readonly ulong[] sectors = { + 1440, 2880, + 1440, 2880, + 1440, 2880, + 1440, 2880, + 1440, 2880, + }; + + readonly uint[] sectorsize = { + 512, 512, + 512, 512, + 512, 512, + 512, 512, + 512, 512, + }; + + readonly long[] clusters = { + 624, 1344, + 624, 1344, + 624, 1344, + 624, 1344, + 624, 1344, + }; + + readonly int[] clustersize = { + 1024, 1024, + 1024, 1024, + 1024, 1024, + 1024, 1024, + 1024, 1024, + }; + + readonly string[] volumename = { + null, null, + null, null, + null, null, + null, null, + null, null, + }; + + readonly string[] volumeserial = { + null, null, + null, null, + null, null, + null, null, + null, null, + }; + + readonly string[] type = { + "UFS", "UFS", + "UFS", "UFS", + "UFS", "UFS", + "UFS", "UFS", + "UFS", "UFS", + }; + + [Test] + public void Test() + { + for(int i = 0; i < testfiles.Length; i++) + { + string location = Path.Combine(Consts.TestFilesRoot, "filesystems", "ufs_next", testfiles[i]); + Filter filter = new LZip(); + filter.Open(location); + ImagePlugin image = new ZZZRawImage(); + Assert.AreEqual(true, image.OpenImage(filter), testfiles[i]); + Assert.AreEqual(sectors[i], image.ImageInfo.sectors, testfiles[i]); + Assert.AreEqual(sectorsize[i], image.ImageInfo.sectorSize, testfiles[i]); + PartPlugin parts = new NeXTDisklabel(); + Assert.AreEqual(true, parts.GetInformation(image, out List partitions), testfiles[i]); + Filesystem fs = new DiscImageChef.Filesystems.FFSPlugin(); + int part = -1; + for(int j = 0; j < partitions.Count; j++) + { + if(partitions[j].PartitionType == "4.3BSD" || partitions[j].PartitionType == "4.4BSD") + { + part = j; + break; + } + } + Assert.AreNotEqual(-1, part, "Partition not found"); + Assert.AreEqual(true, fs.Identify(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1), testfiles[i]); + fs.GetInformation(image, partitions[part].PartitionStartSector, partitions[part].PartitionStartSector + partitions[part].PartitionSectors - 1, out string information); + Assert.AreEqual(clusters[i], fs.XmlFSType.Clusters, testfiles[i]); + Assert.AreEqual(clustersize[i], fs.XmlFSType.ClusterSize, testfiles[i]); + Assert.AreEqual(type[i], fs.XmlFSType.Type, testfiles[i]); + Assert.AreEqual(volumename[i], fs.XmlFSType.VolumeName, testfiles[i]); + Assert.AreEqual(volumeserial[i], fs.XmlFSType.VolumeSerial, testfiles[i]); + } + } + } +} diff --git a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs index 3775b34e..26a8843c 100644 --- a/DiscImageChef.Tests/Filesystems/UFS_RDB.cs +++ b/DiscImageChef.Tests/Filesystems/UFS_RDB.cs @@ -55,7 +55,7 @@ namespace DiscImageChef.Tests.Filesystems }; readonly ulong[] sectors = { - 262144, + 1024128, }; readonly uint[] sectorsize = {