Files
Aaru/Aaru.Tests/Images/IsoBuster/Cuesheet.cs

1151 lines
38 KiB
C#

// /***************************************************************************
// Aaru Data Preservation Suite
// ----------------------------------------------------------------------------
//
// Filename : IsoBusterCuesheet.cs
// Author(s) : Natalia Portillo <claunia@claunia.com>
//
// Component : Aaru unit testing.
//
// --[ 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 © 2011-2025 Natalia Portillo
// ****************************************************************************/
using System.IO;
using Aaru.CommonTypes;
using Aaru.CommonTypes.Interfaces;
using Aaru.Images;
using NUnit.Framework;
namespace Aaru.Tests.Images.IsoBuster;
[TestFixture]
public class Cuesheet : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "IsoBuster", "Cuesheet");
public override IMediaImage Plugin => new CdrWin();
public override OpticalImageTestExpected[] Tests =>
[
new OpticalImageTestExpected
{
TestFile = "gigarec.cue",
MediaType = MediaType.CDROM,
Sectors = 469652,
Md5 = "b7659466b925296a36390c58c480e4bb",
LongMd5 = "51bf2c54fee363520906709cc42a710a",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 469651,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 469652,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "New Volume"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "jaguarcd.cue",
MediaType = MediaType.CDDA,
Sectors = 243587,
Md5 = "e20824bc6258d8434096c84548f1c4cf",
LongMd5 = "e20824bc6258d8434096c84548f1c4cf",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 16239,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 27490,
End = 28236,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 28237,
End = 78891,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 78892,
End = 100053,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 100054,
End = 133202,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 133203,
End = 160907,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 160908,
End = 181465,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 181466,
End = 202023,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 202024,
End = 222581,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 222582,
End = 243139,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 243140,
End = 243586,
Pregap = 0,
Flags = 0
}
]
},
new OpticalImageTestExpected
{
TestFile = "pcengine.cue",
MediaType = MediaType.CD,
Sectors = 160956,
Md5 = "989122b6c1f0fc135ee6d481bc347295",
LongMd5 = "2f58bc40012040bd3c9e4ae56fbbfad3",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 3589,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 3440,
End = 38613,
Pregap = 150,
Flags = 4,
Number = 2,
FileSystems =
[
new FileSystemTest
{
Clusters = 34816,
ClusterSize = 2048,
Type = "pcengine"
}
]
},
new TrackInfoTestExpected
{
Session = 1,
Start = 38614,
End = 47216,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 47217,
End = 53500,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 53501,
End = 61818,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 61819,
End = 68562,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 68563,
End = 75396,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 75397,
End = 83129,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 83130,
End = 86480,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 86481,
End = 91266,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 91267,
End = 99273,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 99274,
End = 106692,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 106693,
End = 112237,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 112238,
End = 120269,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 120270,
End = 126228,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 126229,
End = 160955,
Pregap = 0,
Flags = 4
}
]
},
new OpticalImageTestExpected
{
TestFile = "pcfx.cue",
MediaType = MediaType.CD,
Sectors = 246680,
Md5 = "0034c2e54afd76387797c7221c4a054b",
LongMd5 = "77a9dcd8f5a69d939e076e45602923e0",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 4394,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 4245,
End = 4908,
Pregap = 150,
Flags = 4,
Number = 2,
FileSystems =
[
new FileSystemTest
{
Bootable = true,
Clusters = 514,
ClusterSize = 2048,
Type = "pcfx",
VolumeName = "同級生2"
}
]
},
new TrackInfoTestExpected
{
Session = 1,
Start = 4909,
End = 5940,
Pregap = 0,
Flags = 4
},
new TrackInfoTestExpected
{
Session = 1,
Start = 5941,
End = 42058,
Pregap = 0,
Flags = 4
},
new TrackInfoTestExpected
{
Session = 1,
Start = 42059,
End = 220794,
Pregap = 0,
Flags = 4
},
new TrackInfoTestExpected
{
Session = 1,
Start = 220795,
End = 225645,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 225646,
End = 235497,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 235498,
End = 246679,
Pregap = 0,
Flags = 0
}
]
},
new OpticalImageTestExpected
{
TestFile = "report_cdr.cue",
MediaType = MediaType.CDROM,
Sectors = 254265,
Md5 = "aacfe792d28a17f641c7218ccd35f5ff",
LongMd5 = "73e38276225ec2d26c0ace10d42513e1",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 254264,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 63562,
ClusterSize = 8192,
Type = "hfs",
VolumeName = "Winpower"
},
new FileSystemTest
{
Clusters = 254265,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Winpower"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "report_cdrom.cue",
MediaType = MediaType.CDROM,
Sectors = 254265,
Md5 = "bf4bbec517101d0d6f45d2e4d50cb875",
LongMd5 = "3d3f9cf7d1ba2249b1e7960071e5af46",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 254264,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 63562,
ClusterSize = 8192,
Type = "hfs",
VolumeName = "Winpower"
},
new FileSystemTest
{
Clusters = 254265,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Winpower"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "report_cdrw.cue",
MediaType = MediaType.CDRW,
Sectors = 308224,
Md5 = "1e55aa420ca8f8ea77d5b597c9cfc19b",
LongMd5 = "3af5f943ddb9427d9c63a4ce3b704db9",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 308223,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Bootable = true,
Clusters = 308224,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "ARCH_201901"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_audiocd_cdtext.cue",
MediaType = MediaType.CDDA,
Sectors = 277696,
Md5 = "b236def899758bd04b8a3105b47126db",
LongMd5 = "b236def899758bd04b8a3105b47126db",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 29901,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 29752,
End = 65183,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 65184,
End = 78575,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 78576,
End = 95229,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 95230,
End = 126296,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 126297,
End = 155108,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 155109,
End = 191834,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 191835,
End = 222925,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 222926,
End = 243587,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 243588,
End = 269749,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 269750,
End = 277695,
Pregap = 150,
Flags = 0
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_enhancedcd.cue",
MediaType = MediaType.CDPLUS,
Sectors = 59206,
Md5 = "04b7bcd252635eaa8e6b21c1597d44ba",
LongMd5 = "b480c86b959c246294a2cc4ad3180cbf",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 14254,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 14255,
End = 28952,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 2,
Start = 40203,
End = 59205,
Pregap = 150,
Flags = 4,
Number = 3,
FileSystems =
[
new FileSystemTest
{
Clusters = 18853,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "New"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_incd_udf200_finalized.cue",
MediaType = MediaType.CDROMXA,
Sectors = 350134,
Md5 = "7b3e4a952c369cd4837cee40f1a567f2",
LongMd5 = "d6555969dd70fb2772cd5b979c6fa284",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 350133,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 600,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "INCD"
},
new FileSystemTest
{
Clusters = 402107,
ClusterSize = 2048,
Type = "udf",
VolumeName = "InCD",
VolumeSerial = "40888C15CA13D401InCD"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_multi_karaoke_sampler.cue",
MediaType = MediaType.CDROMXA,
Sectors = 329158,
Md5 = "546f85b167c61c2e80dec709f4a4bfb5",
LongMd5 = "82e40f2e2e36a1ec2eeb89ea154aa7f3",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 1886,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 1587,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = ""
}
]
},
new TrackInfoTestExpected
{
Session = 1,
Start = 1737,
End = 32748,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 32749,
End = 52671,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 52672,
End = 70303,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 70304,
End = 100097,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 100098,
End = 119760,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 119761,
End = 136998,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 136999,
End = 155789,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 155790,
End = 175825,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 175826,
End = 206460,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 206461,
End = 226449,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 226450,
End = 244354,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 244355,
End = 273964,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 273965,
End = 293751,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 293752,
End = 310710,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 310711,
End = 329157,
Pregap = 150,
Flags = 0
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_multiple_indexes.cue",
MediaType = MediaType.CDDA,
Sectors = 65536,
Md5 = "4bc4eb89184a69d902ecc1f2745ecf32",
LongMd5 = "4bc4eb89184a69d902ecc1f2745ecf32",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 4803,
Pregap = 150,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 4654,
End = 13874,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 13875,
End = 41184,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 41185,
End = 54988,
Pregap = 0,
Flags = 0
},
new TrackInfoTestExpected
{
Session = 1,
Start = 54989,
End = 65535,
Pregap = 150,
Flags = 0
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_multisession.cue",
MediaType = MediaType.CDROMXA,
Sectors = 51168,
Md5 = "671f5b747692780a979b3c4b59b39597",
LongMd5 = "4171f86df9f3b8c277958324a48c54d8",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 8132,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 7876,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Session 1"
},
new FileSystemTest
{
Clusters = 9340,
ClusterSize = 2048,
Type = "udf",
VolumeName = "Session 1",
VolumeSerial = "50958B61AF6A749E"
}
]
},
new TrackInfoTestExpected
{
Session = 2,
Start = 19383,
End = 25959,
Pregap = 150,
Flags = 4,
Number = 2,
FileSystems =
[
new FileSystemTest
{
Clusters = 6170,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Session 2"
},
new FileSystemTest
{
Clusters = 7381,
ClusterSize = 2048,
Type = "udf",
VolumeName = "Session 2",
VolumeSerial = "50958BBBAF6A7444"
}
]
},
new TrackInfoTestExpected
{
Session = 3,
Start = 32710,
End = 38477,
Pregap = 150,
Flags = 4,
Number = 3,
FileSystems =
[
new FileSystemTest
{
Clusters = 5360,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Session 3"
},
new FileSystemTest
{
Clusters = 6451,
ClusterSize = 2048,
Type = "udf",
VolumeName = "Session 3",
VolumeSerial = "50958C19AF6A73E6"
}
]
},
new TrackInfoTestExpected
{
Session = 4,
Start = 45228,
End = 51167,
Pregap = 150,
Flags = 4,
Number = 4,
FileSystems =
[
new FileSystemTest
{
Clusters = 45796,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Session 4"
},
new FileSystemTest
{
Clusters = 6649,
ClusterSize = 2048,
Type = "udf",
VolumeName = "Session 4",
VolumeSerial = "50958C82AF6A737D"
}
]
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_multisession_dvd+r.cue",
MediaType = MediaType.DVDPRDL,
Sectors = 230624,
Md5 = "020993315e49ab0d36bc7248819162ea",
LongMd5 = "020993315e49ab0d36bc7248819162ea",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 24063,
Pregap = 0,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 22016,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Session 1"
}
]
},
new TrackInfoTestExpected
{
Session = 2,
Start = 24064,
End = 230623,
Pregap = 0 /*,Number = 2,
FileSystems = new[]
{
new FileSystemTest
{
Clusters = 222,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = ""
}
}*/
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_multisession_dvd-r.cue",
MediaType = MediaType.DVDR,
Sectors = 257264,
Md5 = "dff8f2107a4ea9633a88ce38ff609b8e",
LongMd5 = "dff8f2107a4ea9633a88ce38ff609b8e",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 235247,
Pregap = 0,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 206560,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "Session 1"
}
]
},
new TrackInfoTestExpected
{
Session = 2,
Start = 235248,
End = 257263,
Pregap = 0 /*,Number = 2,
FileSystems = new[]
{
new FileSystemTest
{
Clusters = 222,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = ""
}
}*/
}
]
},
new OpticalImageTestExpected
{
TestFile = "test_videocd.cue",
MediaType = MediaType.CDROMXA,
Sectors = 48794,
Md5 = "22d646f182b79efcf8915fd01f484391",
LongMd5 = "72243676a71ff7a3161dce368d3ddc71",
Tracks =
[
new TrackInfoTestExpected
{
Session = 1,
Start = 0,
End = 1099,
Pregap = 150,
Flags = 4,
Number = 1,
FileSystems =
[
new FileSystemTest
{
Clusters = 1102,
ClusterSize = 2048,
Type = "iso9660",
VolumeName = "VIDEOCD"
}
]
},
new TrackInfoTestExpected
{
Session = 1,
Start = 1100,
End = 48793,
Pregap = 152,
Flags = 4
}
]
}
];
}