2017-09-28 15:44:21 +01:00
|
|
|
|
// /***************************************************************************
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Aaru Data Preservation Suite
|
2017-09-28 15:44:21 +01:00
|
|
|
|
// ----------------------------------------------------------------------------
|
|
|
|
|
|
//
|
2017-12-19 03:50:57 +00:00
|
|
|
|
// Filename : 2MG.cs
|
|
|
|
|
|
// Author(s) : Natalia Portillo <claunia@claunia.com>
|
2017-09-28 15:44:21 +01:00
|
|
|
|
//
|
2020-07-25 02:01:36 +01:00
|
|
|
|
// Component : Aaru unit testing.
|
2017-09-28 15:44:21 +01:00
|
|
|
|
//
|
|
|
|
|
|
// --[ 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/>.
|
|
|
|
|
|
//
|
|
|
|
|
|
// ----------------------------------------------------------------------------
|
2020-12-31 23:08:23 +00:00
|
|
|
|
// Copyright © 2011-2021 Natalia Portillo
|
2017-09-28 15:44:21 +01:00
|
|
|
|
// ****************************************************************************/
|
2017-12-19 03:50:57 +00:00
|
|
|
|
|
2017-09-28 15:44:21 +01:00
|
|
|
|
using System.IO;
|
2020-02-27 00:33:26 +00:00
|
|
|
|
using Aaru.CommonTypes;
|
2021-03-02 00:35:16 +00:00
|
|
|
|
using Aaru.CommonTypes.Interfaces;
|
2017-09-28 15:44:21 +01:00
|
|
|
|
using NUnit.Framework;
|
|
|
|
|
|
|
2020-02-27 00:33:26 +00:00
|
|
|
|
namespace Aaru.Tests.Images
|
2017-09-28 15:44:21 +01:00
|
|
|
|
{
|
|
|
|
|
|
[TestFixture]
|
2021-03-02 00:35:16 +00:00
|
|
|
|
public class Apple2Mg : BlockMediaImageTest
|
2017-09-28 15:44:21 +01:00
|
|
|
|
{
|
2021-03-03 14:31:56 +00:00
|
|
|
|
public override string DataFolder => Path.Combine(Consts.TEST_FILES_ROOT, "Media image formats", "2mg");
|
|
|
|
|
|
public override IMediaImage _plugin => new DiscImages.Apple2Mg();
|
2017-09-28 15:44:21 +01:00
|
|
|
|
|
2021-03-02 02:59:20 +00:00
|
|
|
|
public override BlockImageTestExpected[] Tests => new[]
|
2017-12-19 20:33:03 +00:00
|
|
|
|
{
|
2021-03-02 02:59:20 +00:00
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "blank140.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "7db5d585270ab858043d50e60068d45f"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos32.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple32SS,
|
|
|
|
|
|
Sectors = 455,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "906c1bdbf76bf089ea47aae98151df5d",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 455
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos32_alt.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple32SS,
|
|
|
|
|
|
Sectors = 455,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "76f8fe4c5bc1976f99641ad7cdf53109",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 455
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos33_dic.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "0ffcbd4180306192726926b43755db2f",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 560
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos33-do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "91d020725d081500caa1fd8aad959397",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 560
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos33-nib.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "91d020725d081500caa1fd8aad959397",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 560
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos33_nib.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "0ffcbd4180306192726926b43755db2f",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 560
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos33-po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "91d020725d081500caa1fd8aad959397",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 560
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "dos33_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
2021-07-13 20:05:28 +01:00
|
|
|
|
MD5 = "0ffcbd4180306192726926b43755db2f",
|
|
|
|
|
|
Partitions = new[]
|
|
|
|
|
|
{
|
|
|
|
|
|
new BlockPartitionVolumes
|
|
|
|
|
|
{
|
|
|
|
|
|
Start = 0,
|
|
|
|
|
|
Length = 560
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
2021-03-02 02:59:20 +00:00
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "hfs1440.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.DOS_35_HD,
|
|
|
|
|
|
Sectors = 2880,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "535648d1f9838b695403f2f48d5ac94c"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "hfs800_dic.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "2762f41d0379b476042fc62891baac84"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "hfs_do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "2762f41d0379b476042fc62891baac84"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "hfs_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "2762f41d0379b476042fc62891baac84"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "modified_do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "b748f6df3e60e7169d42ec6fcc857ea4"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "modified_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "b748f6df3e60e7169d42ec6fcc857ea4"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "pascal800_do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "dbd0ec8a3126236910709faf923adcf2"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "pascal800_p.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "dbd0ec8a3126236910709faf923adcf2"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "pascal_dic.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "4c4926103a32ac15f7e430ec3ced4be5"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "pascal_do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "4c4926103a32ac15f7e430ec3ced4be5"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "pascal_nib.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "4c4926103a32ac15f7e430ec3ced4be5"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "pascal_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "4c4926103a32ac15f7e430ec3ced4be5"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos1440.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.DOS_35_HD,
|
|
|
|
|
|
Sectors = 2880,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "eb9b60c78b30d2b6541ed0781944b6da"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos1440_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.DOS_35_HD,
|
|
|
|
|
|
Sectors = 2880,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "1fe841b418ede51133878641e01544b5"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos5mb.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Unknown,
|
|
|
|
|
|
Sectors = 10240,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "b156441e159a625ee00a0659dfb6e2f8"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos5m_dic.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Unknown,
|
|
|
|
|
|
Sectors = 10240,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "b156441e159a625ee00a0659dfb6e2f8"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos800_dic.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "fcf747bd356b48d442ff74adb8f3516b"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos800_do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "fcf747bd356b48d442ff74adb8f3516b"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos800_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.AppleSonyDS,
|
|
|
|
|
|
Sectors = 1600,
|
|
|
|
|
|
SectorSize = 512,
|
|
|
|
|
|
MD5 = "fcf747bd356b48d442ff74adb8f3516b"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos_dic.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "11ef56c80c94347d2e3f921d5c36c8de"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos_do.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "11ef56c80c94347d2e3f921d5c36c8de"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos_nib.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "11ef56c80c94347d2e3f921d5c36c8de"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos_po.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "11ef56c80c94347d2e3f921d5c36c8de"
|
|
|
|
|
|
},
|
|
|
|
|
|
new BlockImageTestExpected
|
|
|
|
|
|
{
|
|
|
|
|
|
TestFile = "prodos.2mg.lz",
|
|
|
|
|
|
MediaType = MediaType.Apple33SS,
|
|
|
|
|
|
Sectors = 560,
|
|
|
|
|
|
SectorSize = 256,
|
|
|
|
|
|
MD5 = "6f692a8fadfaa243d9f2d8d41f0e4cad"
|
|
|
|
|
|
}
|
2017-09-28 15:44:21 +01:00
|
|
|
|
};
|
|
|
|
|
|
}
|
2017-12-19 20:33:03 +00:00
|
|
|
|
}
|