Example #1
0
        public void Test()
        {
            for (int i = 0; i < testfiles.Length; i++)
            {
                string  location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat32_apm", testfiles[i]);
                IFilter filter   = new LZip();
                filter.Open(location);
                IMediaImage image = new Vdi();
                Assert.AreEqual(true, image.Open(filter), testfiles[i]);
                Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
                Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
                List <Partition> partitions = Core.Partitions.GetAll(image);
                IFilesystem      fs         = new FAT();
                int part = -1;
                for (int j = 0; j < partitions.Count; j++)
                {
                    if (partitions[j].Type == "DOS_FAT_32")
                    {
                        part = j;
                        break;
                    }
                }

                Assert.AreNotEqual(-1, part, $"Partition not found on {testfiles[i]}");
                Assert.AreEqual(true, fs.Identify(image, partitions[part]), testfiles[i]);
                fs.GetInformation(image, partitions[part], out _, null);
                Assert.AreEqual(clusters[i], fs.XmlFsType.Clusters, testfiles[i]);
                Assert.AreEqual(clustersize[i], fs.XmlFsType.ClusterSize, testfiles[i]);
                Assert.AreEqual("FAT32", 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]);
            }
        }
Example #2
0
        public void Test()
        {
            for (int i = 0; i < testfiles.Length; i++)
            {
                string  location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat16", testfiles[i]);
                IFilter filter   = new LZip();
                filter.Open(location);
                IMediaImage image = new ZZZRawImage();
                Assert.AreEqual(true, image.Open(filter), testfiles[i]);
                Assert.AreEqual(mediatypes[i], image.Info.MediaType, testfiles[i]);
                Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
                Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
                IFilesystem fs = new FAT();

                var wholePart = new Partition
                {
                    Name = "Whole device", Length = image.Info.Sectors,
                    Size = image.Info.Sectors * image.Info.SectorSize
                };

                Assert.AreEqual(true, fs.Identify(image, wholePart), testfiles[i]);
                fs.GetInformation(image, wholePart, out _, null);
                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]);
            }
        }
Example #3
0
        public void Test()
        {
            for (int i = 0; i < _testFiles.Length; i++)
            {
                string location = Path.Combine(Consts.TEST_FILES_ROOT, "Filesystems", "FAT16 (Human68K)",
                                               _testFiles[i]);

                IFilter filter = new ZZZNoFilter();
                filter.Open(location);
                IMediaImage image = new AaruFormat();
                Assert.AreEqual(true, image.Open(filter), _testFiles[i]);
                Assert.AreEqual(_sectors[i], image.Info.Sectors, _testFiles[i]);
                Assert.AreEqual(_sectorSize[i], image.Info.SectorSize, _testFiles[i]);
                List <Partition> partitions = Core.Partitions.GetAll(image);
                IFilesystem      fs         = new FAT();
                int part = -1;

                for (int j = 0; j < partitions.Count; j++)
                {
                    if (partitions[j].Type == "Human68k")
                    {
                        part = j;

                        break;
                    }
                }

                Assert.AreNotEqual(-1, part, $"Partition not found on {_testFiles[i]}");
                Assert.AreEqual(true, fs.Identify(image, partitions[part]), _testFiles[i]);
                fs.GetInformation(image, partitions[part], out _, null);
                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]);
            }
        }
Example #4
0
 public void Test()
 {
     for (int i = 0; i < testfiles.Length; i++)
     {
         string  location = Path.Combine(Consts.TestFilesRoot, "filesystems", "fat32_mbr", testfiles[i]);
         IFilter filter   = new LZip();
         filter.Open(location);
         IMediaImage image = new Vdi();
         Assert.AreEqual(true, image.Open(filter), testfiles[i]);
         Assert.AreEqual(sectors[i], image.Info.Sectors, testfiles[i]);
         Assert.AreEqual(sectorsize[i], image.Info.SectorSize, testfiles[i]);
         List <Partition> partitions = Core.Partitions.GetAll(image);
         IFilesystem      fs         = new FAT();
         Assert.AreEqual(true, fs.Identify(image, partitions[0]), testfiles[i]);
         fs.GetInformation(image, partitions[0], out _, null);
         Assert.AreEqual(clusters[i], fs.XmlFsType.Clusters, testfiles[i]);
         Assert.AreEqual(clustersize[i], fs.XmlFsType.ClusterSize, testfiles[i]);
         Assert.AreEqual("FAT32", 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]);
     }
 }
Example #5
0
 public void Test()
 {
     for (int i = 0; i < _testFiles.Length; i++)
     {
         string  location = Path.Combine(Consts.TEST_FILES_ROOT, "Filesystems", "FAT32 (MBR)", _testFiles[i]);
         IFilter filter   = new ZZZNoFilter();
         filter.Open(location);
         IMediaImage image = new AaruFormat();
         Assert.AreEqual(true, image.Open(filter), _testFiles[i]);
         Assert.AreEqual(_sectors[i], image.Info.Sectors, _testFiles[i]);
         Assert.AreEqual(_sectorSize[i], image.Info.SectorSize, _testFiles[i]);
         List <Partition> partitions = Core.Partitions.GetAll(image);
         IFilesystem      fs         = new FAT();
         Assert.AreEqual(true, fs.Identify(image, partitions[0]), _testFiles[i]);
         fs.GetInformation(image, partitions[0], out _, null);
         Assert.AreEqual(_clusters[i], fs.XmlFsType.Clusters, _testFiles[i]);
         Assert.AreEqual(_clusterSize[i], fs.XmlFsType.ClusterSize, _testFiles[i]);
         Assert.AreEqual("FAT32", 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]);
     }
 }