diff --git a/Aaru.Tests/Aaru.Tests.csproj b/Aaru.Tests/Aaru.Tests.csproj
index 08fa93f8d..62cdd33c8 100644
--- a/Aaru.Tests/Aaru.Tests.csproj
+++ b/Aaru.Tests/Aaru.Tests.csproj
@@ -16,21 +16,21 @@
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
-
-
+
+
+
+
+
+
diff --git a/Aaru.Tests/Aaru.Tests.csproj.DotSettings b/Aaru.Tests/Aaru.Tests.csproj.DotSettings
index 29151f92c..50c5847b4 100644
--- a/Aaru.Tests/Aaru.Tests.csproj.DotSettings
+++ b/Aaru.Tests/Aaru.Tests.csproj.DotSettings
@@ -1,5 +1,6 @@
-
True
\ No newline at end of file
+ x:Key="/Default/CodeInspection/NamespaceProvider/NamespaceFoldersToSkip/=localization/@EntryIndexedValue">True
\ No newline at end of file
diff --git a/Aaru.Tests/Checksums/Adler32.cs b/Aaru.Tests/Checksums/Adler32.cs
index f54c0941c..c4028401c 100644
--- a/Aaru.Tests/Checksums/Adler32.cs
+++ b/Aaru.Tests/Checksums/Adler32.cs
@@ -38,40 +38,25 @@ namespace Aaru.Tests.Checksums;
[TestFixture]
public class Adler32
{
- static readonly byte[] _expectedEmpty =
- {
- 0x00, 0xf0, 0x00, 0x01
- };
+ static readonly byte[] _expectedEmpty = { 0x00, 0xf0, 0x00, 0x01 };
static readonly byte[] _expectedRandom =
{
// ReSharper disable once UseUtf8StringLiteral
0x37, 0x28, 0xd1, 0x86
};
- static readonly byte[] _expectedRandom15 =
- {
- 0x34, 0xDC, 0x06, 0x7D
- };
+ static readonly byte[] _expectedRandom15 = { 0x34, 0xDC, 0x06, 0x7D };
- static readonly byte[] _expectedRandom31 =
- {
- 0xD8, 0xF1, 0x0E, 0xAA
- };
+ static readonly byte[] _expectedRandom31 = { 0xD8, 0xF1, 0x0E, 0xAA };
- static readonly byte[] _expectedRandom63 =
- {
- 0xD8, 0xAC, 0x20, 0x81
- };
+ static readonly byte[] _expectedRandom63 = { 0xD8, 0xAC, 0x20, 0x81 };
- static readonly byte[] _expectedRandom2352 =
- {
- 0xEC, 0xD1, 0x73, 0x8B
- };
+ static readonly byte[] _expectedRandom2352 = { 0xEC, 0xD1, 0x73, 0x8B };
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -93,7 +78,7 @@ public class Adler32
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -107,10 +92,78 @@ public class Adler32
result.Should().BeEquivalentTo(_expectedEmpty);
}
+ [Test]
+ public void PartialInstanceAuto15()
+ {
+ var data = new byte[15];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 15);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Adler32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom15);
+ }
+
+ [Test]
+ public void PartialInstanceAuto2352()
+ {
+ var data = new byte[2352];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 2352);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Adler32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom2352);
+ }
+
+ [Test]
+ public void PartialInstanceAuto31()
+ {
+ var data = new byte[31];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 31);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Adler32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom31);
+ }
+
+ [Test]
+ public void PartialInstanceAuto63()
+ {
+ var data = new byte[63];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 63);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Adler32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom63);
+ }
+
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -132,7 +185,7 @@ public class Adler32
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -145,72 +198,4 @@ public class Adler32
byte[] result = ctx.Final();
result.Should().BeEquivalentTo(_expectedRandom);
}
-
- [Test]
- public void PartialInstanceAuto15()
- {
- byte[] data = new byte[15];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 15);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Adler32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom15);
- }
-
- [Test]
- public void PartialInstanceAuto31()
- {
- byte[] data = new byte[31];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 31);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Adler32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom31);
- }
-
- [Test]
- public void PartialInstanceAuto63()
- {
- byte[] data = new byte[63];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 63);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Adler32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom63);
- }
-
- [Test]
- public void PartialInstanceAuto2352()
- {
- byte[] data = new byte[2352];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 2352);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Adler32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom2352);
- }
}
\ No newline at end of file
diff --git a/Aaru.Tests/Checksums/CRC16CCITT.cs b/Aaru.Tests/Checksums/CRC16CCITT.cs
index f5d6343ab..daef7bb32 100644
--- a/Aaru.Tests/Checksums/CRC16CCITT.cs
+++ b/Aaru.Tests/Checksums/CRC16CCITT.cs
@@ -37,36 +37,21 @@ namespace Aaru.Tests.Checksums;
[TestFixture]
public class Crc16Ccitt
{
- static readonly byte[] _expectedEmpty =
- {
- 0xFF, 0xFF
- };
+ static readonly byte[] _expectedEmpty = { 0xFF, 0xFF };
static readonly byte[] _expectedRandom =
{
// ReSharper disable once UseUtf8StringLiteral
0x36, 0x40
};
- static readonly byte[] _expectedRandom15 =
- {
- 0x16, 0x6e
- };
- static readonly byte[] _expectedRandom31 =
- {
- 0xd0, 0x16
- };
- static readonly byte[] _expectedRandom63 =
- {
- 0x73, 0xc4
- };
- static readonly byte[] _expectedRandom2352 =
- {
- 0x19, 0x46
- };
+ static readonly byte[] _expectedRandom15 = { 0x16, 0x6e };
+ static readonly byte[] _expectedRandom31 = { 0xd0, 0x16 };
+ static readonly byte[] _expectedRandom63 = { 0x73, 0xc4 };
+ static readonly byte[] _expectedRandom2352 = { 0x19, 0x46 };
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -89,7 +74,7 @@ public class Crc16Ccitt
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -103,10 +88,78 @@ public class Crc16Ccitt
result.Should().BeEquivalentTo(_expectedEmpty);
}
+ [Test]
+ public void PartialInstance15()
+ {
+ var data = new byte[15];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 15);
+ fs.Close();
+ fs.Dispose();
+ var ctx = new CRC16CCITTContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom15);
+ }
+
+ [Test]
+ public void PartialInstance2352()
+ {
+ var data = new byte[2352];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 2352);
+ fs.Close();
+ fs.Dispose();
+ var ctx = new CRC16CCITTContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom2352);
+ }
+
+ [Test]
+ public void PartialInstance31()
+ {
+ var data = new byte[31];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 31);
+ fs.Close();
+ fs.Dispose();
+ var ctx = new CRC16CCITTContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom31);
+ }
+
+ [Test]
+ public void PartialInstance63()
+ {
+ var data = new byte[63];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 63);
+ fs.Close();
+ fs.Dispose();
+ var ctx = new CRC16CCITTContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom63);
+ }
+
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -129,7 +182,7 @@ public class Crc16Ccitt
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -142,72 +195,4 @@ public class Crc16Ccitt
byte[] result = ctx.Final();
result.Should().BeEquivalentTo(_expectedRandom);
}
-
- [Test]
- public void PartialInstance15()
- {
- byte[] data = new byte[15];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 15);
- fs.Close();
- fs.Dispose();
- var ctx = new CRC16CCITTContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom15);
- }
-
- [Test]
- public void PartialInstance31()
- {
- byte[] data = new byte[31];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 31);
- fs.Close();
- fs.Dispose();
- var ctx = new CRC16CCITTContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom31);
- }
-
- [Test]
- public void PartialInstance63()
- {
- byte[] data = new byte[63];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 63);
- fs.Close();
- fs.Dispose();
- var ctx = new CRC16CCITTContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom63);
- }
-
- [Test]
- public void PartialInstance2352()
- {
- byte[] data = new byte[2352];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 2352);
- fs.Close();
- fs.Dispose();
- var ctx = new CRC16CCITTContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom2352);
- }
}
\ No newline at end of file
diff --git a/Aaru.Tests/Checksums/CRC16IBM.cs b/Aaru.Tests/Checksums/CRC16IBM.cs
index 3f6102adb..8c335608f 100644
--- a/Aaru.Tests/Checksums/CRC16IBM.cs
+++ b/Aaru.Tests/Checksums/CRC16IBM.cs
@@ -38,36 +38,21 @@ namespace Aaru.Tests.Checksums;
[TestFixture]
public class Crc16Ibm
{
- static readonly byte[] _expectedEmpty =
- {
- 0x00, 0x00
- };
+ static readonly byte[] _expectedEmpty = { 0x00, 0x00 };
static readonly byte[] _expectedRandom =
{
// ReSharper disable once UseUtf8StringLiteral
0x2d, 0x6d
};
- static readonly byte[] _expectedRandom15 =
- {
- 0x72, 0xa6
- };
- static readonly byte[] _expectedRandom31 =
- {
- 0xf4, 0x9e
- };
- static readonly byte[] _expectedRandom63 =
- {
- 0xfb, 0xd9
- };
- static readonly byte[] _expectedRandom2352 =
- {
- 0x23, 0xf4
- };
+ static readonly byte[] _expectedRandom15 = { 0x72, 0xa6 };
+ static readonly byte[] _expectedRandom31 = { 0xf4, 0x9e };
+ static readonly byte[] _expectedRandom63 = { 0xfb, 0xd9 };
+ static readonly byte[] _expectedRandom2352 = { 0x23, 0xf4 };
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -90,7 +75,7 @@ public class Crc16Ibm
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -104,10 +89,78 @@ public class Crc16Ibm
result.Should().BeEquivalentTo(_expectedEmpty);
}
+ [Test]
+ public void PartialInstance15()
+ {
+ var data = new byte[15];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 15);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new CRC16IBMContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom15);
+ }
+
+ [Test]
+ public void PartialInstance2352()
+ {
+ var data = new byte[2352];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 2352);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new CRC16IBMContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom2352);
+ }
+
+ [Test]
+ public void PartialInstance31()
+ {
+ var data = new byte[31];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 31);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new CRC16IBMContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom31);
+ }
+
+ [Test]
+ public void PartialInstance63()
+ {
+ var data = new byte[63];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 63);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new CRC16IBMContext();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom63);
+ }
+
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -130,7 +183,7 @@ public class Crc16Ibm
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -143,72 +196,4 @@ public class Crc16Ibm
byte[] result = ctx.Final();
result.Should().BeEquivalentTo(_expectedRandom);
}
-
- [Test]
- public void PartialInstance15()
- {
- byte[] data = new byte[15];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 15);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new CRC16IBMContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom15);
- }
-
- [Test]
- public void PartialInstance31()
- {
- byte[] data = new byte[31];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 31);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new CRC16IBMContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom31);
- }
-
- [Test]
- public void PartialInstance63()
- {
- byte[] data = new byte[63];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 63);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new CRC16IBMContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom63);
- }
-
- [Test]
- public void PartialInstance2352()
- {
- byte[] data = new byte[2352];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 2352);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new CRC16IBMContext();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom2352);
- }
}
\ No newline at end of file
diff --git a/Aaru.Tests/Checksums/CRC32.cs b/Aaru.Tests/Checksums/CRC32.cs
index 06dba8b9d..c2f05987b 100644
--- a/Aaru.Tests/Checksums/CRC32.cs
+++ b/Aaru.Tests/Checksums/CRC32.cs
@@ -38,36 +38,21 @@ namespace Aaru.Tests.Checksums;
[TestFixture]
public class Crc32
{
- static readonly byte[] _expectedEmpty =
- {
- 0xa7, 0x38, 0xea, 0x1c
- };
+ static readonly byte[] _expectedEmpty = { 0xa7, 0x38, 0xea, 0x1c };
static readonly byte[] _expectedRandom =
{
// ReSharper disable once UseUtf8StringLiteral
0x2b, 0x6e, 0x68, 0x54
};
- static readonly byte[] _expectedRandom15 =
- {
- 0xad, 0x6d, 0xa7, 0x27
- };
- static readonly byte[] _expectedRandom31 =
- {
- 0xa2, 0xad, 0x2f, 0xaa
- };
- static readonly byte[] _expectedRandom63 =
- {
- 0xbf, 0xf6, 0xa3, 0x41
- };
- static readonly byte[] _expectedRandom2352 =
- {
- 0x08, 0xba, 0x93, 0xea
- };
+ static readonly byte[] _expectedRandom15 = { 0xad, 0x6d, 0xa7, 0x27 };
+ static readonly byte[] _expectedRandom31 = { 0xa2, 0xad, 0x2f, 0xaa };
+ static readonly byte[] _expectedRandom63 = { 0xbf, 0xf6, 0xa3, 0x41 };
+ static readonly byte[] _expectedRandom2352 = { 0x08, 0xba, 0x93, 0xea };
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -89,7 +74,7 @@ public class Crc32
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -103,10 +88,78 @@ public class Crc32
result.Should().BeEquivalentTo(_expectedEmpty);
}
+ [Test]
+ public void PartialInstance15()
+ {
+ var data = new byte[15];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 15);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom15);
+ }
+
+ [Test]
+ public void PartialInstance2352()
+ {
+ var data = new byte[2352];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 2352);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom2352);
+ }
+
+ [Test]
+ public void PartialInstance31()
+ {
+ var data = new byte[31];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 31);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom31);
+ }
+
+ [Test]
+ public void PartialInstance63()
+ {
+ var data = new byte[63];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 63);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc32Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom63);
+ }
+
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -128,7 +181,7 @@ public class Crc32
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -141,72 +194,4 @@ public class Crc32
byte[] result = ctx.Final();
result.Should().BeEquivalentTo(_expectedRandom);
}
-
- [Test]
- public void PartialInstance15()
- {
- byte[] data = new byte[15];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 15);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom15);
- }
-
- [Test]
- public void PartialInstance31()
- {
- byte[] data = new byte[31];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 31);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom31);
- }
-
- [Test]
- public void PartialInstance63()
- {
- byte[] data = new byte[63];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 63);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom63);
- }
-
- [Test]
- public void PartialInstance2352()
- {
- byte[] data = new byte[2352];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 2352);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc32Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom2352);
- }
}
\ No newline at end of file
diff --git a/Aaru.Tests/Checksums/CRC64.cs b/Aaru.Tests/Checksums/CRC64.cs
index 65c674adc..4a2e8a64d 100644
--- a/Aaru.Tests/Checksums/CRC64.cs
+++ b/Aaru.Tests/Checksums/CRC64.cs
@@ -38,35 +38,17 @@ namespace Aaru.Tests.Checksums;
[TestFixture]
public class Crc64
{
- static readonly byte[] _expectedEmpty =
- {
- 0x60, 0x6b, 0x70, 0xa2, 0x3e, 0xba, 0xf6, 0xc2
- };
- static readonly byte[] _expectedRandom =
- {
- 0xbf, 0x09, 0x99, 0x2c, 0xc5, 0xed, 0xe3, 0x8e
- };
- static readonly byte[] _expectedRandom15 =
- {
- 0x79, 0x7F, 0x37, 0x66, 0xFD, 0x93, 0x97, 0x5B
- };
- static readonly byte[] _expectedRandom31 =
- {
- 0xCD, 0x92, 0x01, 0x90, 0x5A, 0x79, 0x37, 0xFD
- };
- static readonly byte[] _expectedRandom63 =
- {
- 0x29, 0xF3, 0x31, 0xFC, 0x90, 0x70, 0x2B, 0xF4
- };
- static readonly byte[] _expectedRandom2352 =
- {
- 0x12, 0x64, 0x35, 0xDB, 0x43, 0x47, 0x76, 0x23
- };
+ static readonly byte[] _expectedEmpty = { 0x60, 0x6b, 0x70, 0xa2, 0x3e, 0xba, 0xf6, 0xc2 };
+ static readonly byte[] _expectedRandom = { 0xbf, 0x09, 0x99, 0x2c, 0xc5, 0xed, 0xe3, 0x8e };
+ static readonly byte[] _expectedRandom15 = { 0x79, 0x7F, 0x37, 0x66, 0xFD, 0x93, 0x97, 0x5B };
+ static readonly byte[] _expectedRandom31 = { 0xCD, 0x92, 0x01, 0x90, 0x5A, 0x79, 0x37, 0xFD };
+ static readonly byte[] _expectedRandom63 = { 0x29, 0xF3, 0x31, 0xFC, 0x90, 0x70, 0x2B, 0xF4 };
+ static readonly byte[] _expectedRandom2352 = { 0x12, 0x64, 0x35, 0xDB, 0x43, 0x47, 0x76, 0x23 };
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -88,7 +70,7 @@ public class Crc64
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -102,10 +84,78 @@ public class Crc64
result.Should().BeEquivalentTo(_expectedEmpty);
}
+ [Test]
+ public void PartialInstance15()
+ {
+ var data = new byte[15];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 15);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc64Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom15);
+ }
+
+ [Test]
+ public void PartialInstance2352()
+ {
+ var data = new byte[2352];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 2352);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc64Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom2352);
+ }
+
+ [Test]
+ public void PartialInstance31()
+ {
+ var data = new byte[31];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 31);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc64Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom31);
+ }
+
+ [Test]
+ public void PartialInstance63()
+ {
+ var data = new byte[63];
+
+ var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
+ FileAccess.Read);
+
+ fs.EnsureRead(data, 0, 63);
+ fs.Close();
+ fs.Dispose();
+ IChecksum ctx = new Crc64Context();
+ ctx.Update(data);
+ byte[] result = ctx.Final();
+ result.Should().BeEquivalentTo(_expectedRandom63);
+ }
+
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -127,7 +177,7 @@ public class Crc64
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -140,72 +190,4 @@ public class Crc64
byte[] result = ctx.Final();
result.Should().BeEquivalentTo(_expectedRandom);
}
-
- [Test]
- public void PartialInstance15()
- {
- byte[] data = new byte[15];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 15);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc64Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom15);
- }
-
- [Test]
- public void PartialInstance31()
- {
- byte[] data = new byte[31];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 31);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc64Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom31);
- }
-
- [Test]
- public void PartialInstance63()
- {
- byte[] data = new byte[63];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 63);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc64Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom63);
- }
-
- [Test]
- public void PartialInstance2352()
- {
- byte[] data = new byte[2352];
-
- var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
- FileAccess.Read);
-
- fs.EnsureRead(data, 0, 2352);
- fs.Close();
- fs.Dispose();
- IChecksum ctx = new Crc64Context();
- ctx.Update(data);
- byte[] result = ctx.Final();
- result.Should().BeEquivalentTo(_expectedRandom2352);
- }
}
\ No newline at end of file
diff --git a/Aaru.Tests/Checksums/MD5.cs b/Aaru.Tests/Checksums/MD5.cs
index 79f40af42..38b71bc01 100644
--- a/Aaru.Tests/Checksums/MD5.cs
+++ b/Aaru.Tests/Checksums/MD5.cs
@@ -50,7 +50,7 @@ public class Md5
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -72,7 +72,7 @@ public class Md5
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -89,7 +89,7 @@ public class Md5
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -111,7 +111,7 @@ public class Md5
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
diff --git a/Aaru.Tests/Checksums/SHA1.cs b/Aaru.Tests/Checksums/SHA1.cs
index ddf857445..914a63885 100644
--- a/Aaru.Tests/Checksums/SHA1.cs
+++ b/Aaru.Tests/Checksums/SHA1.cs
@@ -52,7 +52,7 @@ public class Sha1
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -74,7 +74,7 @@ public class Sha1
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -91,7 +91,7 @@ public class Sha1
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -113,7 +113,7 @@ public class Sha1
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
diff --git a/Aaru.Tests/Checksums/SHA256.cs b/Aaru.Tests/Checksums/SHA256.cs
index 7c8ec22bd..fb8560817 100644
--- a/Aaru.Tests/Checksums/SHA256.cs
+++ b/Aaru.Tests/Checksums/SHA256.cs
@@ -52,7 +52,7 @@ public class Sha256
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -74,7 +74,7 @@ public class Sha256
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -91,7 +91,7 @@ public class Sha256
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -113,7 +113,7 @@ public class Sha256
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
diff --git a/Aaru.Tests/Checksums/SHA384.cs b/Aaru.Tests/Checksums/SHA384.cs
index b5da676fa..7277f2e3b 100644
--- a/Aaru.Tests/Checksums/SHA384.cs
+++ b/Aaru.Tests/Checksums/SHA384.cs
@@ -54,7 +54,7 @@ public class Sha384
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -76,7 +76,7 @@ public class Sha384
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -93,7 +93,7 @@ public class Sha384
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -115,7 +115,7 @@ public class Sha384
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
diff --git a/Aaru.Tests/Checksums/SHA512.cs b/Aaru.Tests/Checksums/SHA512.cs
index f98a19da4..767331e98 100644
--- a/Aaru.Tests/Checksums/SHA512.cs
+++ b/Aaru.Tests/Checksums/SHA512.cs
@@ -56,7 +56,7 @@ public class Sha512
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -78,7 +78,7 @@ public class Sha512
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -95,7 +95,7 @@ public class Sha512
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -117,7 +117,7 @@ public class Sha512
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
diff --git a/Aaru.Tests/Checksums/SpamSum.cs b/Aaru.Tests/Checksums/SpamSum.cs
index 2880d8dd3..a41e4af67 100644
--- a/Aaru.Tests/Checksums/SpamSum.cs
+++ b/Aaru.Tests/Checksums/SpamSum.cs
@@ -43,7 +43,7 @@ public class SpamSum
[Test]
public void EmptyData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -58,7 +58,7 @@ public class SpamSum
[Test]
public void EmptyInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "empty"), FileMode.Open,
FileAccess.Read);
@@ -75,7 +75,7 @@ public class SpamSum
[Test]
public void RandomData()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
@@ -90,7 +90,7 @@ public class SpamSum
[Test]
public void RandomInstance()
{
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
var fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "Checksum test files", "random"), FileMode.Open,
FileAccess.Read);
diff --git a/Aaru.Tests/Devices/IomegaJaz.cs b/Aaru.Tests/Devices/IomegaJaz.cs
index d0cba8b5e..389f61c08 100644
--- a/Aaru.Tests/Devices/IomegaJaz.cs
+++ b/Aaru.Tests/Devices/IomegaJaz.cs
@@ -40,25 +40,13 @@ namespace Aaru.Tests.Devices;
[TestFixture]
public class IomegaJaz
{
- readonly string[] _testFiles =
- {
- "jaz1.bin.lz"
- };
+ readonly string[] _testFiles = { "jaz1.bin.lz" };
- readonly MediaType[] _mediaTypes =
- {
- MediaType.Jaz
- };
+ readonly MediaType[] _mediaTypes = { MediaType.Jaz };
- readonly ulong[] _sectors =
- {
- 2091050
- };
+ readonly ulong[] _sectors = { 2091050 };
- readonly uint[] _sectorSize =
- {
- 512
- };
+ readonly uint[] _sectorSize = { 512 };
readonly string _dataFolder = Path.Combine(Consts.TestFilesRoot, "Device test dumps", "JAZ");
@@ -69,7 +57,7 @@ public class IomegaJaz
Assert.Multiple(() =>
{
- for(int i = 0; i < _testFiles.Length; i++)
+ for(var i = 0; i < _testFiles.Length; i++)
{
var filter = new LZip();
filter.Open(_testFiles[i]);
@@ -83,6 +71,7 @@ public class IomegaJaz
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(_sectors[i], image.Info.Sectors,
@@ -94,6 +83,7 @@ public class IomegaJaz
Assert.AreEqual(_mediaTypes[i], image.Info.MediaType,
string.Format(Localization.Media_type_0, _testFiles[i]));
});
+ }
}
});
}
diff --git a/Aaru.Tests/Devices/LS120.cs b/Aaru.Tests/Devices/LS120.cs
index ea4b02c77..c39a3c36a 100644
--- a/Aaru.Tests/Devices/LS120.cs
+++ b/Aaru.Tests/Devices/LS120.cs
@@ -40,25 +40,13 @@ namespace Aaru.Tests.Devices;
[TestFixture]
public class Ls120
{
- readonly string[] _testFiles =
- {
- "ls120.bin.lz", "mf2dd.bin.lz", "mf2hd.bin.lz"
- };
+ readonly string[] _testFiles = { "ls120.bin.lz", "mf2dd.bin.lz", "mf2hd.bin.lz" };
- readonly MediaType[] _mediaTypes =
- {
- MediaType.LS120, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD
- };
+ readonly MediaType[] _mediaTypes = { MediaType.LS120, MediaType.DOS_35_DS_DD_9, MediaType.DOS_35_HD };
- readonly ulong[] _sectors =
- {
- 246528, 1440, 2880
- };
+ readonly ulong[] _sectors = { 246528, 1440, 2880 };
- readonly uint[] _sectorSize =
- {
- 512, 512, 512
- };
+ readonly uint[] _sectorSize = { 512, 512, 512 };
readonly string _dataFolder = Path.Combine(Consts.TestFilesRoot, "Device test dumps", "LS-120");
@@ -69,7 +57,7 @@ public class Ls120
Assert.Multiple(() =>
{
- for(int i = 0; i < _testFiles.Length; i++)
+ for(var i = 0; i < _testFiles.Length; i++)
{
var filter = new LZip();
filter.Open(_testFiles[i]);
@@ -83,6 +71,7 @@ public class Ls120
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(_sectors[i], image.Info.Sectors,
@@ -94,6 +83,7 @@ public class Ls120
Assert.AreEqual(_mediaTypes[i], image.Info.MediaType,
string.Format(Localization.Media_type_0, _testFiles[i]));
});
+ }
}
});
}
diff --git a/Aaru.Tests/Devices/MultiMediaCard/CID.cs b/Aaru.Tests/Devices/MultiMediaCard/CID.cs
index b17e9d549..cfbcddc41 100644
--- a/Aaru.Tests/Devices/MultiMediaCard/CID.cs
+++ b/Aaru.Tests/Devices/MultiMediaCard/CID.cs
@@ -9,56 +9,34 @@ namespace Aaru.Tests.Devices.MultiMediaCard;
[TestFixture]
public class CID
{
- readonly string[] cards =
- {
- "mmc_6600_32mb", "mmc_pretec_32mb", "mmc_takems_256mb"
- };
+ readonly string[] cards = { "mmc_6600_32mb", "mmc_pretec_32mb", "mmc_takems_256mb" };
readonly string[] cids =
{
"15000030303030303007b20212909701", "06000033324d202020011923a457c601", "2c0000414620484d5010a9000b1a6801"
};
- readonly byte[] manufacturers =
- {
- 0x15, 0x06, 0x2c
- };
+ readonly byte[] manufacturers = { 0x15, 0x06, 0x2c };
- readonly ushort[] applications =
- {
- 0, 0, 0
- };
+ readonly ushort[] applications = { 0, 0, 0 };
- readonly string[] names =
- {
- "000000", "32M ", "AF HMP"
- };
+ readonly string[] names = { "000000", "32M ", "AF HMP" };
- readonly byte[] revisions =
- {
- 0x07, 0x01, 0x10
- };
+ readonly byte[] revisions = { 0x07, 0x01, 0x10 };
- readonly uint[] serials =
- {
- 0xb2021290, 0x1923a457, 0xa9000b1a
- };
+ readonly uint[] serials = { 0xb2021290, 0x1923a457, 0xa9000b1a };
- readonly byte[] dates =
- {
- 0x97, 0xc6, 0x68
- };
+ readonly byte[] dates = { 0x97, 0xc6, 0x68 };
- readonly byte[] crcs =
- {
- 0x00, 0x00, 0x00
- };
+ readonly byte[] crcs = { 0x00, 0x00, 0x00 };
[Test]
public void Test()
{
- for(int i = 0; i < cards.Length; i++)
+ for(var i = 0; i < cards.Length; i++)
+ {
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
int count = Marshal.ConvertFromHexAscii(cids[i], out byte[] response);
@@ -85,5 +63,7 @@ public class CID
Assert.AreEqual(crcs[i], cid.CRC, string.Format(Localization.CRC_0, cards[i]));
});
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Aaru.Tests/Devices/MultiMediaCard/CSD.cs b/Aaru.Tests/Devices/MultiMediaCard/CSD.cs
index 49d4c0387..10876fdd2 100644
--- a/Aaru.Tests/Devices/MultiMediaCard/CSD.cs
+++ b/Aaru.Tests/Devices/MultiMediaCard/CSD.cs
@@ -11,176 +11,82 @@ namespace Aaru.Tests.Devices.MultiMediaCard;
[TestFixture]
public class CSD
{
- readonly string[] cards =
- {
- "mmc_6600_32mb", "mmc_pretec_32mb", "mmc_takems_256mb"
- };
+ readonly string[] cards = { "mmc_6600_32mb", "mmc_pretec_32mb", "mmc_takems_256mb" };
readonly string[] csds =
{
"8c26012a0f5901e9f6d983e392404001", "8c0e012a0ff981e9f6d981e18a400001", "905e002a1f5983d3edb683ff96400001"
};
- readonly byte[] structure_versions =
- {
- 2, 2, 2
- };
+ readonly byte[] structure_versions = { 2, 2, 2 };
- readonly byte[] spec_versions =
- {
- 3, 3, 4
- };
+ readonly byte[] spec_versions = { 3, 3, 4 };
- readonly byte[] taacs =
- {
- 38, 14, 94
- };
+ readonly byte[] taacs = { 38, 14, 94 };
- readonly byte[] nsacs =
- {
- 1, 1, 0
- };
+ readonly byte[] nsacs = { 1, 1, 0 };
- readonly byte[] speeds =
- {
- 42, 42, 42
- };
+ readonly byte[] speeds = { 42, 42, 42 };
- readonly ushort[] classes =
- {
- 245, 255, 501
- };
+ readonly ushort[] classes = { 245, 255, 501 };
- readonly byte[] read_block_lengths =
- {
- 9, 9, 9
- };
+ readonly byte[] read_block_lengths = { 9, 9, 9 };
- readonly bool[] read_partial_blocks =
- {
- false, true, true
- };
+ readonly bool[] read_partial_blocks = { false, true, true };
- readonly bool[] write_misaligned_block =
- {
- false, false, false
- };
+ readonly bool[] write_misaligned_block = { false, false, false };
- readonly bool[] read_misaligned_block =
- {
- false, false, false
- };
+ readonly bool[] read_misaligned_block = { false, false, false };
- readonly bool[] dsr_implemented =
- {
- false, false, false
- };
+ readonly bool[] dsr_implemented = { false, false, false };
- readonly uint[] card_sizes =
- {
- 1959, 1959, 3919
- };
+ readonly uint[] card_sizes = { 1959, 1959, 3919 };
- readonly byte[] min_read_current =
- {
- 6, 6, 5
- };
+ readonly byte[] min_read_current = { 6, 6, 5 };
- readonly byte[] max_read_current =
- {
- 6, 6, 5
- };
+ readonly byte[] max_read_current = { 6, 6, 5 };
- readonly byte[] min_write_current =
- {
- 6, 6, 5
- };
+ readonly byte[] min_write_current = { 6, 6, 5 };
- readonly byte[] max_write_current =
- {
- 6, 6, 5
- };
+ readonly byte[] max_write_current = { 6, 6, 5 };
- readonly byte[] size_multiplier =
- {
- 3, 3, 5
- };
+ readonly byte[] size_multiplier = { 3, 3, 5 };
- readonly byte[] sector_sizes =
- {
- 0, 0, 0
- };
+ readonly byte[] sector_sizes = { 0, 0, 0 };
- readonly byte[] erase_sector_sizes =
- {
- 31, 15, 31
- };
+ readonly byte[] erase_sector_sizes = { 31, 15, 31 };
- readonly byte[] write_protect_group_size =
- {
- 3, 1, 31
- };
+ readonly byte[] write_protect_group_size = { 3, 1, 31 };
- readonly bool[] write_protect_group_enable =
- {
- true, true, true
- };
+ readonly bool[] write_protect_group_enable = { true, true, true };
- readonly byte[] default_eccs =
- {
- 0, 0, 0
- };
+ readonly byte[] default_eccs = { 0, 0, 0 };
- readonly byte[] r2w_factors =
- {
- 4, 2, 5
- };
+ readonly byte[] r2w_factors = { 4, 2, 5 };
- readonly byte[] write_block_lengths =
- {
- 9, 9, 9
- };
+ readonly byte[] write_block_lengths = { 9, 9, 9 };
- readonly bool[] write_partial_blocks =
- {
- false, false, false
- };
+ readonly bool[] write_partial_blocks = { false, false, false };
- readonly bool[] file_format_group =
- {
- false, false, false
- };
+ readonly bool[] file_format_group = { false, false, false };
- readonly bool[] copy =
- {
- true, false, false
- };
+ readonly bool[] copy = { true, false, false };
- readonly bool[] permanent_write_protect =
- {
- false, false, false
- };
+ readonly bool[] permanent_write_protect = { false, false, false };
- readonly bool[] temporary_write_protect =
- {
- false, false, false
- };
+ readonly bool[] temporary_write_protect = { false, false, false };
- readonly byte[] file_format =
- {
- 0, 0, 0
- };
+ readonly byte[] file_format = { 0, 0, 0 };
- readonly byte[] ecc =
- {
- 0, 0, 0
- };
+ readonly byte[] ecc = { 0, 0, 0 };
[Test]
public void Test()
{
- for(int i = 0; i < cards.Length; i++)
+ for(var i = 0; i < cards.Length; i++)
+ {
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
int count = Marshal.ConvertFromHexAscii(csds[i], out byte[] response);
@@ -194,10 +100,10 @@ public class CSD
Assert.AreEqual(spec_versions[i], csd.Version,
string.Format(Localization.Specification_version_0, cards[i]));
- Assert.AreEqual(taacs[i], csd.TAAC, string.Format(Localization.TAAC_0, cards[i]));
- Assert.AreEqual(nsacs[i], csd.NSAC, string.Format(Localization.NSAC_0, cards[i]));
- Assert.AreEqual(speeds[i], csd.Speed, string.Format(Localization.Transfer_speed_0, cards[i]));
- Assert.AreEqual(classes[i], csd.Classes, string.Format(Localization.Classes_0, cards[i]));
+ Assert.AreEqual(taacs[i], csd.TAAC, string.Format(Localization.TAAC_0, cards[i]));
+ Assert.AreEqual(nsacs[i], csd.NSAC, string.Format(Localization.NSAC_0, cards[i]));
+ Assert.AreEqual(speeds[i], csd.Speed, string.Format(Localization.Transfer_speed_0, cards[i]));
+ Assert.AreEqual(classes[i], csd.Classes, string.Format(Localization.Classes_0, cards[i]));
Assert.AreEqual(read_block_lengths[i], csd.ReadBlockLength,
string.Format(Localization.Read_block_length_0, cards[i]));
@@ -271,5 +177,7 @@ public class CSD
Assert.AreEqual(ecc[i], csd.ECC, string.Format(Localization.ECC_0, cards[i]));
});
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Aaru.Tests/Devices/MultiMediaCard/ExtendedCSD.cs b/Aaru.Tests/Devices/MultiMediaCard/ExtendedCSD.cs
index cec1a9547..cd9976e3e 100644
--- a/Aaru.Tests/Devices/MultiMediaCard/ExtendedCSD.cs
+++ b/Aaru.Tests/Devices/MultiMediaCard/ExtendedCSD.cs
@@ -11,35 +11,38 @@ public class ExtendedCSD
{
new byte[]
{
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x09, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x01, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x13, 0x00, 0x07, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x15, 0x1F, 0x20, 0x00, 0x00, 0x00, 0x00, 0x11, 0x05, 0x01, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x08, 0x00, 0x02, 0x00, 0x57, 0x01,
- 0x05, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00, 0xC0, 0x33, 0x07,
- 0x10, 0x16, 0x00, 0x07, 0x07, 0x08, 0x01, 0x05, 0x01, 0x06, 0x20, 0x00, 0x07, 0x11, 0x1B, 0x55, 0x05, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x0A, 0x00, 0x00, 0x01,
- 0x00, 0x00, 0x1B, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x01, 0x01, 0x01,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x1F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x07, 0x05, 0x00, 0x03, 0x01, 0x3F, 0x3F, 0x01, 0x01,
- 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x34, 0x13, 0x00,
+ 0x07, 0x01, 0x01, 0x00, 0x00, 0x00, 0x15, 0x1F, 0x20, 0x00, 0x00, 0x00, 0x00, 0x11, 0x05, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x08, 0x00, 0x02, 0x00, 0x57, 0x01, 0x05, 0x0A, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x01, 0x00, 0xC0, 0x33, 0x07, 0x10, 0x16, 0x00, 0x07, 0x07, 0x08, 0x01, 0x05,
+ 0x01, 0x06, 0x20, 0x00, 0x07, 0x11, 0x1B, 0x55, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x1E, 0x00, 0x00, 0x00, 0x00, 0x00, 0x3C, 0x0A, 0x00, 0x00, 0x01, 0x00, 0x00, 0x1B, 0x01,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x20, 0x00, 0x01, 0x01, 0x01, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x1F, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+ 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x03, 0x07,
+ 0x05, 0x00, 0x03, 0x01, 0x3F, 0x3F, 0x01, 0x01, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
}
};
@@ -85,134 +88,131 @@ public class ExtendedCSD
GeneralPurposePartitionSize = new byte[12],
PartitioningSetting = 0,
PartitionsAttribute = 0,
- MaxEnhancedAreaSize = new byte[]
- {
- 52, 19, 0
- },
- PartitioningSupport = (PartitioningSupport)7,
- HPIManagement = 1,
- HWResetFunction = 1,
- EnableBackgroundOperationsHandshake = 0,
- ManuallyStartBackgroundOperations = 0,
- StartSanitizeOperation = 0,
- WriteReliabilityParameterRegister = 21,
- WriteReliabilitySettingRegister = 31,
- RPMBSize = 32,
- FirmwareConfiguration = 0,
- Reserved4 = 0,
- UserAreaWriteProtectionRegister = 0,
- Reserved5 = 0,
- BootAreaWriteProtectionRegister = (BootAreaWriteProtectionRegister)17,
- BootWriteProtectionStatus = 5,
- HighCapacityEraseGroupDefinition = (HighCapacityEraseGroupDefinition)1,
- Reserved6 = 0,
- BootBusConditions = 0,
- BootConfigProtection = 0,
- PartitionConfiguration = 0,
- Reserved7 = 0,
- ErasedMemoryContent = 0,
- Reserved8 = 0,
- BusWidth = 0,
- StrobeSupport = 1,
- HighSpeedInterfaceTiming = 3,
- Reserved9 = 0,
- PowerClass = 0,
- Reserved10 = 0,
- CommandSetRevision = 0,
- Reserved11 = 0,
- CommandSet = 0,
- Revision = 8,
- Reserved12 = 0,
- Structure = 2,
- Reserved13 = 0,
- DeviceType = (DeviceType)87,
- DriverStrength = (DriverStrength)1,
- OutOfInterruptBusyTiming = 5,
- PartitionSwitchingTime = 10,
- PowerClass52_195 = 0,
- PowerClass26_195 = 0,
- PowerClass52 = 0,
- PowerClass26 = 0,
- Reserved14 = 0,
- MinimumReadPerformance26_4 = 0,
- MinimumWritePerformance26_4 = 0,
- MinimumReadPerformance26 = 0,
- MinimumWritePerformance26 = 0,
- MinimumReadPerformance52 = 0,
- MinimumWritePerformance52 = 0,
- SecureWriteProtectInformation = (SecureWriteProtectInformation)1,
- SectorCount = 120832000,
- SleepNotificationTimeout = 16,
- SleepAwakeTimeout = 22,
- ProductionStateAwarenessTimeout = 0,
- SleepCurrentVccQ = 7,
- SleepCurrentVcc = 7,
- HighCapacityWriteProtectGroupSize = 8,
- ReliableWriteSectorCount = 1,
- HighCapacityEraseTimeout = 5,
- HighCapacityEraseUnitSize = 1,
- AccessSize = 6,
- BootPartitionSize = 32,
- Reserved15 = 0,
- BootInformation = (BootInformation)7,
- SecureTRIMMultiplier = 17,
- SecureEraseMultiplier = 27,
- SecureFeatureSupport = (SecureFeatureSupport)85,
- TRIMMultiplier = 5,
- Reserved16 = 0,
- MinimumReadPerformanceDDR52 = 0,
- MinimumWritePerformanceDDR52 = 0,
- PowerClassDDR200_130 = 0,
- PowerClassDDR200_195 = 0,
- PowerClassDDR52_195 = 0,
- PowerClassDDR52 = 0,
- CacheFlushingPolicy = 0,
- InitializationTimeAfterPartition = 30,
- CorrectlyProgrammedSectors = 0,
- BackgroundOperationsStatus = 0,
- PowerOffNotificationTimeout = 60,
- GenericCMD6Timeout = 10,
- CacheSize = 65536,
- PowerClassDDR200 = 0,
- FirmwareVersion = 283,
- DeviceVersion = 0,
- OptimalTrimUnitSize = 1,
- OptimalWriteSize = 32,
- OptimalReadSize = 0,
- PreEOLInformation = 1,
- DeviceLifeEstimationTypeA = 1,
- DeviceLifeEstimationTypeB = 1,
- VendorHealthReport = new byte[32],
- NumberOfFWSectorsCorrectlyProgrammed = 0,
- Reserved17 = 0,
- CMDQueuingDepth = 31,
- CMDQueuingSupport = (CMDQueuingSupport)1,
- Reserved18 = new byte[177],
- BarrierSupport = 0,
- FFUArgument = 0,
- OperationCodesTimeout = 0,
- FFUFeatures = 0,
- SupportedModes = (SupportedModes)3,
- ExtendedPartitionsSupport = (ExtendedPartitionsSupport)3,
- LargeUnitSize = 7,
- ContextManagementCaps = 5,
- TagResourcesSize = 0,
- TagUnitSize = 3,
- DataTagSupport = (DataTagSupport)1,
- MaxPackedWriteCommands = 63,
- MaxPackedReadCommands = 63,
- BackgroundOperationsSupport = (BackgroundOperationsSupport)1,
- HPIFeatures = (HPIFeatures)1,
- SupportedCommandSets = (DeviceSupportedCommandSets)1,
- ExtendedSecurityCommandsError = 0,
- Reserved19 = new byte[6]
+ MaxEnhancedAreaSize = new byte[] { 52, 19, 0 },
+ PartitioningSupport = (PartitioningSupport)7,
+ HPIManagement = 1,
+ HWResetFunction = 1,
+ EnableBackgroundOperationsHandshake = 0,
+ ManuallyStartBackgroundOperations = 0,
+ StartSanitizeOperation = 0,
+ WriteReliabilityParameterRegister = 21,
+ WriteReliabilitySettingRegister = 31,
+ RPMBSize = 32,
+ FirmwareConfiguration = 0,
+ Reserved4 = 0,
+ UserAreaWriteProtectionRegister = 0,
+ Reserved5 = 0,
+ BootAreaWriteProtectionRegister = (BootAreaWriteProtectionRegister)17,
+ BootWriteProtectionStatus = 5,
+ HighCapacityEraseGroupDefinition = (HighCapacityEraseGroupDefinition)1,
+ Reserved6 = 0,
+ BootBusConditions = 0,
+ BootConfigProtection = 0,
+ PartitionConfiguration = 0,
+ Reserved7 = 0,
+ ErasedMemoryContent = 0,
+ Reserved8 = 0,
+ BusWidth = 0,
+ StrobeSupport = 1,
+ HighSpeedInterfaceTiming = 3,
+ Reserved9 = 0,
+ PowerClass = 0,
+ Reserved10 = 0,
+ CommandSetRevision = 0,
+ Reserved11 = 0,
+ CommandSet = 0,
+ Revision = 8,
+ Reserved12 = 0,
+ Structure = 2,
+ Reserved13 = 0,
+ DeviceType = (DeviceType)87,
+ DriverStrength = (DriverStrength)1,
+ OutOfInterruptBusyTiming = 5,
+ PartitionSwitchingTime = 10,
+ PowerClass52_195 = 0,
+ PowerClass26_195 = 0,
+ PowerClass52 = 0,
+ PowerClass26 = 0,
+ Reserved14 = 0,
+ MinimumReadPerformance26_4 = 0,
+ MinimumWritePerformance26_4 = 0,
+ MinimumReadPerformance26 = 0,
+ MinimumWritePerformance26 = 0,
+ MinimumReadPerformance52 = 0,
+ MinimumWritePerformance52 = 0,
+ SecureWriteProtectInformation = (SecureWriteProtectInformation)1,
+ SectorCount = 120832000,
+ SleepNotificationTimeout = 16,
+ SleepAwakeTimeout = 22,
+ ProductionStateAwarenessTimeout = 0,
+ SleepCurrentVccQ = 7,
+ SleepCurrentVcc = 7,
+ HighCapacityWriteProtectGroupSize = 8,
+ ReliableWriteSectorCount = 1,
+ HighCapacityEraseTimeout = 5,
+ HighCapacityEraseUnitSize = 1,
+ AccessSize = 6,
+ BootPartitionSize = 32,
+ Reserved15 = 0,
+ BootInformation = (BootInformation)7,
+ SecureTRIMMultiplier = 17,
+ SecureEraseMultiplier = 27,
+ SecureFeatureSupport = (SecureFeatureSupport)85,
+ TRIMMultiplier = 5,
+ Reserved16 = 0,
+ MinimumReadPerformanceDDR52 = 0,
+ MinimumWritePerformanceDDR52 = 0,
+ PowerClassDDR200_130 = 0,
+ PowerClassDDR200_195 = 0,
+ PowerClassDDR52_195 = 0,
+ PowerClassDDR52 = 0,
+ CacheFlushingPolicy = 0,
+ InitializationTimeAfterPartition = 30,
+ CorrectlyProgrammedSectors = 0,
+ BackgroundOperationsStatus = 0,
+ PowerOffNotificationTimeout = 60,
+ GenericCMD6Timeout = 10,
+ CacheSize = 65536,
+ PowerClassDDR200 = 0,
+ FirmwareVersion = 283,
+ DeviceVersion = 0,
+ OptimalTrimUnitSize = 1,
+ OptimalWriteSize = 32,
+ OptimalReadSize = 0,
+ PreEOLInformation = 1,
+ DeviceLifeEstimationTypeA = 1,
+ DeviceLifeEstimationTypeB = 1,
+ VendorHealthReport = new byte[32],
+ NumberOfFWSectorsCorrectlyProgrammed = 0,
+ Reserved17 = 0,
+ CMDQueuingDepth = 31,
+ CMDQueuingSupport = (CMDQueuingSupport)1,
+ Reserved18 = new byte[177],
+ BarrierSupport = 0,
+ FFUArgument = 0,
+ OperationCodesTimeout = 0,
+ FFUFeatures = 0,
+ SupportedModes = (SupportedModes)3,
+ ExtendedPartitionsSupport = (ExtendedPartitionsSupport)3,
+ LargeUnitSize = 7,
+ ContextManagementCaps = 5,
+ TagResourcesSize = 0,
+ TagUnitSize = 3,
+ DataTagSupport = (DataTagSupport)1,
+ MaxPackedWriteCommands = 63,
+ MaxPackedReadCommands = 63,
+ BackgroundOperationsSupport = (BackgroundOperationsSupport)1,
+ HPIFeatures = (HPIFeatures)1,
+ SupportedCommandSets = (DeviceSupportedCommandSets)1,
+ ExtendedSecurityCommandsError = 0,
+ Reserved19 = new byte[6]
}
};
[Test]
public void Test()
{
- for(int i = 0; i < _ecsd.Length; i++)
+ for(var i = 0; i < _ecsd.Length; i++)
{
Decoders.MMC.ExtendedCSD csd = Decoders.MMC.Decoders.DecodeExtendedCSD(_ecsd[i]);
Assert.IsNotNull(csd, string.Format(Localization.Not_decoded_0, i));
diff --git a/Aaru.Tests/Devices/PocketZip.cs b/Aaru.Tests/Devices/PocketZip.cs
index acb72c317..c54457510 100644
--- a/Aaru.Tests/Devices/PocketZip.cs
+++ b/Aaru.Tests/Devices/PocketZip.cs
@@ -40,25 +40,13 @@ namespace Aaru.Tests.Devices;
[TestFixture]
public class PocketZip
{
- readonly string[] _testFiles =
- {
- "clik!.bin.lz", "pocketzip.bin.lz"
- };
+ readonly string[] _testFiles = { "clik!.bin.lz", "pocketzip.bin.lz" };
- readonly MediaType[] _mediaTypes =
- {
- MediaType.PocketZip, MediaType.PocketZip
- };
+ readonly MediaType[] _mediaTypes = { MediaType.PocketZip, MediaType.PocketZip };
- readonly ulong[] _sectors =
- {
- 78882, 78882
- };
+ readonly ulong[] _sectors = { 78882, 78882 };
- readonly uint[] _sectorSize =
- {
- 512, 512
- };
+ readonly uint[] _sectorSize = { 512, 512 };
readonly string _dataFolder = Path.Combine(Consts.TestFilesRoot, "Device test dumps", "PocketZIP");
@@ -69,7 +57,7 @@ public class PocketZip
Assert.Multiple(() =>
{
- for(int i = 0; i < _testFiles.Length; i++)
+ for(var i = 0; i < _testFiles.Length; i++)
{
var filter = new LZip();
filter.Open(_testFiles[i]);
@@ -83,6 +71,7 @@ public class PocketZip
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(_sectors[i], image.Info.Sectors,
@@ -94,6 +83,7 @@ public class PocketZip
Assert.AreEqual(_mediaTypes[i], image.Info.MediaType,
string.Format(Localization.Media_type_0, _testFiles[i]));
});
+ }
}
});
}
diff --git a/Aaru.Tests/Devices/SecureDigital/CID.cs b/Aaru.Tests/Devices/SecureDigital/CID.cs
index 592419bb6..ba3df15a2 100644
--- a/Aaru.Tests/Devices/SecureDigital/CID.cs
+++ b/Aaru.Tests/Devices/SecureDigital/CID.cs
@@ -40,10 +40,7 @@ public class CID
"TO", "SD064"
};
- readonly byte[] revisions =
- {
- 0x60, 0x38, 0x04, 0x10, 0x38, 0x80, 0x80, 0x10, 0x10, 0x30, 0x10, 0x80, 0xff, 0x05
- };
+ readonly byte[] revisions = { 0x60, 0x38, 0x04, 0x10, 0x38, 0x80, 0x80, 0x10, 0x10, 0x30, 0x10, 0x80, 0xff, 0x05 };
readonly uint[] serials =
{
@@ -56,16 +53,15 @@ public class CID
0x147, 0x089, 0x09a, 0x0a5, 0x091, 0x0e8, 0x123, 0x0b2, 0x067, 0x0b8, 0x0aa, 0x095, 0x0fa, 0x034
};
- readonly byte[] crcs =
- {
- 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
- };
+ readonly byte[] crcs = { 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00 };
[Test]
public void Test()
{
- for(int i = 0; i < cards.Length; i++)
+ for(var i = 0; i < cards.Length; i++)
+ {
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
int count = Marshal.ConvertFromHexAscii(cids[i], out byte[] response);
@@ -92,5 +88,7 @@ public class CID
Assert.AreEqual(crcs[i], cid.CRC, string.Format(Localization.CRC_0, cards[i]));
});
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Aaru.Tests/Devices/SecureDigital/CSD.cs b/Aaru.Tests/Devices/SecureDigital/CSD.cs
index 736c549a6..031ee40b2 100644
--- a/Aaru.Tests/Devices/SecureDigital/CSD.cs
+++ b/Aaru.Tests/Devices/SecureDigital/CSD.cs
@@ -25,20 +25,11 @@ public class CSD
"400e00325b5900001dbf7f800a400001", "002d0032135983c9f6d9cf8016400001"
};
- readonly byte[] structure_versions =
- {
- 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0
- };
+ readonly byte[] structure_versions = { 1, 1, 1, 0, 0, 1, 1, 0, 0, 1, 1, 1, 1, 0 };
- readonly byte[] taacs =
- {
- 14, 14, 14, 38, 46, 14, 14, 127, 94, 14, 14, 14, 14, 45
- };
+ readonly byte[] taacs = { 14, 14, 14, 38, 46, 14, 14, 127, 94, 14, 14, 14, 14, 45 };
- readonly byte[] nsacs =
- {
- 0, 0, 0, 1, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0
- };
+ readonly byte[] nsacs = { 0, 0, 0, 1, 0, 0, 0, 255, 0, 0, 0, 0, 0, 0 };
readonly byte[] speeds =
{
@@ -46,15 +37,9 @@ public class CSD
50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50, 50
};
- readonly ushort[] classes =
- {
- 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1397, 1461, 1461, 1461, 1461, 309
- };
+ readonly ushort[] classes = { 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1461, 1397, 1461, 1461, 1461, 1461, 309 };
- readonly byte[] read_block_lengths =
- {
- 9, 9, 9, 10, 10, 9, 9, 10, 11, 9, 9, 9, 9, 9
- };
+ readonly byte[] read_block_lengths = { 9, 9, 9, 10, 10, 9, 9, 10, 11, 9, 9, 9, 9, 9 };
readonly bool[] read_partial_blocks =
{
@@ -81,55 +66,31 @@ public class CSD
29711, 7559, 15207, 3871, 3751, 30386, 60872, 3819, 3925, 7591, 7659, 7562, 7615, 3879
};
- readonly byte[] min_read_current =
- {
- 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6
- };
+ readonly byte[] min_read_current = { 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6 };
- readonly byte[] max_read_current =
- {
- 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6
- };
+ readonly byte[] max_read_current = { 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6 };
- readonly byte[] min_write_current =
- {
- 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6
- };
+ readonly byte[] min_write_current = { 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6 };
- readonly byte[] max_write_current =
- {
- 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6
- };
+ readonly byte[] max_write_current = { 0, 0, 0, 6, 7, 0, 0, 6, 5, 0, 0, 0, 0, 6 };
- readonly byte[] size_multiplier =
- {
- 0, 0, 0, 7, 7, 0, 0, 7, 7, 0, 0, 0, 0, 3
- };
+ readonly byte[] size_multiplier = { 0, 0, 0, 7, 7, 0, 0, 7, 7, 0, 0, 0, 0, 3 };
readonly bool[] erase_block_enable =
{
true, true, true, true, true, true, true, true, true, true, true, true, true, true
};
- readonly byte[] erase_sector_sizes =
- {
- 127, 127, 127, 127, 127, 127, 127, 63, 127, 127, 127, 127, 127, 31
- };
+ readonly byte[] erase_sector_sizes = { 127, 127, 127, 127, 127, 127, 127, 63, 127, 127, 127, 127, 127, 31 };
- readonly byte[] write_protect_group_size =
- {
- 0, 0, 0, 31, 0, 0, 0, 127, 127, 0, 0, 0, 0, 0
- };
+ readonly byte[] write_protect_group_size = { 0, 0, 0, 31, 0, 0, 0, 127, 127, 0, 0, 0, 0, 0 };
readonly bool[] write_protect_group_enable =
{
false, false, false, false, false, false, false, false, true, false, false, false, false, false
};
- readonly byte[] r2w_factors =
- {
- 2, 2, 2, 5, 5, 2, 2, 3, 5, 2, 2, 2, 2, 5
- };
+ readonly byte[] r2w_factors = { 2, 2, 2, 5, 5, 2, 2, 3, 5, 2, 2, 2, 2, 5 };
readonly bool[] file_format_group =
{
@@ -151,16 +112,15 @@ public class CSD
false, false, false, false, false, false, false, false, false, false, false, false, false, false
};
- readonly byte[] file_format =
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
+ readonly byte[] file_format = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
[Test]
public void Test()
{
- for(int i = 0; i < cards.Length; i++)
+ for(var i = 0; i < cards.Length; i++)
+ {
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
int count = Marshal.ConvertFromHexAscii(csds[i], out byte[] response);
@@ -171,10 +131,10 @@ public class CSD
Assert.AreEqual(structure_versions[i], csd.Structure,
string.Format(Localization.Version_0, cards[i]));
- Assert.AreEqual(taacs[i], csd.TAAC, string.Format(Localization.TAAC_0, cards[i]));
- Assert.AreEqual(nsacs[i], csd.NSAC, string.Format(Localization.NSAC_0, cards[i]));
- Assert.AreEqual(speeds[i], csd.Speed, string.Format(Localization.Transfer_speed_0, cards[i]));
- Assert.AreEqual(classes[i], csd.Classes, string.Format(Localization.Classes_0, cards[i]));
+ Assert.AreEqual(taacs[i], csd.TAAC, string.Format(Localization.TAAC_0, cards[i]));
+ Assert.AreEqual(nsacs[i], csd.NSAC, string.Format(Localization.NSAC_0, cards[i]));
+ Assert.AreEqual(speeds[i], csd.Speed, string.Format(Localization.Transfer_speed_0, cards[i]));
+ Assert.AreEqual(classes[i], csd.Classes, string.Format(Localization.Classes_0, cards[i]));
Assert.AreEqual(read_block_lengths[i], csd.ReadBlockLength,
string.Format(Localization.Read_block_length_0, cards[i]));
@@ -237,5 +197,7 @@ public class CSD
Assert.AreEqual(file_format[i], csd.FileFormat,
string.Format(Localization.File_format_0, cards[i]));
});
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Aaru.Tests/Devices/SecureDigital/SCR.cs b/Aaru.Tests/Devices/SecureDigital/SCR.cs
index c0d1eab46..efd63b8d3 100644
--- a/Aaru.Tests/Devices/SecureDigital/SCR.cs
+++ b/Aaru.Tests/Devices/SecureDigital/SCR.cs
@@ -24,121 +24,53 @@ public class SCR
"0235000000000000", "0235000000000000", "02b5800000000000", "00a5000008070302"
};
- readonly byte[] structure_version =
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
+ readonly byte[] structure_version = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
- readonly byte[] specification_version =
- {
- 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 0
- };
+ readonly byte[] specification_version = { 2, 2, 2, 2, 2, 2, 2, 2, 1, 2, 2, 2, 2, 0 };
readonly bool[] data_stat_after_erase =
{
false, true, false, true, true, false, false, false, false, false, false, false, true, true
};
- readonly byte[] sd_security =
- {
- 0, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 3, 3, 2
- };
+ readonly byte[] sd_security = { 0, 3, 3, 2, 2, 3, 3, 2, 2, 3, 3, 3, 3, 2 };
- readonly byte[] sd_bus_widths =
- {
- 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5
- };
+ readonly byte[] sd_bus_widths = { 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5 };
readonly bool[] sd_spec3 =
{
true, false, true, false, false, true, true, true, false, true, false, false, true, false
};
- readonly byte[] ex_security =
- {
- 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0
- };
+ readonly byte[] ex_security = { 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0 };
readonly bool[] sd_spec4 =
{
false, false, false, false, false, false, false, false, false, false, false, false, false, false
};
- readonly byte[] sd_specx =
- {
- 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0
- };
+ readonly byte[] sd_specx = { 2, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0 };
- readonly byte[] cmd_support =
- {
- 3, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0
- };
+ readonly byte[] cmd_support = { 3, 0, 0, 0, 0, 1, 3, 0, 0, 0, 0, 0, 0, 0 };
readonly byte[][] mfg =
{
- new byte[]
- {
- 0x01, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x1c, 0x02, 0x21, 0x02
- },
- new byte[]
- {
- 0x01, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x1c, 0x02, 0x14, 0x02
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x01, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x00, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0x08, 0x07, 0x03, 0x02
- }
+ new byte[] { 0x01, 0x00, 0x00, 0x00 }, new byte[] { 0x1c, 0x02, 0x21, 0x02 },
+ new byte[] { 0x01, 0x00, 0x00, 0x00 }, new byte[] { 0x00, 0x00, 0x00, 0x00 },
+ new byte[] { 0x1c, 0x02, 0x14, 0x02 }, new byte[] { 0x00, 0x00, 0x00, 0x00 },
+ new byte[] { 0x00, 0x00, 0x00, 0x00 }, new byte[] { 0x00, 0x00, 0x00, 0x00 },
+ new byte[] { 0x00, 0x00, 0x00, 0x00 }, new byte[] { 0x01, 0x00, 0x00, 0x00 },
+ new byte[] { 0x00, 0x00, 0x00, 0x00 }, new byte[] { 0x00, 0x00, 0x00, 0x00 },
+ new byte[] { 0x00, 0x00, 0x00, 0x00 }, new byte[] { 0x08, 0x07, 0x03, 0x02 }
};
[Test]
public void Test()
{
- for(int i = 0; i < cards.Length; i++)
+ for(var i = 0; i < cards.Length; i++)
+ {
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
int count = Marshal.ConvertFromHexAscii(scrs[i], out byte[] response);
@@ -174,5 +106,7 @@ public class SCR
Assert.AreEqual(mfg[i], scr.ManufacturerReserved,
string.Format(Localization.Manufacturer_reserved_0, cards[i]));
});
+ }
+ }
}
}
\ No newline at end of file
diff --git a/Aaru.Tests/Filesystems/AFFS/APM.cs b/Aaru.Tests/Filesystems/AFFS/APM.cs
index 421aa43a2..65e9b5b32 100644
--- a/Aaru.Tests/Filesystems/AFFS/APM.cs
+++ b/Aaru.Tests/Filesystems/AFFS/APM.cs
@@ -41,6 +41,7 @@ public class APM : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Fast File System (APM)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/AFFS/MBR+RDB.cs b/Aaru.Tests/Filesystems/AFFS/MBR+RDB.cs
index 1648e882f..d68133498 100644
--- a/Aaru.Tests/Filesystems/AFFS/MBR+RDB.cs
+++ b/Aaru.Tests/Filesystems/AFFS/MBR+RDB.cs
@@ -35,13 +35,15 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.AFFS;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class MBR_RDB : FilesystemTest
{
public MBR_RDB() : base("affs") {}
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Fast File System (MBR+RDB)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/AFFS/MBR.cs b/Aaru.Tests/Filesystems/AFFS/MBR.cs
index 024a93360..7857ca344 100644
--- a/Aaru.Tests/Filesystems/AFFS/MBR.cs
+++ b/Aaru.Tests/Filesystems/AFFS/MBR.cs
@@ -41,6 +41,7 @@ public class MBR : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Fast File System (MBR)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/AFFS/RDB.cs b/Aaru.Tests/Filesystems/AFFS/RDB.cs
index 522f2f9ab..48e5084aa 100644
--- a/Aaru.Tests/Filesystems/AFFS/RDB.cs
+++ b/Aaru.Tests/Filesystems/AFFS/RDB.cs
@@ -41,6 +41,7 @@ public class RDB : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Fast File System (RDB)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/AOFS/MBR+RDB.cs b/Aaru.Tests/Filesystems/AOFS/MBR+RDB.cs
index 6a29f4c8c..5ed76bc0b 100644
--- a/Aaru.Tests/Filesystems/AOFS/MBR+RDB.cs
+++ b/Aaru.Tests/Filesystems/AOFS/MBR+RDB.cs
@@ -35,13 +35,15 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.AOFS;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class MBR_RDB : FilesystemTest
{
public MBR_RDB() : base("aofs") {}
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Old File System (MBR+RDB)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/AOFS/MBR.cs b/Aaru.Tests/Filesystems/AOFS/MBR.cs
index 0b078922d..4ea84e7c0 100644
--- a/Aaru.Tests/Filesystems/AOFS/MBR.cs
+++ b/Aaru.Tests/Filesystems/AOFS/MBR.cs
@@ -41,6 +41,7 @@ public class MBR : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Old File System (MBR)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/AOFS/RDB.cs b/Aaru.Tests/Filesystems/AOFS/RDB.cs
index d251cc6b6..c30df6da4 100644
--- a/Aaru.Tests/Filesystems/AOFS/RDB.cs
+++ b/Aaru.Tests/Filesystems/AOFS/RDB.cs
@@ -41,6 +41,7 @@ public class RDB : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Amiga Old File System (RDB)");
+
public override IFilesystem Plugin => new AmigaDOSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/CPM/AMSDOS.cs b/Aaru.Tests/Filesystems/CPM/AMSDOS.cs
index b73f210c3..e1d9288d9 100644
--- a/Aaru.Tests/Filesystems/CPM/AMSDOS.cs
+++ b/Aaru.Tests/Filesystems/CPM/AMSDOS.cs
@@ -33,7 +33,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.CPM;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class AMSDOS : FilesystemTest
{
public AMSDOS() : base("cpmfs") {}
diff --git a/Aaru.Tests/Filesystems/CPM/KayproII.cs b/Aaru.Tests/Filesystems/CPM/KayproII.cs
index fe5c95c94..4c48f4d0b 100644
--- a/Aaru.Tests/Filesystems/CPM/KayproII.cs
+++ b/Aaru.Tests/Filesystems/CPM/KayproII.cs
@@ -33,7 +33,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.CPM;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class KayproII : ReadOnlyFilesystemTest
{
public KayproII() : base("cpmfs") {}
diff --git a/Aaru.Tests/Filesystems/CPM/Plus3DOS.cs b/Aaru.Tests/Filesystems/CPM/Plus3DOS.cs
index 5bcec3af6..c352edb57 100644
--- a/Aaru.Tests/Filesystems/CPM/Plus3DOS.cs
+++ b/Aaru.Tests/Filesystems/CPM/Plus3DOS.cs
@@ -33,7 +33,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.CPM;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class Plus3DOS : FilesystemTest
{
public Plus3DOS() : base("cpmfs") {}
diff --git a/Aaru.Tests/Filesystems/CPM/ROMDOS.cs b/Aaru.Tests/Filesystems/CPM/ROMDOS.cs
index 5b3b9f39f..5dc1dd2fb 100644
--- a/Aaru.Tests/Filesystems/CPM/ROMDOS.cs
+++ b/Aaru.Tests/Filesystems/CPM/ROMDOS.cs
@@ -33,7 +33,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.CPM;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class ROMDOS : FilesystemTest
{
public ROMDOS() : base("cpmfs") {}
diff --git a/Aaru.Tests/Filesystems/FilesystemTest.cs b/Aaru.Tests/Filesystems/FilesystemTest.cs
index 5bd838784..a4e6a58c4 100644
--- a/Aaru.Tests/Filesystems/FilesystemTest.cs
+++ b/Aaru.Tests/Filesystems/FilesystemTest.cs
@@ -65,7 +65,7 @@ public abstract class FilesystemTest
Assert.Greater(partitionsList.Count, 0,
string.Format(Localization.No_partitions_found_for_0, testFile));
- bool found = false;
+ var found = false;
foreach(Partition p in partitionsList)
{
@@ -136,8 +136,8 @@ public abstract class FilesystemTest
Assert.AreEqual(ErrorNumber.NoError, image.Open(inputFilter),
string.Format(Localization.Cannot_open_image_for_0, testFile));
- Assert.AreEqual(test.MediaType, image.Info.MediaType, testFile);
- Assert.AreEqual(test.Sectors, image.Info.Sectors, testFile);
+ Assert.AreEqual(test.MediaType, image.Info.MediaType, testFile);
+ Assert.AreEqual(test.Sectors, image.Info.Sectors, testFile);
Assert.AreEqual(test.SectorSize, image.Info.SectorSize, testFile);
}
});
@@ -153,7 +153,7 @@ public abstract class FilesystemTest
foreach(FileSystemTest test in Tests)
{
string testFile = test.TestFile;
- bool found = false;
+ var found = false;
var partition = new Partition();
bool exists = File.Exists(testFile);
@@ -233,8 +233,10 @@ public abstract class FilesystemTest
fs.GetInformation(image, partition, null, out _, out FileSystem fsMetadata);
if(test.ApplicationId != null)
+ {
Assert.AreEqual(test.ApplicationId, fsMetadata.ApplicationIdentifier,
string.Format(Localization.Application_ID_0, testFile));
+ }
Assert.AreEqual(test.Bootable, fsMetadata.Bootable, string.Format(Localization.Bootable_0, testFile));
Assert.AreEqual(test.Clusters, fsMetadata.Clusters, string.Format(Localization.Clusters_0, testFile));
@@ -243,8 +245,10 @@ public abstract class FilesystemTest
string.Format(Localization.Cluster_size_0, testFile));
if(test.SystemId != null)
+ {
Assert.AreEqual(test.SystemId, fsMetadata.SystemIdentifier,
string.Format(Localization.System_ID_0, testFile));
+ }
Assert.AreEqual(_fileSystemType ?? test.Type, fsMetadata.Type,
string.Format(Localization.Filesystem_type_0, testFile));
diff --git a/Aaru.Tests/Filesystems/HPFS.cs b/Aaru.Tests/Filesystems/HPFS.cs
index d7f39d5e1..739004a87 100644
--- a/Aaru.Tests/Filesystems/HPFS.cs
+++ b/Aaru.Tests/Filesystems/HPFS.cs
@@ -41,6 +41,7 @@ public class Hpfs : FilesystemTest
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems",
"High Performance File System");
+
public override IFilesystem Plugin => new HPFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/HPOFS.cs b/Aaru.Tests/Filesystems/HPOFS.cs
index 5a8c8b41d..f331f59f6 100644
--- a/Aaru.Tests/Filesystems/HPOFS.cs
+++ b/Aaru.Tests/Filesystems/HPOFS.cs
@@ -41,6 +41,7 @@ public class Hpofs : FilesystemTest
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems",
"High Performance Optical File System");
+
public override IFilesystem Plugin => new HPOFS();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/HTFS/MBR.cs b/Aaru.Tests/Filesystems/HTFS/MBR.cs
index 406f7d587..37ed64023 100644
--- a/Aaru.Tests/Filesystems/HTFS/MBR.cs
+++ b/Aaru.Tests/Filesystems/HTFS/MBR.cs
@@ -41,6 +41,7 @@ public class MBR : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "High Throughput File System (MBR)");
+
public override IFilesystem Plugin => new SysVfs();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/NILFS2.cs b/Aaru.Tests/Filesystems/NILFS2.cs
index e5b089343..9c2c7e04b 100644
--- a/Aaru.Tests/Filesystems/NILFS2.cs
+++ b/Aaru.Tests/Filesystems/NILFS2.cs
@@ -41,6 +41,7 @@ public class Nilfs2 : FilesystemTest
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems",
"New Implementation of a Log-structured File System 2");
+
public override IFilesystem Plugin => new NILFS2();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/NTFS/GPT.cs b/Aaru.Tests/Filesystems/NTFS/GPT.cs
index fc2eccc37..4e0924aea 100644
--- a/Aaru.Tests/Filesystems/NTFS/GPT.cs
+++ b/Aaru.Tests/Filesystems/NTFS/GPT.cs
@@ -40,6 +40,7 @@ public class GPT : FilesystemTest
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "New Technology File System (GPT)");
+
public override IFilesystem Plugin => new Aaru.Filesystems.NTFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/PFS3/APM.cs b/Aaru.Tests/Filesystems/PFS3/APM.cs
index 8ef68cd11..4a5b363d6 100644
--- a/Aaru.Tests/Filesystems/PFS3/APM.cs
+++ b/Aaru.Tests/Filesystems/PFS3/APM.cs
@@ -41,6 +41,7 @@ public class APM : FilesystemTest
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems",
"Professional File System 3 (APM)");
+
public override IFilesystem Plugin => new PFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/PFS3/RDB.cs b/Aaru.Tests/Filesystems/PFS3/RDB.cs
index f83eec3e7..822ad84fd 100644
--- a/Aaru.Tests/Filesystems/PFS3/RDB.cs
+++ b/Aaru.Tests/Filesystems/PFS3/RDB.cs
@@ -41,6 +41,7 @@ public class RDB : FilesystemTest
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems",
"Professional File System 3 (RDB)");
+
public override IFilesystem Plugin => new PFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/ReFS.cs b/Aaru.Tests/Filesystems/ReFS.cs
index abcf9bd03..8d9445bdd 100644
--- a/Aaru.Tests/Filesystems/ReFS.cs
+++ b/Aaru.Tests/Filesystems/ReFS.cs
@@ -41,6 +41,7 @@ public class ReFsMbr : FilesystemTest
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems",
"Resilient File System (MBR)");
+
public override IFilesystem Plugin => new ReFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/ReadOnlyFilesystemTest.cs b/Aaru.Tests/Filesystems/ReadOnlyFilesystemTest.cs
index e5010e382..2e18564f8 100644
--- a/Aaru.Tests/Filesystems/ReadOnlyFilesystemTest.cs
+++ b/Aaru.Tests/Filesystems/ReadOnlyFilesystemTest.cs
@@ -32,7 +32,7 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
foreach(FileSystemTest test in Tests)
{
string testFile = test.TestFile;
- bool found = false;
+ var found = false;
var partition = new Partition();
bool exists = File.Exists(testFile);
@@ -128,8 +128,10 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
};
if(test.ContentsJson != null)
+ {
test.Contents =
JsonSerializer.Deserialize>(test.ContentsJson, serializerOptions);
+ }
else if(File.Exists($"{testFile}.contents.json"))
{
var sr = new FileStream($"{testFile}.contents.json", FileMode.Open);
@@ -139,7 +141,7 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
if(test.Contents is null)
continue;
- int currentDepth = 0;
+ var currentDepth = 0;
TestDirectory(fs, "/", test.Contents, testFile, true, out List currentLevel, currentDepth);
@@ -150,7 +152,7 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
foreach(NextLevel subLevel in currentLevel)
{
- TestDirectory(fs, subLevel.Path, subLevel.Children, testFile, true,
+ TestDirectory(fs, subLevel.Path, subLevel.Children, testFile, true,
out List nextLevel, currentDepth);
nextLevels.AddRange(nextLevel);
@@ -162,7 +164,8 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
});
}
- [Test, Ignore("Not a test, do not run")]
+ [Test]
+ [Ignore("Not a test, do not run")]
public void Build()
{
Environment.CurrentDirectory = DataFolder;
@@ -170,7 +173,7 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
foreach(FileSystemTest test in Tests)
{
string testFile = test.TestFile;
- bool found = false;
+ var found = false;
var partition = new Partition();
bool exists = File.Exists(testFile);
@@ -275,7 +278,7 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
while(fs.ReadDir(node, out string child) == ErrorNumber.NoError &&
child is not null)
{
- string childPath = $"{path}/{child}";
+ var childPath = $"{path}/{child}";
fs.Stat(childPath, out FileEntryInfo stat);
var data = new FileData
@@ -311,7 +314,7 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
static string BuildFile(IReadOnlyFilesystem fs, string path, long length)
{
- byte[] buffer = new byte[length];
+ var buffer = new byte[length];
ErrorNumber error = fs.OpenFile(path, out IFileNode fileNode);
@@ -340,7 +343,8 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
string data;
data = ret != ErrorNumber.NoError && ret != ErrorNumber.OutOfRange
- ? Md5Context.Data(Array.Empty(), out _) : Md5Context.Data(buffer, out _);
+ ? Md5Context.Data(Array.Empty(), out _)
+ : Md5Context.Data(buffer, out _);
xattrs[xattr] = data;
}
@@ -348,9 +352,9 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
return xattrs;
}
- internal static void TestDirectory(IReadOnlyFilesystem fs, string path, Dictionary children,
- string testFile, bool testXattr, out List nextLevels,
- int currentDepth)
+ internal static void TestDirectory(IReadOnlyFilesystem fs, string path, Dictionary children,
+ string testFile, bool testXattr, out List nextLevels,
+ int currentDepth)
{
currentDepth++;
nextLevels = new List();
@@ -386,12 +390,12 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
foreach(KeyValuePair child in children)
{
- string childPath = $"{path}/{child.Key}";
+ var childPath = $"{path}/{child.Key}";
ret = fs.Stat(childPath, out FileEntryInfo stat);
if(ret == ErrorNumber.NoSuchFile ||
contents is null ||
- (ret == ErrorNumber.NoError && !contents.Contains(child.Key)))
+ ret == ErrorNumber.NoError && !contents.Contains(child.Key))
{
expectedNotFound.Add(child.Key);
@@ -454,8 +458,9 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
{
Assert.IsNotNull(child.Value.Children,
string.
- Format(Localization.Contents_for_0_in_1_must_be_defined_in_unit_test_declaration,
- childPath, testFile));
+ Format(
+ Localization.Contents_for_0_in_1_must_be_defined_in_unit_test_declaration,
+ childPath, testFile));
if(child.Value.Children != null)
{
@@ -491,8 +496,10 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
{
Assert.IsNull(child.Value.XattrsWithMd5,
string.
- Format(Localization.Defined_extended_attributes_for_0_in_1_are_not_supported_by_filesystem,
- childPath, testFile));
+ Format(
+ Localization.
+ Defined_extended_attributes_for_0_in_1_are_not_supported_by_filesystem,
+ childPath, testFile));
continue;
}
@@ -502,10 +509,14 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
ret, childPath, testFile));
if(xattrs.Count > 0)
+ {
Assert.IsNotNull(child.Value.XattrsWithMd5,
string.
- Format(Localization.Extended_attributes_for_0_in_1_must_be_defined_in_unit_test_declaration,
- childPath, testFile));
+ Format(
+ Localization.
+ Extended_attributes_for_0_in_1_must_be_defined_in_unit_test_declaration,
+ childPath, testFile));
+ }
if(xattrs.Count > 0 ||
child.Value.XattrsWithMd5?.Count > 0)
@@ -517,14 +528,16 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
string.Join(" ", expectedNotFound)));
if(contents != null)
+ {
Assert.IsEmpty(contents,
string.Format(Localization.Found_the_following_unexpected_children_of_0_in_1_2, path,
testFile, string.Join(" ", contents)));
+ }
}
static void TestFile(IReadOnlyFilesystem fs, string path, string md5, long length, string testFile)
{
- byte[] buffer = new byte[length];
+ var buffer = new byte[length];
ErrorNumber ret = fs.OpenFile(path, out IFileNode fileNode);
Assert.AreEqual(ErrorNumber.NoError, ret,
@@ -578,9 +591,11 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
// Partially read extended attribute... dunno why it happens with some Toast images
if(ret != ErrorNumber.OutOfRange)
+ {
Assert.AreEqual(ErrorNumber.NoError, ret,
string.Format(Localization.Unexpected_error_0_retrieving_extended_attributes_for_1_in_2,
ret, path, testFile));
+ }
string data = Md5Context.Data(buffer, out _);
@@ -598,5 +613,9 @@ public abstract class ReadOnlyFilesystemTest : FilesystemTest
testFile, string.Join(" ", contents)));
}
+#region Nested type: NextLevel
+
internal sealed record NextLevel(string Path, Dictionary Children);
+
+#endregion
}
\ No newline at end of file
diff --git a/Aaru.Tests/Filesystems/SFS/MBR+RDB.cs b/Aaru.Tests/Filesystems/SFS/MBR+RDB.cs
index 855f7ed6f..717c73726 100644
--- a/Aaru.Tests/Filesystems/SFS/MBR+RDB.cs
+++ b/Aaru.Tests/Filesystems/SFS/MBR+RDB.cs
@@ -34,13 +34,15 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.SFS;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class MBR_RDB : FilesystemTest
{
public MBR_RDB() : base("sfs") {}
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Smart File System (MBR+RDB)");
+
public override IFilesystem Plugin => new Aaru.Filesystems.SFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/UDF/1.02/Whole.cs b/Aaru.Tests/Filesystems/UDF/1.02/Whole.cs
index 726702bec..9ea263128 100644
--- a/Aaru.Tests/Filesystems/UDF/1.02/Whole.cs
+++ b/Aaru.Tests/Filesystems/UDF/1.02/Whole.cs
@@ -39,6 +39,7 @@ public class Whole : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "1.02");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/1.50/Optical.cs b/Aaru.Tests/Filesystems/UDF/1.50/Optical.cs
index 02001e8d3..5cf1bb96c 100644
--- a/Aaru.Tests/Filesystems/UDF/1.50/Optical.cs
+++ b/Aaru.Tests/Filesystems/UDF/1.50/Optical.cs
@@ -39,6 +39,7 @@ public class Optical : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "1.50");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/1.50/Whole.cs b/Aaru.Tests/Filesystems/UDF/1.50/Whole.cs
index 72d622dfe..98cdfd323 100644
--- a/Aaru.Tests/Filesystems/UDF/1.50/Whole.cs
+++ b/Aaru.Tests/Filesystems/UDF/1.50/Whole.cs
@@ -39,6 +39,7 @@ public class Whole : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "1.50");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/2.00/Optical.cs b/Aaru.Tests/Filesystems/UDF/2.00/Optical.cs
index 129deac1f..ccfb7e198 100644
--- a/Aaru.Tests/Filesystems/UDF/2.00/Optical.cs
+++ b/Aaru.Tests/Filesystems/UDF/2.00/Optical.cs
@@ -39,6 +39,7 @@ public class Optical : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "2.00");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/2.00/Whole.cs b/Aaru.Tests/Filesystems/UDF/2.00/Whole.cs
index bbf9183cc..f882dcbe4 100644
--- a/Aaru.Tests/Filesystems/UDF/2.00/Whole.cs
+++ b/Aaru.Tests/Filesystems/UDF/2.00/Whole.cs
@@ -39,6 +39,7 @@ public class Whole : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "2.00");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/2.01/Optical.cs b/Aaru.Tests/Filesystems/UDF/2.01/Optical.cs
index f0909a84c..f93805d38 100644
--- a/Aaru.Tests/Filesystems/UDF/2.01/Optical.cs
+++ b/Aaru.Tests/Filesystems/UDF/2.01/Optical.cs
@@ -39,6 +39,7 @@ public class Optical : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "2.01");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/2.01/Whole.cs b/Aaru.Tests/Filesystems/UDF/2.01/Whole.cs
index 438113840..b5827d213 100644
--- a/Aaru.Tests/Filesystems/UDF/2.01/Whole.cs
+++ b/Aaru.Tests/Filesystems/UDF/2.01/Whole.cs
@@ -39,6 +39,7 @@ public class Whole : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "2.01");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/2.50/Whole.cs b/Aaru.Tests/Filesystems/UDF/2.50/Whole.cs
index c1bfd7bfb..f10762133 100644
--- a/Aaru.Tests/Filesystems/UDF/2.50/Whole.cs
+++ b/Aaru.Tests/Filesystems/UDF/2.50/Whole.cs
@@ -39,6 +39,7 @@ public class Whole : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "2.50");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UDF/2.60/Whole.cs b/Aaru.Tests/Filesystems/UDF/2.60/Whole.cs
index 0226e5cba..099722c60 100644
--- a/Aaru.Tests/Filesystems/UDF/2.60/Whole.cs
+++ b/Aaru.Tests/Filesystems/UDF/2.60/Whole.cs
@@ -40,6 +40,7 @@ public class Whole : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Universal Disc Format", "2.60");
+
public override IFilesystem Plugin => new Aaru.Filesystems.UDF();
public override bool Partitions => false;
diff --git a/Aaru.Tests/Filesystems/UFS/NeXT Floppy.cs b/Aaru.Tests/Filesystems/UFS/NeXT Floppy.cs
index 064cb7054..f6355e31d 100644
--- a/Aaru.Tests/Filesystems/UFS/NeXT Floppy.cs
+++ b/Aaru.Tests/Filesystems/UFS/NeXT Floppy.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.UFS;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class NeXT_Floppy : FilesystemTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Filesystems", "UNIX filesystem (NeXT)");
diff --git a/Aaru.Tests/Filesystems/UFS/Sun i86.cs b/Aaru.Tests/Filesystems/UFS/Sun i86.cs
index 2c256d377..32c648e77 100644
--- a/Aaru.Tests/Filesystems/UFS/Sun i86.cs
+++ b/Aaru.Tests/Filesystems/UFS/Sun i86.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Filesystems.UFS;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class Sun_i86 : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "UNIX filesystem (SunOS x86)");
+
public override IFilesystem Plugin => new FFSPlugin();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filesystems/ext.cs b/Aaru.Tests/Filesystems/ext.cs
index b0514e322..87730f658 100644
--- a/Aaru.Tests/Filesystems/ext.cs
+++ b/Aaru.Tests/Filesystems/ext.cs
@@ -39,6 +39,7 @@ public class Ext : FilesystemTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Filesystems", "Linux extended File System");
+
public override IFilesystem Plugin => new extFS();
public override bool Partitions => true;
diff --git a/Aaru.Tests/Filters/AppleDoubleDave.cs b/Aaru.Tests/Filters/AppleDoubleDave.cs
index 53074d535..0378887d6 100644
--- a/Aaru.Tests/Filters/AppleDoubleDave.cs
+++ b/Aaru.Tests/Filters/AppleDoubleDave.cs
@@ -59,7 +59,7 @@ public class AppleDoubleDave
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -91,7 +91,7 @@ public class AppleDoubleDave
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -105,7 +105,7 @@ public class AppleDoubleDave
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleDoubleDos.cs b/Aaru.Tests/Filters/AppleDoubleDos.cs
index 04b9a7eff..8b0517c9c 100644
--- a/Aaru.Tests/Filters/AppleDoubleDos.cs
+++ b/Aaru.Tests/Filters/AppleDoubleDos.cs
@@ -58,7 +58,7 @@ public class AppleDoubleDos
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -90,7 +90,7 @@ public class AppleDoubleDos
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -104,7 +104,7 @@ public class AppleDoubleDos
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleDoubleNetatalk.cs b/Aaru.Tests/Filters/AppleDoubleNetatalk.cs
index 2430e688d..7f14ed1f0 100644
--- a/Aaru.Tests/Filters/AppleDoubleNetatalk.cs
+++ b/Aaru.Tests/Filters/AppleDoubleNetatalk.cs
@@ -60,7 +60,7 @@ public class AppleDoubleNetatalk
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -92,7 +92,7 @@ public class AppleDoubleNetatalk
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -106,7 +106,7 @@ public class AppleDoubleNetatalk
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleDoubleOsX.cs b/Aaru.Tests/Filters/AppleDoubleOsX.cs
index 8b6e772d2..474dbabb1 100644
--- a/Aaru.Tests/Filters/AppleDoubleOsX.cs
+++ b/Aaru.Tests/Filters/AppleDoubleOsX.cs
@@ -58,7 +58,7 @@ public class AppleDoubleOsX
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -90,7 +90,7 @@ public class AppleDoubleOsX
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -104,7 +104,7 @@ public class AppleDoubleOsX
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleDoubleProDos.cs b/Aaru.Tests/Filters/AppleDoubleProDos.cs
index 46fb57f60..4be69ebd3 100644
--- a/Aaru.Tests/Filters/AppleDoubleProDos.cs
+++ b/Aaru.Tests/Filters/AppleDoubleProDos.cs
@@ -58,7 +58,7 @@ public class AppleDoubleProDos
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -90,7 +90,7 @@ public class AppleDoubleProDos
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -104,7 +104,7 @@ public class AppleDoubleProDos
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleDoubleUnAr.cs b/Aaru.Tests/Filters/AppleDoubleUnAr.cs
index cf16fff11..880aa36a6 100644
--- a/Aaru.Tests/Filters/AppleDoubleUnAr.cs
+++ b/Aaru.Tests/Filters/AppleDoubleUnAr.cs
@@ -58,7 +58,7 @@ public class AppleDoubleUnAr
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -90,7 +90,7 @@ public class AppleDoubleUnAr
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -104,7 +104,7 @@ public class AppleDoubleUnAr
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleDoubleUnix.cs b/Aaru.Tests/Filters/AppleDoubleUnix.cs
index 7934371ae..fac5f2caa 100644
--- a/Aaru.Tests/Filters/AppleDoubleUnix.cs
+++ b/Aaru.Tests/Filters/AppleDoubleUnix.cs
@@ -58,7 +58,7 @@ public class AppleDoubleUnix
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -90,7 +90,7 @@ public class AppleDoubleUnix
IFilter filter = new AppleDouble();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -104,7 +104,7 @@ public class AppleDoubleUnix
{
IFilter filter = new AppleDouble();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/AppleSingle.cs b/Aaru.Tests/Filters/AppleSingle.cs
index c32f9f4ec..b7490db04 100644
--- a/Aaru.Tests/Filters/AppleSingle.cs
+++ b/Aaru.Tests/Filters/AppleSingle.cs
@@ -51,7 +51,7 @@ public class AppleSingle
IFilter filter = new Aaru.Filters.AppleSingle();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -80,7 +80,7 @@ public class AppleSingle
IFilter filter = new Aaru.Filters.AppleSingle();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -94,7 +94,7 @@ public class AppleSingle
{
IFilter filter = new Aaru.Filters.AppleSingle();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/BZip2.cs b/Aaru.Tests/Filters/BZip2.cs
index e274c79aa..dd2bcdf56 100644
--- a/Aaru.Tests/Filters/BZip2.cs
+++ b/Aaru.Tests/Filters/BZip2.cs
@@ -56,7 +56,7 @@ public class BZip2
IFilter filter = new Aaru.Filters.BZip2();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
str.EnsureRead(data, 0, 1048576);
str.Close();
str.Dispose();
@@ -84,10 +84,10 @@ public class BZip2
{
IFilter filter = new Aaru.Filters.BZip2();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(1048576, filter.DataForkLength);
+ Assert.AreEqual(1048576, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
- Assert.AreEqual(0, filter.ResourceForkLength);
- Assert.AreEqual(null, filter.GetResourceForkStream());
+ Assert.AreEqual(0, filter.ResourceForkLength);
+ Assert.AreEqual(null, filter.GetResourceForkStream());
Assert.AreEqual(false, filter.HasResourceFork);
filter.Close();
}
diff --git a/Aaru.Tests/Filters/GZip.cs b/Aaru.Tests/Filters/GZip.cs
index 6ff70b98f..7b9ceff8c 100644
--- a/Aaru.Tests/Filters/GZip.cs
+++ b/Aaru.Tests/Filters/GZip.cs
@@ -56,7 +56,7 @@ public class GZip
IFilter filter = new Aaru.Filters.GZip();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
str.EnsureRead(data, 0, 1048576);
str.Close();
str.Dispose();
@@ -84,10 +84,10 @@ public class GZip
{
IFilter filter = new Aaru.Filters.GZip();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(1048576, filter.DataForkLength);
+ Assert.AreEqual(1048576, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
- Assert.AreEqual(0, filter.ResourceForkLength);
- Assert.AreEqual(null, filter.GetResourceForkStream());
+ Assert.AreEqual(0, filter.ResourceForkLength);
+ Assert.AreEqual(null, filter.GetResourceForkStream());
Assert.AreEqual(false, filter.HasResourceFork);
filter.Close();
}
diff --git a/Aaru.Tests/Filters/LZip.cs b/Aaru.Tests/Filters/LZip.cs
index e15fa417c..05b0dc401 100644
--- a/Aaru.Tests/Filters/LZip.cs
+++ b/Aaru.Tests/Filters/LZip.cs
@@ -56,7 +56,7 @@ public class LZip
IFilter filter = new Aaru.Filters.LZip();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
str.EnsureRead(data, 0, 1048576);
str.Close();
str.Dispose();
@@ -84,10 +84,10 @@ public class LZip
{
IFilter filter = new Aaru.Filters.LZip();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(1048576, filter.DataForkLength);
+ Assert.AreEqual(1048576, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
- Assert.AreEqual(0, filter.ResourceForkLength);
- Assert.AreEqual(null, filter.GetResourceForkStream());
+ Assert.AreEqual(0, filter.ResourceForkLength);
+ Assert.AreEqual(null, filter.GetResourceForkStream());
Assert.AreEqual(false, filter.HasResourceFork);
filter.Close();
}
diff --git a/Aaru.Tests/Filters/MacBinary1.cs b/Aaru.Tests/Filters/MacBinary1.cs
index fdc10fdc9..409805b6c 100644
--- a/Aaru.Tests/Filters/MacBinary1.cs
+++ b/Aaru.Tests/Filters/MacBinary1.cs
@@ -52,7 +52,7 @@ public class MacBinary1
IFilter filter = new MacBinary();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -81,7 +81,7 @@ public class MacBinary1
IFilter filter = new MacBinary();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -95,7 +95,7 @@ public class MacBinary1
{
IFilter filter = new MacBinary();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/MacBinary2.cs b/Aaru.Tests/Filters/MacBinary2.cs
index 2c51a047f..b52cafae2 100644
--- a/Aaru.Tests/Filters/MacBinary2.cs
+++ b/Aaru.Tests/Filters/MacBinary2.cs
@@ -52,7 +52,7 @@ public class MacBinary2
IFilter filter = new MacBinary();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -81,7 +81,7 @@ public class MacBinary2
IFilter filter = new MacBinary();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -95,7 +95,7 @@ public class MacBinary2
{
IFilter filter = new MacBinary();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/MacBinary3.cs b/Aaru.Tests/Filters/MacBinary3.cs
index 0d3e16964..4b0fe785e 100644
--- a/Aaru.Tests/Filters/MacBinary3.cs
+++ b/Aaru.Tests/Filters/MacBinary3.cs
@@ -52,7 +52,7 @@ public class MacBinary3
IFilter filter = new MacBinary();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -81,7 +81,7 @@ public class MacBinary3
IFilter filter = new MacBinary();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[286];
+ var data = new byte[286];
str.EnsureRead(data, 0, 286);
str.Close();
str.Dispose();
@@ -95,7 +95,7 @@ public class MacBinary3
{
IFilter filter = new MacBinary();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(286, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/PCExchange.cs b/Aaru.Tests/Filters/PCExchange.cs
index 50bdd2863..4a19b41c5 100644
--- a/Aaru.Tests/Filters/PCExchange.cs
+++ b/Aaru.Tests/Filters/PCExchange.cs
@@ -52,7 +52,7 @@ public class PcExchange
IFilter filter = new Aaru.Filters.PcExchange();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[737280];
+ var data = new byte[737280];
str.EnsureRead(data, 0, 737280);
str.Close();
str.Dispose();
@@ -83,7 +83,7 @@ public class PcExchange
IFilter filter = new Aaru.Filters.PcExchange();
filter.Open(_location);
Stream str = filter.GetResourceForkStream();
- byte[] data = new byte[546];
+ var data = new byte[546];
str.EnsureRead(data, 0, 546);
str.Close();
str.Dispose();
@@ -97,7 +97,7 @@ public class PcExchange
{
IFilter filter = new Aaru.Filters.PcExchange();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(737280, filter.DataForkLength);
+ Assert.AreEqual(737280, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
Assert.AreEqual(546, filter.ResourceForkLength);
Assert.AreNotEqual(null, filter.GetResourceForkStream());
diff --git a/Aaru.Tests/Filters/XZ.cs b/Aaru.Tests/Filters/XZ.cs
index e5644d389..ebea4f9c8 100644
--- a/Aaru.Tests/Filters/XZ.cs
+++ b/Aaru.Tests/Filters/XZ.cs
@@ -57,7 +57,7 @@ public class Xz
IFilter filter = new XZ();
filter.Open(_location);
Stream str = filter.GetDataForkStream();
- byte[] data = new byte[1048576];
+ var data = new byte[1048576];
str.EnsureRead(data, 0, 1048576);
str.Close();
str.Dispose();
@@ -85,10 +85,10 @@ public class Xz
{
IFilter filter = new XZ();
Assert.AreEqual(ErrorNumber.NoError, filter.Open(_location));
- Assert.AreEqual(1048576, filter.DataForkLength);
+ Assert.AreEqual(1048576, filter.DataForkLength);
Assert.AreNotEqual(null, filter.GetDataForkStream());
- Assert.AreEqual(0, filter.ResourceForkLength);
- Assert.AreEqual(null, filter.GetResourceForkStream());
+ Assert.AreEqual(0, filter.ResourceForkLength);
+ Assert.AreEqual(null, filter.GetResourceForkStream());
Assert.AreEqual(false, filter.HasResourceFork);
filter.Close();
}
diff --git a/Aaru.Tests/Helpers/Marshal.cs b/Aaru.Tests/Helpers/Marshal.cs
index 214f02978..edf90dab2 100644
--- a/Aaru.Tests/Helpers/Marshal.cs
+++ b/Aaru.Tests/Helpers/Marshal.cs
@@ -16,30 +16,20 @@ public class Marshal
{
0x27, 0x50, 0x48, 0x53, 0x44, 0x31, 0x36, 0x47, 0x60, 0x01, 0x1a, 0x77, 0xd2, 0x01, 0x47, 0x01
},
- new byte[]
- {
- 0x02, 0x35, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00
- },
- new byte[]
- {
- 0xba, 0xbe, 0xfa, 0xce
- },
- new byte[]
- {
- 0xce, 0xfa, 0xad, 0xde
- }
+ new byte[] { 0x02, 0x35, 0x80, 0x00, 0x01, 0x00, 0x00, 0x00 }, new byte[] { 0xba, 0xbe, 0xfa, 0xce },
+ new byte[] { 0xce, 0xfa, 0xad, 0xde }
};
[Test]
public void ConvertFromHexAscii()
{
- for(int i = 0; i < _testStrings.Length; i++)
+ for(var i = 0; i < _testStrings.Length; i++)
{
int count = Aaru.Helpers.Marshal.ConvertFromHexAscii(_testStrings[i], out byte[] buf);
Assert.AreEqual(_resultBytes[i].Length, buf.Length);
Assert.AreEqual(_resultBytes[i].Length, count);
- Assert.AreEqual(_resultBytes[i], buf);
+ Assert.AreEqual(_resultBytes[i], buf);
}
}
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/Alcohol120.cs b/Aaru.Tests/Images/Alcohol120.cs
index e664217be..0da5384ef 100644
--- a/Aaru.Tests/Images/Alcohol120.cs
+++ b/Aaru.Tests/Images/Alcohol120.cs
@@ -1837,7 +1837,9 @@ public class Alcohol120 : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -2239,6 +2241,7 @@ public class Alcohol120 : OpticalMediaImageTest
}
}
},*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/AppleDOS/DOS32.cs b/Aaru.Tests/Images/AppleDOS/DOS32.cs
index 37db8ee94..074f694b4 100644
--- a/Aaru.Tests/Images/AppleDOS/DOS32.cs
+++ b/Aaru.Tests/Images/AppleDOS/DOS32.cs
@@ -39,6 +39,7 @@ public class DOS32 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "Apple DOS 13 sectors");
+
public override IMediaImage Plugin => new AppleDos();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/AppleDOS/ProDOS.cs b/Aaru.Tests/Images/AppleDOS/ProDOS.cs
index c2181c813..f31f9d2e5 100644
--- a/Aaru.Tests/Images/AppleDOS/ProDOS.cs
+++ b/Aaru.Tests/Images/AppleDOS/ProDOS.cs
@@ -39,6 +39,7 @@ public class ProDOS : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "Apple ProDOS Order");
+
public override IMediaImage Plugin => new AppleDos();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/BlindWrite4.cs b/Aaru.Tests/Images/BlindWrite4.cs
index a6ae78040..42ff7186c 100644
--- a/Aaru.Tests/Images/BlindWrite4.cs
+++ b/Aaru.Tests/Images/BlindWrite4.cs
@@ -1144,7 +1144,9 @@ public class BlindWrite4 : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -1395,6 +1397,7 @@ public class BlindWrite4 : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/BlindWrite5.cs b/Aaru.Tests/Images/BlindWrite5.cs
index 07e09fa45..7189881ce 100644
--- a/Aaru.Tests/Images/BlindWrite5.cs
+++ b/Aaru.Tests/Images/BlindWrite5.cs
@@ -1062,7 +1062,9 @@ public class BlindWrite5 : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -1361,6 +1363,7 @@ public class BlindWrite5 : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/BlockMediaImageTest.cs b/Aaru.Tests/Images/BlockMediaImageTest.cs
index 6420eb4a9..a4a93195b 100644
--- a/Aaru.Tests/Images/BlockMediaImageTest.cs
+++ b/Aaru.Tests/Images/BlockMediaImageTest.cs
@@ -53,6 +53,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(test.Sectors, image.Info.Sectors,
@@ -64,6 +65,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
Assert.AreEqual(test.MediaType, image.Info.MediaType,
string.Format(Localization.Media_type_0, testFile));
});
+ }
}
});
}
@@ -168,6 +170,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
List partitions = Core.Partitions.GetAll(image);
if(partitions.Count == 0)
+ {
partitions.Add(new Partition
{
Description = "Whole device",
@@ -177,30 +180,36 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
Sequence = 1,
Start = 0
});
+ }
Assert.AreEqual(test.Partitions.Length, partitions.Count,
string.Format(Localization.Expected_0_partitions_in_1_but_found_2,
test.Partitions.Length, testFile, partitions.Count));
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
- for(int i = 0; i < test.Partitions.Length; i++)
+ for(var i = 0; i < test.Partitions.Length; i++)
{
BlockPartitionVolumes expectedPartition = test.Partitions[i];
Partition foundPartition = partitions[i];
Assert.AreEqual(expectedPartition.Start, foundPartition.Start,
string.
- Format(Localization.Expected_partition_0_to_start_at_sector_1_but_found_it_starts_at_2_in_3,
- i, expectedPartition.Start, foundPartition.Start, testFile));
+ Format(
+ Localization.
+ Expected_partition_0_to_start_at_sector_1_but_found_it_starts_at_2_in_3,
+ i, expectedPartition.Start, foundPartition.Start, testFile));
Assert.AreEqual(expectedPartition.Length, foundPartition.Length,
string.
- Format(Localization.Expected_partition_0_to_have_1_sectors_but_found_it_has_2_sectors_in_3,
- i, expectedPartition.Length, foundPartition.Length, testFile));
+ Format(
+ Localization.
+ Expected_partition_0_to_have_1_sectors_but_found_it_has_2_sectors_in_3,
+ i, expectedPartition.Length, foundPartition.Length, testFile));
- string expectedDataFilename = $"{testFile}.contents.partition{i}.json";
+ var expectedDataFilename = $"{testFile}.contents.partition{i}.json";
if(!File.Exists(expectedDataFilename))
continue;
@@ -273,7 +282,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
$"Expected {expectedData.Length} filesystems identified in partition {i
} but found {idPlugins.Count} in {testFile}");
- for(int j = 0; j < idPlugins.Count; j++)
+ for(var j = 0; j < idPlugins.Count; j++)
{
string pluginName = idPlugins[j];
@@ -296,7 +305,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
VolumeData volumeData = expectedData[j];
- int currentDepth = 0;
+ var currentDepth = 0;
ReadOnlyFilesystemTest.TestDirectory(fs, "/", volumeData.Files, testFile, true,
out List
@@ -322,6 +331,7 @@ public abstract class BlockMediaImageTest : BaseMediaImageTest
}
}
});
+ }
}
});
}
diff --git a/Aaru.Tests/Images/CDRWin.cs b/Aaru.Tests/Images/CDRWin.cs
index 8c2863abd..6dcbdc3a6 100644
--- a/Aaru.Tests/Images/CDRWin.cs
+++ b/Aaru.Tests/Images/CDRWin.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class CDRWin : OpticalMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "CDRWin");
diff --git a/Aaru.Tests/Images/CDRWin10.cs b/Aaru.Tests/Images/CDRWin10.cs
index 20656be2e..70f2a6bfc 100644
--- a/Aaru.Tests/Images/CDRWin10.cs
+++ b/Aaru.Tests/Images/CDRWin10.cs
@@ -34,7 +34,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class CDRWin10 : OpticalMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "CDRWin 10");
diff --git a/Aaru.Tests/Images/CPCDSK.cs b/Aaru.Tests/Images/CPCDSK.cs
index f36c436ea..865385786 100644
--- a/Aaru.Tests/Images/CPCDSK.cs
+++ b/Aaru.Tests/Images/CPCDSK.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class CPCDSK : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "CPCDSK");
diff --git a/Aaru.Tests/Images/CloneCD.cs b/Aaru.Tests/Images/CloneCD.cs
index 474d63922..43d9e25ca 100644
--- a/Aaru.Tests/Images/CloneCD.cs
+++ b/Aaru.Tests/Images/CloneCD.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class CloneCD : OpticalMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "CloneCD");
@@ -1427,7 +1428,9 @@ public class CloneCD : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -1846,6 +1849,7 @@ public class CloneCD : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/D88.cs b/Aaru.Tests/Images/D88.cs
index c6bec359f..ea4dbf937 100644
--- a/Aaru.Tests/Images/D88.cs
+++ b/Aaru.Tests/Images/D88.cs
@@ -38,6 +38,7 @@ public class D88 : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "D88");
public override IMediaImage Plugin => new DiscImages.D88();
+
public override BlockImageTestExpected[] Tests => new[]
{
new BlockImageTestExpected
diff --git a/Aaru.Tests/Images/DART.cs b/Aaru.Tests/Images/DART.cs
index ae1dd2b4e..70a3b5fbb 100644
--- a/Aaru.Tests/Images/DART.cs
+++ b/Aaru.Tests/Images/DART.cs
@@ -73,7 +73,9 @@ public class Dart : BlockMediaImageTest
SectorSize = 512,
Md5 = "93e71b9ecdb39d3ec9245b4f451856d4"
}
- #region Unsupported LZH compression
+
+ #region Unsupported LZH compression
+
/*
new BlockImageTestExpected
{
@@ -108,6 +110,7 @@ public class Dart : BlockMediaImageTest
MD5 = "93e71b9ecdb39d3ec9245b4f451856d4"
},
*/
- #endregion Unsupported LZH compression
+
+ #endregion Unsupported LZH compression
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/DiscJuggler.cs b/Aaru.Tests/Images/DiscJuggler.cs
index c486d50be..0770503c2 100644
--- a/Aaru.Tests/Images/DiscJuggler.cs
+++ b/Aaru.Tests/Images/DiscJuggler.cs
@@ -38,6 +38,7 @@ public class DiscJuggler : OpticalMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiscJuggler");
public override IMediaImage Plugin => new DiscImages.DiscJuggler();
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
@@ -1959,7 +1960,9 @@ public class DiscJuggler : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -2106,6 +2109,7 @@ public class DiscJuggler : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/DiskCopy42.cs b/Aaru.Tests/Images/DiskCopy42.cs
index 5a1f506b6..8b8bc9c7d 100644
--- a/Aaru.Tests/Images/DiskCopy42.cs
+++ b/Aaru.Tests/Images/DiskCopy42.cs
@@ -38,6 +38,7 @@ public class DiskCopy42 : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 4.2");
public override IMediaImage Plugin => new DiscImages.DiskCopy42();
+
public override BlockImageTestExpected[] Tests => new[]
{
new BlockImageTestExpected
diff --git a/Aaru.Tests/Images/DiskCopy633/DiskCopy42.cs b/Aaru.Tests/Images/DiskCopy633/DiskCopy42.cs
index 442abdf58..fc3554e0f 100644
--- a/Aaru.Tests/Images/DiskCopy633/DiskCopy42.cs
+++ b/Aaru.Tests/Images/DiskCopy633/DiskCopy42.cs
@@ -38,6 +38,7 @@ public class DiskCopy42 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.3.3", "DiskCopy 4.2");
+
public override IMediaImage Plugin => new DiscImages.DiskCopy42();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy633/NDIF/ROCo.cs b/Aaru.Tests/Images/DiskCopy633/NDIF/ROCo.cs
index 567e024e7..217093a71 100644
--- a/Aaru.Tests/Images/DiskCopy633/NDIF/ROCo.cs
+++ b/Aaru.Tests/Images/DiskCopy633/NDIF/ROCo.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskCopy633.NDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class ROCo : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.3.3", "NDIF", "ROCo");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy633/NDIF/RdWr.cs b/Aaru.Tests/Images/DiskCopy633/NDIF/RdWr.cs
index 78db5711e..e7525730e 100644
--- a/Aaru.Tests/Images/DiskCopy633/NDIF/RdWr.cs
+++ b/Aaru.Tests/Images/DiskCopy633/NDIF/RdWr.cs
@@ -39,6 +39,7 @@ public class RdWr : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.3.3", "NDIF", "RdWr");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy633/NDIF/Rdxx.cs b/Aaru.Tests/Images/DiskCopy633/NDIF/Rdxx.cs
index ae98767f2..279a705e3 100644
--- a/Aaru.Tests/Images/DiskCopy633/NDIF/Rdxx.cs
+++ b/Aaru.Tests/Images/DiskCopy633/NDIF/Rdxx.cs
@@ -39,6 +39,7 @@ public class Rdxx : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.3.3", "NDIF", "Rdxx");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy65/UDCO.cs b/Aaru.Tests/Images/DiskCopy65/UDCO.cs
index 6f6f223f6..cd11ea7d3 100644
--- a/Aaru.Tests/Images/DiskCopy65/UDCO.cs
+++ b/Aaru.Tests/Images/DiskCopy65/UDCO.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskCopy65;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDCO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.5", "UDIF", "UDCO");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy65/UDCo_obsolete.cs b/Aaru.Tests/Images/DiskCopy65/UDCo_obsolete.cs
index 09a695bac..ca6bf6feb 100644
--- a/Aaru.Tests/Images/DiskCopy65/UDCo_obsolete.cs
+++ b/Aaru.Tests/Images/DiskCopy65/UDCo_obsolete.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskCopy65;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDCo_obsolete : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.5", "UDIF", "UDCo_OBS");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy65/UDRAW.cs b/Aaru.Tests/Images/DiskCopy65/UDRAW.cs
index 1e4a9db2f..fa80229e1 100644
--- a/Aaru.Tests/Images/DiskCopy65/UDRAW.cs
+++ b/Aaru.Tests/Images/DiskCopy65/UDRAW.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskCopy65;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDRAW : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.5", "UDIF", "UDRAW");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy65/UDRO.cs b/Aaru.Tests/Images/DiskCopy65/UDRO.cs
index 8b70665db..10d6792b7 100644
--- a/Aaru.Tests/Images/DiskCopy65/UDRO.cs
+++ b/Aaru.Tests/Images/DiskCopy65/UDRO.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskCopy65;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDRO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.5", "UDIF", "UDRO");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskCopy65/UDRo_obsolete.cs b/Aaru.Tests/Images/DiskCopy65/UDRo_obsolete.cs
index 9a2587a53..ea3f81972 100644
--- a/Aaru.Tests/Images/DiskCopy65/UDRo_obsolete.cs
+++ b/Aaru.Tests/Images/DiskCopy65/UDRo_obsolete.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskCopy65;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDRo_obsolete : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskCopy 6.5", "UDIF", "UDRo_OBS");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/DiskCopy42.cs b/Aaru.Tests/Images/DiskImagesFramework/DiskCopy42.cs
index f02e194be..878b05811 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/DiskCopy42.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/DiskCopy42.cs
@@ -38,6 +38,7 @@ public class DiskCopy42 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "DiskCopy 4.2");
+
public override IMediaImage Plugin => new DiscImages.DiskCopy42();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/NDIF/ROCo.cs b/Aaru.Tests/Images/DiskImagesFramework/NDIF/ROCo.cs
index f8541b822..11879385f 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/NDIF/ROCo.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/NDIF/ROCo.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.NDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class ROCo : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "NDIF", "ROCo");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/NDIF/RdWr.cs b/Aaru.Tests/Images/DiskImagesFramework/NDIF/RdWr.cs
index 3c3245133..c5e23a833 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/NDIF/RdWr.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/NDIF/RdWr.cs
@@ -39,6 +39,7 @@ public class RdWr : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "NDIF", "RdWr");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/NDIF/Rdxx.cs b/Aaru.Tests/Images/DiskImagesFramework/NDIF/Rdxx.cs
index acfe8557d..332d4709b 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/NDIF/Rdxx.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/NDIF/Rdxx.cs
@@ -39,6 +39,7 @@ public class Rdxx : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "NDIF", "Rdxx");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/IPOD.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/IPOD.cs
index 0e7ce48e4..0b606c4ee 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/IPOD.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/IPOD.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class IPOD : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "IPOD");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDBZ.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDBZ.cs
index dc7e0e7df..3c7ebe1ff 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDBZ.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDBZ.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDBZ : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UDBZ");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDCO.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDCO.cs
index 6c26655e7..baab3f1d7 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDCO.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDCO.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDCO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UDCO");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRO.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRO.cs
index ec763aaa9..f93b07e9a 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRO.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRO.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDRO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UDRO");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRW.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRW.cs
index 5e56699b4..a5c5a8782 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRW.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDRW.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDRW : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UDRW");
+
public override IMediaImage Plugin => new ZZZRawImage();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDTO.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDTO.cs
index 688d1cb99..38d81f973 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDTO.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDTO.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDTO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UDTO");
+
public override IMediaImage Plugin => new ZZZRawImage();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDZO.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDZO.cs
index f2176ef25..cf03f35fb 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDZO.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UDZO.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UDZO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UDZO");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UFBI.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UFBI.cs
index 1a9b50527..c595c0d39 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/UFBI.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/UFBI.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class UFBI : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "UFBI");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskImagesFramework/UDIF/ULMO.cs b/Aaru.Tests/Images/DiskImagesFramework/UDIF/ULMO.cs
index ddb259fcd..04f919d6c 100644
--- a/Aaru.Tests/Images/DiskImagesFramework/UDIF/ULMO.cs
+++ b/Aaru.Tests/Images/DiskImagesFramework/UDIF/ULMO.cs
@@ -34,11 +34,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.DiskImagesFramework.UDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class ULMO : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "DiskImagesFramework", "UDIF", "ULMO");
+
public override IMediaImage Plugin => new Udif();
public override BlockImageTestExpected[] Tests => new BlockImageTestExpected[]
diff --git a/Aaru.Tests/Images/DiskUtilities/ImageDisk.cs b/Aaru.Tests/Images/DiskUtilities/ImageDisk.cs
index bcd27fe94..0e1753bce 100644
--- a/Aaru.Tests/Images/DiskUtilities/ImageDisk.cs
+++ b/Aaru.Tests/Images/DiskUtilities/ImageDisk.cs
@@ -39,6 +39,7 @@ public class ImageDisk : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "disk-analyse", "ImageDisk");
+
public override IMediaImage Plugin => new Imd();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/DiskUtilities/Raw.cs b/Aaru.Tests/Images/DiskUtilities/Raw.cs
index 3289b69ff..67a2f2f8e 100644
--- a/Aaru.Tests/Images/DiskUtilities/Raw.cs
+++ b/Aaru.Tests/Images/DiskUtilities/Raw.cs
@@ -39,6 +39,7 @@ public class Raw : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "disk-analyse", "raw");
+
public override IMediaImage Plugin => new ZZZRawImage();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/HDCopy.cs b/Aaru.Tests/Images/HDCopy.cs
index 3af6c524a..aaf673712 100644
--- a/Aaru.Tests/Images/HDCopy.cs
+++ b/Aaru.Tests/Images/HDCopy.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class HDCopy : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "HD-COPY");
diff --git a/Aaru.Tests/Images/IsoBuster/Cuesheet.cs b/Aaru.Tests/Images/IsoBuster/Cuesheet.cs
index 9dfae0a52..3c7ffed80 100644
--- a/Aaru.Tests/Images/IsoBuster/Cuesheet.cs
+++ b/Aaru.Tests/Images/IsoBuster/Cuesheet.cs
@@ -39,6 +39,7 @@ 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[]
diff --git a/Aaru.Tests/Images/Lisa/Raw.cs b/Aaru.Tests/Images/Lisa/Raw.cs
index fa9abc0ff..975ee84bb 100644
--- a/Aaru.Tests/Images/Lisa/Raw.cs
+++ b/Aaru.Tests/Images/Lisa/Raw.cs
@@ -39,6 +39,7 @@ public class Raw : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "Lisa emulators", "raw");
+
public override IMediaImage Plugin => new ZZZRawImage();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/MAME/v5/compressed.cs b/Aaru.Tests/Images/MAME/v5/compressed.cs
index ed430acdd..cc0474f52 100644
--- a/Aaru.Tests/Images/MAME/v5/compressed.cs
+++ b/Aaru.Tests/Images/MAME/v5/compressed.cs
@@ -39,6 +39,7 @@ public class Compressed : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "MAME", "v5", "compressed");
+
public override IMediaImage Plugin => new Chd();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/MAME/v5/uncompressed.cs b/Aaru.Tests/Images/MAME/v5/uncompressed.cs
index 17518a9af..bf18c8659 100644
--- a/Aaru.Tests/Images/MAME/v5/uncompressed.cs
+++ b/Aaru.Tests/Images/MAME/v5/uncompressed.cs
@@ -39,6 +39,7 @@ public class Uncompressed : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "MAME", "v5", "uncompressed");
+
public override IMediaImage Plugin => new Chd();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/MagicISO/Cuesheet.cs b/Aaru.Tests/Images/MagicISO/Cuesheet.cs
index 1d306dbfd..a5c65a7b9 100644
--- a/Aaru.Tests/Images/MagicISO/Cuesheet.cs
+++ b/Aaru.Tests/Images/MagicISO/Cuesheet.cs
@@ -39,6 +39,7 @@ public class Cuesheet : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "MagicISO", "Cuesheet");
+
public override IMediaImage Plugin => new CdrWin();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/NHDr0.cs b/Aaru.Tests/Images/NHDr0.cs
index 2d59388c1..5ef12e69e 100644
--- a/Aaru.Tests/Images/NHDr0.cs
+++ b/Aaru.Tests/Images/NHDr0.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class NHDr0 : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "T-98 Next");
diff --git a/Aaru.Tests/Images/Nero/V1.cs b/Aaru.Tests/Images/Nero/V1.cs
index c5542d35a..cb325e56e 100644
--- a/Aaru.Tests/Images/Nero/V1.cs
+++ b/Aaru.Tests/Images/Nero/V1.cs
@@ -38,6 +38,7 @@ public class V1 : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "Nero Burning ROM", "V1");
+
public override IMediaImage Plugin => new DiscImages.Nero();
public override OpticalImageTestExpected[] Tests => new[]
@@ -2075,7 +2076,9 @@ public class V1 : OpticalMediaImageTest
}
}
}
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -2178,6 +2181,7 @@ public class V1 : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/Nero/V2.cs b/Aaru.Tests/Images/Nero/V2.cs
index 0a5d36e48..f90fe97b8 100644
--- a/Aaru.Tests/Images/Nero/V2.cs
+++ b/Aaru.Tests/Images/Nero/V2.cs
@@ -38,6 +38,7 @@ public class V2 : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "Nero Burning ROM", "V2");
+
public override IMediaImage Plugin => new DiscImages.Nero();
public override OpticalImageTestExpected[] Tests => new[]
@@ -3403,7 +3404,9 @@ public class V2 : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -3682,6 +3685,7 @@ public class V2 : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/OpticalMediaImageTest.cs b/Aaru.Tests/Images/OpticalMediaImageTest.cs
index c9306a389..28878817f 100644
--- a/Aaru.Tests/Images/OpticalMediaImageTest.cs
+++ b/Aaru.Tests/Images/OpticalMediaImageTest.cs
@@ -60,14 +60,17 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(test.Sectors, image.Info.Sectors,
string.Format(Localization.Sectors_0, testFile));
if(test.SectorSize > 0)
+ {
Assert.AreEqual(test.SectorSize, image.Info.SectorSize,
string.Format(Localization.Sector_size_0, testFile));
+ }
Assert.AreEqual(test.MediaType, image.Info.MediaType,
string.Format(Localization.Media_type_0, testFile));
@@ -94,10 +97,10 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
BeEquivalentTo(test.Tracks.Select(s => s.Pregap),
string.Format(Localization.Track_pregap_0, testFile));
- int trackNo = 0;
+ var trackNo = 0;
- byte?[] flags = new byte?[image.Tracks.Count];
- ulong latestEndSector = 0;
+ var flags = new byte?[image.Tracks.Count];
+ ulong latestEndSector = 0;
foreach(Track currentTrack in image.Tracks)
{
@@ -126,6 +129,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
string.Format(Localization.Last_sector_for_tracks_is_0_but_it_is_1_for_image,
latestEndSector, image.Info.Sectors));
});
+ }
}
});
}
@@ -163,6 +167,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
foreach(TrackInfoTestExpected track in test.Tracks)
@@ -188,7 +193,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
string.Format(Localization.Expected_0_filesystems_in_1_but_found_2,
track.FileSystems.Length, testFile, idPlugins.Count));
- for(int i = 0; i < track.FileSystems.Length; i++)
+ for(var i = 0; i < track.FileSystems.Length; i++)
{
PluginBase plugins = PluginBase.Singleton;
bool found = plugins.Filesystems.TryGetValue(idPlugins[i], out Type pluginType);
@@ -207,9 +212,11 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
fs.GetInformation(image, partition, null, out _, out FileSystem fsMetadata);
if(track.FileSystems[i].ApplicationId != null)
+ {
Assert.AreEqual(track.FileSystems[i].ApplicationId,
fsMetadata.ApplicationIdentifier,
string.Format(Localization.Application_ID_0, testFile));
+ }
Assert.AreEqual(track.FileSystems[i].Bootable, fsMetadata.Bootable,
string.Format(Localization.Bootable_0, testFile));
@@ -221,8 +228,10 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
string.Format(Localization.Cluster_size_0, testFile));
if(track.FileSystems[i].SystemId != null)
+ {
Assert.AreEqual(track.FileSystems[i].SystemId, fsMetadata.SystemIdentifier,
string.Format(Localization.System_ID_0, testFile));
+ }
Assert.AreEqual(track.FileSystems[i].Type, fsMetadata.Type,
string.Format(Localization.Filesystem_type_0, testFile));
@@ -238,10 +247,14 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
if(track.FileSystems[i].Contents != null ||
track.FileSystems[i].ContentsJson != null ||
File.Exists($"{testFile}.track{track.Number}.filesystem{i}.contents.json"))
+ {
Assert.NotNull(null,
string.
- Format(Localization.Could_not_instantiate_filesystem_for_0_track_1_filesystem_2,
- testFile, track.Number, i));
+ Format(
+ Localization.
+ Could_not_instantiate_filesystem_for_0_track_1_filesystem_2,
+ testFile, track.Number, i));
+ }
continue;
}
@@ -267,10 +280,12 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
};
if(track.FileSystems[i].ContentsJson != null)
+ {
track.FileSystems[i].Contents =
JsonSerializer.
Deserialize>(track.FileSystems[i].ContentsJson,
serializerOptions);
+ }
else if(File.Exists($"{testFile}.track{track.Number}.filesystem{i}.contents.json"))
{
var sr =
@@ -284,7 +299,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
if(track.FileSystems[i].Contents is null)
continue;
- int currentDepth = 0;
+ var currentDepth = 0;
ReadOnlyFilesystemTest.TestDirectory(rofs, "/", track.FileSystems[i].Contents, testFile,
true,
@@ -318,6 +333,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
}
}
});
+ }
}
});
}
@@ -359,10 +375,7 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
if(image.Info.MetadataMediaType == MetadataMediaType.OpticalDisc)
{
- foreach(bool @long in new[]
- {
- false, true
- })
+ foreach(bool @long in new[] { false, true })
{
ctx = new Md5Context();
@@ -377,8 +390,9 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
if(sectors - doneSectors >= SECTORS_TO_READ)
{
- errno = @long ? image.ReadSectorsLong(doneSectors, SECTORS_TO_READ,
- currentTrack.Sequence, out sector)
+ errno = @long
+ ? image.ReadSectorsLong(doneSectors, SECTORS_TO_READ,
+ currentTrack.Sequence, out sector)
: image.ReadSectors(doneSectors, SECTORS_TO_READ, currentTrack.Sequence,
out sector);
@@ -386,8 +400,9 @@ public abstract class OpticalMediaImageTest : BaseMediaImageTest
}
else
{
- errno = @long ? image.ReadSectorsLong(doneSectors, (uint)(sectors - doneSectors),
- currentTrack.Sequence, out sector)
+ errno = @long
+ ? image.ReadSectorsLong(doneSectors, (uint)(sectors - doneSectors),
+ currentTrack.Sequence, out sector)
: image.ReadSectors(doneSectors, (uint)(sectors - doneSectors),
currentTrack.Sequence, out sector);
diff --git a/Aaru.Tests/Images/PowerISO/Cuesheet.cs b/Aaru.Tests/Images/PowerISO/Cuesheet.cs
index 3bf4d66b2..15105898a 100644
--- a/Aaru.Tests/Images/PowerISO/Cuesheet.cs
+++ b/Aaru.Tests/Images/PowerISO/Cuesheet.cs
@@ -39,6 +39,7 @@ public class Cuesheet : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "PowerISO", "Cuesheet");
+
public override IMediaImage Plugin => new CdrWin();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/QEMU/QCOW.cs b/Aaru.Tests/Images/QEMU/QCOW.cs
index 51cecc9b3..1b3a04935 100644
--- a/Aaru.Tests/Images/QEMU/QCOW.cs
+++ b/Aaru.Tests/Images/QEMU/QCOW.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.QEMU;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class QCOW : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "QEMU", "QEMU Copy On Write");
+
public override IMediaImage Plugin => new Qcow();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/QEMU/QCOW2.cs b/Aaru.Tests/Images/QEMU/QCOW2.cs
index 2e4fea44e..a9b3b3214 100644
--- a/Aaru.Tests/Images/QEMU/QCOW2.cs
+++ b/Aaru.Tests/Images/QEMU/QCOW2.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.QEMU;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class QCOW2 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "QEMU", "QEMU Copy On Write 2");
+
public override IMediaImage Plugin => new Qcow2();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/QEMU/QCOW3.cs b/Aaru.Tests/Images/QEMU/QCOW3.cs
index 62e03f6e1..c4cc73f61 100644
--- a/Aaru.Tests/Images/QEMU/QCOW3.cs
+++ b/Aaru.Tests/Images/QEMU/QCOW3.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.QEMU;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class QCOW3 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "QEMU", "QEMU Copy On Write 3");
+
public override IMediaImage Plugin => new Qcow2();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/QEMU/QED.cs b/Aaru.Tests/Images/QEMU/QED.cs
index 22d74497c..913bf1d88 100644
--- a/Aaru.Tests/Images/QEMU/QED.cs
+++ b/Aaru.Tests/Images/QEMU/QED.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.QEMU;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class QED : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "QEMU", "QEMU Enhanced Disk");
+
public override IMediaImage Plugin => new Qed();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/QEMU/VirtualBox.cs b/Aaru.Tests/Images/QEMU/VirtualBox.cs
index f86ede12f..ed94ca719 100644
--- a/Aaru.Tests/Images/QEMU/VirtualBox.cs
+++ b/Aaru.Tests/Images/QEMU/VirtualBox.cs
@@ -39,6 +39,7 @@ public class VirtualBox : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "QEMU", "VirtualBox");
+
public override IMediaImage Plugin => new Vdi();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/RayDIM.cs b/Aaru.Tests/Images/RayDIM.cs
index 850b18b9c..f9b8edee1 100644
--- a/Aaru.Tests/Images/RayDIM.cs
+++ b/Aaru.Tests/Images/RayDIM.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class RayDIM : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "Disk IMage Archiver");
+
public override IMediaImage Plugin => new RayDim();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/ShrinkWrap/DiskCopy42.cs b/Aaru.Tests/Images/ShrinkWrap/DiskCopy42.cs
index 05571cac3..8049f38cd 100644
--- a/Aaru.Tests/Images/ShrinkWrap/DiskCopy42.cs
+++ b/Aaru.Tests/Images/ShrinkWrap/DiskCopy42.cs
@@ -38,6 +38,7 @@ public class DiskCopy42 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "ShrinkWrap 3", "DiskCopy 4.2");
+
public override IMediaImage Plugin => new DiscImages.DiskCopy42();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/ShrinkWrap/DiskDup.cs b/Aaru.Tests/Images/ShrinkWrap/DiskDup.cs
index 6d7b8174b..00f8aca56 100644
--- a/Aaru.Tests/Images/ShrinkWrap/DiskDup.cs
+++ b/Aaru.Tests/Images/ShrinkWrap/DiskDup.cs
@@ -39,6 +39,7 @@ public class DiskDup : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "ShrinkWrap 3", "DiskDup+");
+
public override IMediaImage Plugin => new ZZZRawImage();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/ShrinkWrap/NDIF/ROCo.cs b/Aaru.Tests/Images/ShrinkWrap/NDIF/ROCo.cs
index 384b6a051..c7cadc61b 100644
--- a/Aaru.Tests/Images/ShrinkWrap/NDIF/ROCo.cs
+++ b/Aaru.Tests/Images/ShrinkWrap/NDIF/ROCo.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.ShrinkWrap.NDIF;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class ROCo : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "ShrinkWrap 3",
"NDIF", "DiskCopy compression");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/ShrinkWrap/NDIF/RdWr.cs b/Aaru.Tests/Images/ShrinkWrap/NDIF/RdWr.cs
index 7d21f6f53..02814317a 100644
--- a/Aaru.Tests/Images/ShrinkWrap/NDIF/RdWr.cs
+++ b/Aaru.Tests/Images/ShrinkWrap/NDIF/RdWr.cs
@@ -39,6 +39,7 @@ public class RdWr : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "ShrinkWrap 3",
"NDIF", "No compression", "No encryption");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/ShrinkWrap/NDIF/Rdxx.cs b/Aaru.Tests/Images/ShrinkWrap/NDIF/Rdxx.cs
index b68919dcf..e0463c6a9 100644
--- a/Aaru.Tests/Images/ShrinkWrap/NDIF/Rdxx.cs
+++ b/Aaru.Tests/Images/ShrinkWrap/NDIF/Rdxx.cs
@@ -39,6 +39,7 @@ public class Rdxx : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "ShrinkWrap 3",
"NDIF", "Simple compression");
+
public override IMediaImage Plugin => new Ndif();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/ShrinkWrap/Raw.cs b/Aaru.Tests/Images/ShrinkWrap/Raw.cs
index f501042ef..e3fe3c257 100644
--- a/Aaru.Tests/Images/ShrinkWrap/Raw.cs
+++ b/Aaru.Tests/Images/ShrinkWrap/Raw.cs
@@ -39,6 +39,7 @@ public class Raw : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "ShrinkWrap 3", "raw");
+
public override IMediaImage Plugin => new ZZZRawImage();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/TapeMediaImageTest.cs b/Aaru.Tests/Images/TapeMediaImageTest.cs
index 1f5ea2981..381a07556 100644
--- a/Aaru.Tests/Images/TapeMediaImageTest.cs
+++ b/Aaru.Tests/Images/TapeMediaImageTest.cs
@@ -52,6 +52,7 @@ public abstract class TapeMediaImageTest : BaseMediaImageTest
Assert.AreEqual(true, image.IsTape, string.Format(Localization.Is_tape_0, testFile));
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
image.Files.Should().
@@ -60,6 +61,7 @@ public abstract class TapeMediaImageTest : BaseMediaImageTest
image.TapePartitions.Should().
BeEquivalentTo(test.Partitions, string.Format(Localization.Tape_partitions_0, testFile));
});
+ }
}
});
}
@@ -97,6 +99,7 @@ public abstract class TapeMediaImageTest : BaseMediaImageTest
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(test.Sectors, image.Info.Sectors,
@@ -108,6 +111,7 @@ public abstract class TapeMediaImageTest : BaseMediaImageTest
Assert.AreEqual(test.MediaType, image.Info.MediaType,
string.Format(Localization.Media_type_0, testFile));
});
+ }
}
});
}
diff --git a/Aaru.Tests/Images/UltraISO/Alcohol.cs b/Aaru.Tests/Images/UltraISO/Alcohol.cs
index 0e6409a7b..3fd5d1875 100644
--- a/Aaru.Tests/Images/UltraISO/Alcohol.cs
+++ b/Aaru.Tests/Images/UltraISO/Alcohol.cs
@@ -38,6 +38,7 @@ public class Alcohol : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "UltraISO", "Alcohol");
+
public override IMediaImage Plugin => new DiscImages.Alcohol120();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/UltraISO/CloneCD.cs b/Aaru.Tests/Images/UltraISO/CloneCD.cs
index 081a3d3a6..3f81c9c4d 100644
--- a/Aaru.Tests/Images/UltraISO/CloneCD.cs
+++ b/Aaru.Tests/Images/UltraISO/CloneCD.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.UltraISO;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class CloneCD : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "UltraISO", "CloneCD");
+
public override IMediaImage Plugin => new CloneCd();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/UltraISO/Cuesheet.cs b/Aaru.Tests/Images/UltraISO/Cuesheet.cs
index 731403479..52a58f6bc 100644
--- a/Aaru.Tests/Images/UltraISO/Cuesheet.cs
+++ b/Aaru.Tests/Images/UltraISO/Cuesheet.cs
@@ -39,6 +39,7 @@ public class Cuesheet : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "UltraISO", "Cuesheet");
+
public override IMediaImage Plugin => new CdrWin();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/VirtualBox/VirtualPC.cs b/Aaru.Tests/Images/VirtualBox/VirtualPC.cs
index c23dde39c..1835ad267 100644
--- a/Aaru.Tests/Images/VirtualBox/VirtualPC.cs
+++ b/Aaru.Tests/Images/VirtualBox/VirtualPC.cs
@@ -39,6 +39,7 @@ public class VirtualPc : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "VirtualBox", "VirtualPC");
+
public override IMediaImage Plugin => new Vhd();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/cdrdao/cooked/nosub.cs b/Aaru.Tests/Images/cdrdao/cooked/nosub.cs
index fb5a1108a..c91beb49c 100644
--- a/Aaru.Tests/Images/cdrdao/cooked/nosub.cs
+++ b/Aaru.Tests/Images/cdrdao/cooked/nosub.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.cdrdao.cooked;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class nosub : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "cdrdao", "cooked", "nosub");
+
public override IMediaImage Plugin => new Cdrdao();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/cdrdao/cooked/rw.cs b/Aaru.Tests/Images/cdrdao/cooked/rw.cs
index de58b5d9a..c48feac44 100644
--- a/Aaru.Tests/Images/cdrdao/cooked/rw.cs
+++ b/Aaru.Tests/Images/cdrdao/cooked/rw.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.cdrdao.cooked;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class rw : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "cdrdao", "cooked", "rw");
+
public override IMediaImage Plugin => new Cdrdao();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/cdrdao/cooked/rw_raw.cs b/Aaru.Tests/Images/cdrdao/cooked/rw_raw.cs
index e3156c7b1..79c8d5749 100644
--- a/Aaru.Tests/Images/cdrdao/cooked/rw_raw.cs
+++ b/Aaru.Tests/Images/cdrdao/cooked/rw_raw.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.cdrdao.cooked;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class rw_raw : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "cdrdao", "cooked", "rw_raw");
+
public override IMediaImage Plugin => new Cdrdao();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/cdrdao/raw/nosub.cs b/Aaru.Tests/Images/cdrdao/raw/nosub.cs
index 58da2f62e..2934c45be 100644
--- a/Aaru.Tests/Images/cdrdao/raw/nosub.cs
+++ b/Aaru.Tests/Images/cdrdao/raw/nosub.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.cdrdao.raw;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class nosub : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "cdrdao", "raw", "nosub");
+
public override IMediaImage Plugin => new Cdrdao();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/cdrdao/raw/rw.cs b/Aaru.Tests/Images/cdrdao/raw/rw.cs
index 765aa71f0..820b5f1eb 100644
--- a/Aaru.Tests/Images/cdrdao/raw/rw.cs
+++ b/Aaru.Tests/Images/cdrdao/raw/rw.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.cdrdao.raw;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class rw : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "cdrdao", "raw", "rw");
+
public override IMediaImage Plugin => new Cdrdao();
public override OpticalImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/cdrdao/raw/rw_raw.cs b/Aaru.Tests/Images/cdrdao/raw/rw_raw.cs
index d46f77397..eaf173f67 100644
--- a/Aaru.Tests/Images/cdrdao/raw/rw_raw.cs
+++ b/Aaru.Tests/Images/cdrdao/raw/rw_raw.cs
@@ -35,11 +35,13 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.cdrdao.raw;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class rw_raw : OpticalMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "cdrdao", "raw", "rw_raw");
+
public override IMediaImage Plugin => new Cdrdao();
public override OpticalImageTestExpected[] Tests => new[]
@@ -569,7 +571,9 @@ public class rw_raw : OpticalMediaImageTest
}
}
},
- #region These test images violate the specifications and are not expected to work yet
+
+ #region These test images violate the specifications and are not expected to work yet
+
/*
new OpticalImageTestExpected
{
@@ -692,6 +696,7 @@ public class rw_raw : OpticalMediaImageTest
}
},
*/
- #endregion
+
+ #endregion
};
}
\ No newline at end of file
diff --git a/Aaru.Tests/Images/pce/DiskCopy42.cs b/Aaru.Tests/Images/pce/DiskCopy42.cs
index e5bc6b220..bc85103e3 100644
--- a/Aaru.Tests/Images/pce/DiskCopy42.cs
+++ b/Aaru.Tests/Images/pce/DiskCopy42.cs
@@ -38,6 +38,7 @@ public class DiskCopy42 : BlockMediaImageTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Media image formats", "pce", "DiskCopy 4.2");
+
public override IMediaImage Plugin => new DiscImages.DiskCopy42();
public override BlockImageTestExpected[] Tests => new[]
diff --git a/Aaru.Tests/Images/pce/XDF.cs b/Aaru.Tests/Images/pce/XDF.cs
index ebce6c0e7..d80b080b4 100644
--- a/Aaru.Tests/Images/pce/XDF.cs
+++ b/Aaru.Tests/Images/pce/XDF.cs
@@ -35,7 +35,8 @@ using NUnit.Framework;
namespace Aaru.Tests.Images.pce;
-[TestFixture, SuppressMessage("ReSharper", "InconsistentNaming")]
+[TestFixture]
+[SuppressMessage("ReSharper", "InconsistentNaming")]
public class XDF : BlockMediaImageTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Media image formats", "pce", "XDF");
diff --git a/Aaru.Tests/Issues/263/AaruFormat.cs b/Aaru.Tests/Issues/263/AaruFormat.cs
index 180f80546..8c2d326b7 100644
--- a/Aaru.Tests/Issues/263/AaruFormat.cs
+++ b/Aaru.Tests/Issues/263/AaruFormat.cs
@@ -4,7 +4,7 @@ using System.IO;
namespace Aaru.Tests.Issues._263;
/* https://github.com/aaru-dps/Aaru/issues/263
- *
+ *
* SilasLaspada commented on Jan 2, 2020
* Trying to extract the files from a DICF image results in the error "Error reading file: Object reference not
* set to an instance of an object." Dumping and extracting as ISO does work, but there are issues with that too.
diff --git a/Aaru.Tests/Issues/263/Raw.cs b/Aaru.Tests/Issues/263/Raw.cs
index 84e45b2b6..7486ba28f 100644
--- a/Aaru.Tests/Issues/263/Raw.cs
+++ b/Aaru.Tests/Issues/263/Raw.cs
@@ -4,7 +4,7 @@ using System.IO;
namespace Aaru.Tests.Issues._263;
/* https://github.com/aaru-dps/Aaru/issues/263
- *
+ *
* SilasLaspada commented on Jan 2, 2020
* Trying to extract the files from a DICF image results in the error "Error reading file: Object reference not
* set to an instance of an object." Dumping and extracting as ISO does work, but there are issues with that too.
diff --git a/Aaru.Tests/Issues/288/ArcadeHits.cs b/Aaru.Tests/Issues/288/ArcadeHits.cs
index b59a15439..daedd56d3 100644
--- a/Aaru.Tests/Issues/288/ArcadeHits.cs
+++ b/Aaru.Tests/Issues/288/ArcadeHits.cs
@@ -14,10 +14,13 @@ namespace Aaru.Tests.Issues._288;
public class ArcadeHits : OpticalImageConvertIssueTest
{
public override Dictionary ParsedOptions => new();
+
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Issues", "Fixed", "issue288", "arcadehits");
+
public override string InputPath =>
"Midway's Greatest Arcade Hits Volume 1 v1.001 (2000)(Midway)(US)[!][compilation].gdi";
+
public override string SuggestedOutputFilename => "AaruTestIssue288_arcadehits.aif";
public override IWritableImage OutputFormat => new AaruFormat();
public override string Md5 => null;
diff --git a/Aaru.Tests/Issues/410.cs b/Aaru.Tests/Issues/410.cs
index b247d0d10..74d5b9eac 100644
--- a/Aaru.Tests/Issues/410.cs
+++ b/Aaru.Tests/Issues/410.cs
@@ -4,17 +4,17 @@ using System.IO;
namespace Aaru.Tests.Issues;
/* https://github.com/aaru-dps/Aaru/issues/410
- *
+ *
* darkstar commented on Sep 27, 2020
- *
+ *
* I have two (original/pressed) CDs that were apparently mastered incorrectly. Neither the physical discs nor the
* dumps (as generated by Aaru, A120% or any other tool) can be read by and "modern"-ish operating system or ISO
* tool. They just show either an empty root directory or abort with an error.
- *
+ *
* However, both the CDs and the dumps can be read perfectly fine in a VM running Windows 98
- *
+ *
* The CD in question for this issue is:
- *
+ *
* MissionForce: Cyberstorm (uploaded to archive.org here )
*/
diff --git a/Aaru.Tests/Issues/411.cs b/Aaru.Tests/Issues/411.cs
index 03bde4ea3..58f6e9091 100644
--- a/Aaru.Tests/Issues/411.cs
+++ b/Aaru.Tests/Issues/411.cs
@@ -4,17 +4,17 @@ using System.IO;
namespace Aaru.Tests.Issues;
/* https://github.com/aaru-dps/Aaru/issues/411
- *
+ *
* darkstar commented on Sep 27, 2020
- *
+ *
* I have two (original/pressed) CDs that were apparently mastered incorrectly. Neither the physical discs nor the
* dumps (as generated by Aaru, A120% or any other tool) can be read by and "modern"-ish operating system or ISO
* tool. They just show either an empty root directory or abort with an error.
- *
+ *
* However, both the CDs and the dumps can be read perfectly fine in a VM running Windows 98
*
* The CD in question is:
- *
+ *
* CD 2 ("Master Quiz") of the 10-game pack available here
*/
diff --git a/Aaru.Tests/Issues/590/asus-driver-gpu-tweak-v1231-2014.cs b/Aaru.Tests/Issues/590/asus-driver-gpu-tweak-v1231-2014.cs
index be5a23c28..d8d960884 100644
--- a/Aaru.Tests/Issues/590/asus-driver-gpu-tweak-v1231-2014.cs
+++ b/Aaru.Tests/Issues/590/asus-driver-gpu-tweak-v1231-2014.cs
@@ -18,6 +18,7 @@ public class asus_driver_gpu_tweak_v1231_2014 : FsExtractHashIssueTest
{
protected override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Issues", "Fixed", "issue590",
"asus-driver-gpu-tweak-v1231-2014");
+
protected override string TestFile => "V1231.aaruf";
protected override Dictionary ParsedOptions => new();
protected override bool Debug => false;
diff --git a/Aaru.Tests/Issues/590/m5a99fx.cs b/Aaru.Tests/Issues/590/m5a99fx.cs
index 56f5b87fd..a57e835ec 100644
--- a/Aaru.Tests/Issues/590/m5a99fx.cs
+++ b/Aaru.Tests/Issues/590/m5a99fx.cs
@@ -18,6 +18,7 @@ public class m5a99fx : FsExtractHashIssueTest
{
protected override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Issues", "Fixed", "issue590", "m5a99fx");
+
protected override string TestFile => "MB Support CD.aaruf";
protected override Dictionary ParsedOptions => new();
protected override bool Debug => false;
diff --git a/Aaru.Tests/Issues/623.cs b/Aaru.Tests/Issues/623.cs
index f38644e3f..9a590d6eb 100644
--- a/Aaru.Tests/Issues/623.cs
+++ b/Aaru.Tests/Issues/623.cs
@@ -12,6 +12,7 @@ public class _623 : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new AaruFormat();
public override IWritableImage OutputPlugin => new Alcohol120();
public override string OutputExtension => "mds";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/Issues/624.cs b/Aaru.Tests/Issues/624.cs
index f1aabfcd5..1b4f843ca 100644
--- a/Aaru.Tests/Issues/624.cs
+++ b/Aaru.Tests/Issues/624.cs
@@ -12,6 +12,7 @@ public class _624 : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new ZZZRawImage();
public override IWritableImage OutputPlugin => new Alcohol120();
public override string OutputExtension => "mds";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/Issues/625.cs b/Aaru.Tests/Issues/625.cs
index fc3f3567b..2795b8089 100644
--- a/Aaru.Tests/Issues/625.cs
+++ b/Aaru.Tests/Issues/625.cs
@@ -12,6 +12,7 @@ public class _625 : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new Cdrdao();
public override IWritableImage OutputPlugin => new CloneCd();
public override string OutputExtension => "mds";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/Issues/FsExtractHashIssueTest.cs b/Aaru.Tests/Issues/FsExtractHashIssueTest.cs
index 20091f341..3cdcdbd1c 100644
--- a/Aaru.Tests/Issues/FsExtractHashIssueTest.cs
+++ b/Aaru.Tests/Issues/FsExtractHashIssueTest.cs
@@ -71,7 +71,7 @@ public abstract class FsExtractHashIssueTest
});
}
- bool filesystemFound = false;
+ var filesystemFound = false;
Assert.True(File.Exists($"{TestFile}.unittest.json"));
@@ -97,7 +97,7 @@ public abstract class FsExtractHashIssueTest
string.Format(Localization.Excepted_0_partitions_but_found_1, expectedData.Partitions.Length,
partitions.Count));
- for(int i = 0; i < partitions.Count; i++)
+ for(var i = 0; i < partitions.Count; i++)
{
Core.Filesystems.Identify(imageFormat, out List idPlugins, partitions[i]);
@@ -117,7 +117,7 @@ public abstract class FsExtractHashIssueTest
string.Format(Localization.Expected_0_filesystems_identified_in_partition_1_but_found_2,
expectedData.Partitions[i].Volumes.Length, i, idPlugins.Count));
- for(int j = 0; j < idPlugins.Count; j++)
+ for(var j = 0; j < idPlugins.Count; j++)
{
string pluginName = idPlugins[j];
@@ -139,9 +139,10 @@ public abstract class FsExtractHashIssueTest
Assert.AreEqual(expectedData.Partitions[i].Volumes[j].VolumeName, fs.Metadata.VolumeName,
string.
- Format(Localization.Excepted_volume_name_0_for_filesystem_1_in_partition_2_but_found_3,
- expectedData.Partitions[i].Volumes[j].VolumeName, j, i,
- fs.Metadata.VolumeName));
+ Format(
+ Localization.Excepted_volume_name_0_for_filesystem_1_in_partition_2_but_found_3,
+ expectedData.Partitions[i].Volumes[j].VolumeName, j, i,
+ fs.Metadata.VolumeName));
VolumeData volumeData = expectedData.Partitions[i].Volumes[j];
@@ -225,6 +226,7 @@ public abstract class FsExtractHashIssueTest
Dictionary expectedXattrs = fileData.XattrsWithMd5;
if(error == ErrorNumber.NoError)
+ {
foreach(string xattr in xattrs)
{
Assert.IsTrue(expectedXattrs.TryGetValue(xattr, out string expectedXattrMd5),
@@ -246,13 +248,16 @@ public abstract class FsExtractHashIssueTest
string.Format(Localization.Invalid_checksum_for_xattr_0_for_file_1, xattr,
path + "/" + entry));
}
+ }
expectedXattrs.Should().
- BeEmpty(string.Format(Localization.Expected_extended_attributes_not_found_for_file_0, path + "/" + entry),
- expectedXattrs);
+ BeEmpty(
+ string.Format(Localization.Expected_extended_attributes_not_found_for_file_0,
+ path + "/" + entry),
+ expectedXattrs);
}
- byte[] buffer = new byte[stat.Length];
+ var buffer = new byte[stat.Length];
ErrorNumber ret = fs.OpenFile(path + "/" + entry, out IFileNode fileNode);
Assert.AreEqual(ErrorNumber.NoError, ret,
diff --git a/Aaru.Tests/Issues/FsExtractIssueTest.cs b/Aaru.Tests/Issues/FsExtractIssueTest.cs
index b773d02a5..e1cc450c9 100644
--- a/Aaru.Tests/Issues/FsExtractIssueTest.cs
+++ b/Aaru.Tests/Issues/FsExtractIssueTest.cs
@@ -65,9 +65,9 @@ public abstract class FsExtractIssueTest
});
}
- bool filesystemFound = false;
+ var filesystemFound = false;
- for(int i = 0; i < partitions.Count; i++)
+ for(var i = 0; i < partitions.Count; i++)
{
Core.Filesystems.Identify(imageFormat, out List idPlugins, partitions[i]);
@@ -80,6 +80,7 @@ public abstract class FsExtractIssueTest
if(idPlugins.Count > 1)
{
foreach(string pluginName in idPlugins)
+ {
if(plugins.ReadOnlyFilesystems.TryGetValue(pluginName, out pluginType))
{
Assert.IsNotNull(pluginType, Localization.Could_not_instantiate_filesystem_plugin);
@@ -98,6 +99,7 @@ public abstract class FsExtractIssueTest
ExtractFilesInDir("/", fs, Xattrs);
}
+ }
}
else
{
@@ -158,6 +160,7 @@ public abstract class FsExtractIssueTest
path + "/" + entry));
if(error == ErrorNumber.NoError)
+ {
foreach(string xattr in xattrs)
{
byte[] xattrBuf = Array.Empty();
@@ -167,9 +170,10 @@ public abstract class FsExtractIssueTest
string.Format(Localization.Error_0_reading_extended_attributes_for_entry_1,
error, path + "/" + entry));
}
+ }
}
- byte[] buffer = new byte[stat.Length];
+ var buffer = new byte[stat.Length];
ErrorNumber ret = fs.OpenFile(path + "/" + entry, out IFileNode fileNode);
Assert.AreEqual(ErrorNumber.NoError, ret,
diff --git a/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs b/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs
index 2c4edd79c..93c922039 100644
--- a/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs
+++ b/Aaru.Tests/Issues/OpticalImageConvertIssueTest.cs
@@ -71,12 +71,14 @@ public abstract class OpticalImageConvertIssueTest
var inputOptical = inputFormat as IOpticalMediaImage;
var outputOptical = OutputFormat as IWritableOpticalImage;
- Assert.IsNotNull(inputOptical, Localization.Could_not_treat_existing_image_as_optical_disc);
- Assert.IsNotNull(outputOptical, Localization.Could_not_treat_new_image_as_optical_disc);
+ Assert.IsNotNull(inputOptical, Localization.Could_not_treat_existing_image_as_optical_disc);
+ Assert.IsNotNull(outputOptical, Localization.Could_not_treat_new_image_as_optical_disc);
Assert.IsNotNull(inputOptical.Tracks, Localization.Existing_image_contains_no_tracks);
- Assert.IsTrue(outputOptical.Create(outputPath, inputFormat.Info.MediaType, ParsedOptions, inputFormat.Info.Sectors, inputFormat.Info.SectorSize),
- string.Format(Localization.Error_0_creating_output_image, outputOptical.ErrorMessage));
+ Assert.IsTrue(
+ outputOptical.Create(outputPath, inputFormat.Info.MediaType, ParsedOptions, inputFormat.Info.Sectors,
+ inputFormat.Info.SectorSize),
+ string.Format(Localization.Error_0_creating_output_image, outputOptical.ErrorMessage));
var metadata = new ImageInfo
{
@@ -137,19 +139,22 @@ public abstract class OpticalImageConvertIssueTest
else
sectorsToDo = (uint)(trackSectors - doneSectors);
- bool useNotLong = false;
- bool result = false;
+ var useNotLong = false;
+ var result = false;
if(UseLong)
{
- errno = sectorsToDo == 1 ? inputFormat.ReadSectorLong(doneSectors + track.StartSector, out sector)
+ errno = sectorsToDo == 1
+ ? inputFormat.ReadSectorLong(doneSectors + track.StartSector, out sector)
: inputFormat.ReadSectorsLong(doneSectors + track.StartSector, sectorsToDo, out sector);
if(errno == ErrorNumber.NoError)
+ {
result = sectorsToDo == 1
? outputOptical.WriteSectorLong(sector, doneSectors + track.StartSector)
: outputOptical.WriteSectorsLong(sector, doneSectors + track.StartSector,
sectorsToDo);
+ }
else
result = true;
@@ -160,12 +165,14 @@ public abstract class OpticalImageConvertIssueTest
if(!UseLong || useNotLong)
{
- errno = sectorsToDo == 1 ? inputFormat.ReadSector(doneSectors + track.StartSector, out sector)
+ errno = sectorsToDo == 1
+ ? inputFormat.ReadSector(doneSectors + track.StartSector, out sector)
: inputFormat.ReadSectors(doneSectors + track.StartSector, sectorsToDo, out sector);
Assert.AreEqual(ErrorNumber.NoError, errno);
- result = sectorsToDo == 1 ? outputOptical.WriteSector(sector, doneSectors + track.StartSector)
+ result = sectorsToDo == 1
+ ? outputOptical.WriteSector(sector, doneSectors + track.StartSector)
: outputOptical.WriteSectors(sector, doneSectors + track.StartSector, sectorsToDo);
}
@@ -182,9 +189,9 @@ public abstract class OpticalImageConvertIssueTest
string mcn = null;
HashSet subchannelExtents = new();
Dictionary smallestPregapLbaPerTrack = new();
- Track[] tracks = new Track[inputOptical.Tracks.Count];
+ var tracks = new Track[inputOptical.Tracks.Count];
- for(int i = 0; i < tracks.Length; i++)
+ for(var i = 0; i < tracks.Length; i++)
{
tracks[i] = new Track
{
@@ -340,8 +347,10 @@ public abstract class OpticalImageConvertIssueTest
result = true;
}
else
+ {
result = outputOptical.WriteSectorsTag(sector, doneSectors + track.StartSector, sectorsToDo,
tag);
+ }
}
Assert.IsTrue(result,
@@ -354,15 +363,18 @@ public abstract class OpticalImageConvertIssueTest
}
if(isrcs.Count > 0)
+ {
foreach(KeyValuePair isrc in isrcs)
outputOptical.WriteSectorTag(Encoding.UTF8.GetBytes(isrc.Value), isrc.Key, SectorTagType.CdTrackIsrc);
+ }
if(trackFlags.Count > 0)
+ {
foreach((byte track, byte flags) in trackFlags)
- outputOptical.WriteSectorTag(new[]
- {
- flags
- }, track, SectorTagType.CdTrackFlags);
+ {
+ outputOptical.WriteSectorTag(new[] { flags }, track, SectorTagType.CdTrackFlags);
+ }
+ }
if(mcn != null)
outputOptical.WriteMediaTag(Encoding.UTF8.GetBytes(mcn), MediaTagType.CD_MCN);
diff --git a/Aaru.Tests/Localization/Localization.es.resx b/Aaru.Tests/Localization/Localization.es.resx
index 7056ce7bf..3f1dbc49a 100644
--- a/Aaru.Tests/Localization/Localization.es.resx
+++ b/Aaru.Tests/Localization/Localization.es.resx
@@ -1,544 +1,544 @@
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
- PublicKeyToken=b77a5c561934e089
-
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
- PublicKeyToken=b77a5c561934e089
-
-
-
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
+ PublicKeyToken=b77a5c561934e089
+
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
+ PublicKeyToken=b77a5c561934e089
+
+
+
ID de aplicación: {0}
-
+
Arrancable: {0}
-
+
Anchos del bus - {0}
-
+
No se pudo abrir la imagen para {0}
-
+
No se pudo abrir la imagen de prueba
-
+
No se pudo abrir el fichero especificado
-
+
Tamaño de la tarjeta - {0}
-
+
Multiplicador del tamaño de la tarjeta - {0}
-
+
Clases - {0}
-
+
Clústeres: {0}
-
+
Tamaño del clúster: {0}
-
+
Soporte de comandos - {0}
-
+
¡Los contenidos para "{0}" en {1} deben definirse en la declaración de la prueba!
-
+
Convirtiendo etiqueta de medio {0}
-
+
Copia - {0}
-
+
No se pudieron encontrar los hijos de "{0}" en {1}: {2}
-
+
No se pudieron encontrado los siguientes atributos extendidos de "{0}" en {1}: {2}
-
+
No se pudo instanciar el sistema de ficheros {0}
-
+
No se pudo instanciar el sistema de ficheros para {0}
-
+
No se pudo instanciar el sistema de ficheros para {0}, pista {1}, sistema de ficheros {2}
-
+
No se pudo instanciar la extensión del sistema de ficheros
-
+
No se pudo instanciar la extensión de entrada para {0}
-
+
No se pudo instanciar la extensión de salida para {0}
-
+
No se pudo montar {0} en la partición {1}.
-
+
No se pudo tratar la imagen existente como un disco óptico.
-
+
No se pudo tratar la nueva imagen como un disco óptico.
-
+
CRC - {0}
-
+
Estado de datos después del borrado - {0}
-
+
Descodificado - {0}
-
+
ECC por defecto - {0}
-
+
Los atributos extendidos definidos para "{0}" en {1} no están soportados por el sistema de ficheros.
-
+
DSR implementada - {0}
-
+
ECC - {0}
-
+
Activación de bloque de borrado - {0}
-
+
Tamaño de grupo de borrado - {0}
-
+
Tamaño de sector de borrado - {0}
-
+
Error {0} cerrando la imagen... Los contenidos no son correctos.
-
+
Error {0} creando la imagen.
-
+
Error {0} obteniendo los atributos extendidos para {1}
-
+
Error {0} leyendo los atributos extendidos para {1}
-
+
Error {0} leyendo el fichero {1}
-
+
Error {0} leyendo el directorio raíz
-
+
Error {0} leyendo etiqueta, no se continuará
-
+
Error {0} enviado lista de pistas a la imagen.
-
+
Error {0} estableciendo metadatos.
-
+
Error {0} escribiendo sector {1}...
-
+
Error {0} escribiendo sector {1}, no se continuará...
-
+
Error {0} escribiendo etiqueta del sector {1}, no se continuará...
-
+
Error {0} escribiendo etiqueta, no se continuará...
-
+
Error obtenido información de entrada {0}
-
+
Se esperaban {0} particiones pero se encontraron {1}
-
+
Se esperaba nombre de volumen "{0}" para el sistema de ficheros {1} en la partición {2} pero se encontró "{3}"
-
+
La imagen no contiene pistas.
-
+
Se esperaba identificar {0} sistemas de ficheros en la partición {1} pero se identificaron {2}
-
+
Se esperaba identificar {0} sistemas de ficheros en {1} pero se identificarón {2}
-
+
Se esperaban {0} particiones en {1} pero se encontraron {2}
-
+
Directorios esperados no encontrados:
-
+
Atributos extendidos esperados no encontrados para el fichero {0}:
-
+
Ficheros esperados no encontrados:
-
+
No se esperaba identificar ningún sistema de ficheros en la partición {0} pero se identificaron {1}
-
+
Se esperaba que la partición {0} tuviera {1} sectores pero tiene {2} en {3}
-
+
Se esperaba que la partición {0} empezara en el sector {1} pero lo hace en el {2} en {3}
-
+
¡Los atributos extendidos para "{0}" en {1} deben definirse en la declaración de la prueba!
-
+
Seguridad extendida - {0}
-
+
Sistema de ficheros no identificado para {0}
-
+
Tipo de sistema de ficheros: {0}
-
+
Formato de fichero - {0}
-
+
Grupo de formato de fichero - {0}
-
+
Filtro: {0}
-
+
No se detectó el filtro para el fichero de prueba
-
+
Encontrados los siguientes hijos de "{0}" en {1} no esperados: {2}
-
+
Encontrados los siguientes atributos extendidos de "{0}" en {1} no esperados: {2}
-
+
Encontrado directorio {0} no esperado
-
+
Encontrado atributo extendido {0} en el fichero {1} no esperado
-
+
Encontrado fichero {0} no esperado
-
+
Se obtuvieron menos bytes ({0}) de lo esperado ({1}) al leer {2} en {3}
-
+
Se obtuvo el MD5 {0} para "{1}" en {2} pero se esperaba {3}
-
+
Se obtuvo el MD5 {0} para {1} de "{2}" en {3} pero se esperaba {4}
-
+
Se obtuvieron datos incorrectos para el directorio "{0}" en {1}
-
+
Se obtuvieron datos incorrectos para el enlace simbólico "{0}" en {1}
-
+
Los hash son diferentes
-
+
Hash: {0}
-
+
Hash (salida)
-
+
Format de imagen: {0}
-
+
No se detectó el formato del fichero de prueba
-
+
El formato del fichero de prueba no es para un disco óptico
-
+
No se identificó el formato de la imagen de entrada, no se procederá con la conversión
-
+
La imagen de entrada no soporta sectores largos.
-
+
No se identificó el formato de la imagen, no se procederá con el análisis
-
+
Checksum no válido para el fichero {0}
-
+
Checksum no válido para el atributo extendido {0} del fichero {1}
-
+
Objetivo no válido para el enlace simbólico "{0}" en {1}
-
+
¿Es una cinta?: {0}
-
+
El último sector de las pistas es {0}, pero es {1} en la imagen
-
+
El último sector de las pistas es {0}, pero es {1} en la imagen (salida)
-
+
Hash largo (salida)
-
+
Fabricante - {0}
-
+
Reservado del fabricante - {0}
-
+
Fecha de fabricación - {0}
-
+
Tipo de medio: {0}
-
+
No descodificado - {0}
-
+
No identificado para {0}
-
+
No se encontraron sistemas de ficheros.
-
+
No se encontraron sistemas de ficheros para {0}
-
+
No se encontraron particiones
-
+
No se encontraron particiones para {0}
-
+
NSAC - {0}
-
+
Abierto: {0}
-
+
Abierto el creado: {0}
-
+
El fichero de salida ya existe, no se continuará.
-
+
El formato de salida no soporta el tipo de medio, no se puede continuar...
-
+
Particiones: {0}
-
+
Protección contra escritura permanente - {0}
-
+
Nombre del producto - {0}
-
+
Revisión del producto - {0}
-
+
Corriente de lectura en el Vdd máximo - {0}
-
+
Corriente de lectura en el Vdd mínimo - {0}
-
+
Lee bloques no alineados - {0}
-
+
Lee bloques parciales - {0}
-
+
Longitud del bloque de lectura - {0}
-
+
Factor entre lectura y escritura - {0}
-
+
Sectores: {0}
-
+
Sectores (salida): {0}
-
+
Tamaño de sector: {0}
-
+
Tamaño de sector (salida): {0}
-
+
Seguridad - {0}
-
+
Número de serie - {0}
-
+
Tamaño - {0}
-
+
Versión de especificación - {0}
-
+
Spec 3 - {0}
-
+
Spec 4 - {0}
-
+
Spec X - {0}
-
+
Versión de estructura - {0}
-
+
Hash del subcanal: {0}
-
+
Hash del subcanal (salida): {0}
-
+
ID de sistema: {0}
-
+
TAAC - {0}
-
+
Ficheros de cinta: {0}
-
+
Particiones de cinta: {0}
-
+
Protección contra escritura temporal - {0}
-
+
Fichero de prueba no encontrado
-
+
Pistas: {0}
-
+
Pistas (salida): {0}
-
+
Fin de pista: {0}
-
+
Fin de pista (salida): {0}
-
+
Banderas de pista: {0}
-
+
Banderas de pista (salida): {0}
-
+
Hueco anterior de pista: {0}
-
+
Hueco anterior de pista (salida): {0}
-
+
Sesión de la pista: {0}
-
+
Sesión de la pista (salida): {0}
-
+
Comienzo de pista: {0}
-
+
Comienzo de pista (salida): {0}
-
+
Velocidad de transferencia - {0}
-
+
Intentando convertir tipo de medio {0} no soportado para {1}
-
+
No se pudo abrir la imagen
-
+
Error inesperado {0} obteniendo los atributos extendidos para "{1}" en {2}
-
+
Error inesperado {0} obteniendo información para "{1}" en {2}
-
+
Error inesperado {0} listando los atributos extendidos para "{1}" en {2}
-
+
Error inesperado {0} leyendo "{1}" en {2}
-
+
Error inesperado {0} leyendo el directorio "{1}" en {2}
-
+
No montable: {0}
-
+
Versión - {0}
-
+
Nombre del volumen: {0}
-
+
Número de serie del volumen: {0}
-
+
Escribe bloques no alineados - {0}
-
+
Escribe bloques parciales - {0}
-
+
longitud del bloque de escritura - {0}
-
+
Activa grupo de protección contra escritura - {0}
-
+
Tamaño del grupo de protección contra escritura - {0}
-
+
Corriente escribiendo al Vdd máximo - {0}
-
+
Corriente escribiendo al Vdd mínimo - {0}
-
+
Información incorrecta para "{0}" en {1}
-
+
{0} no encontrado
-
+
{0} sectores para convertir
\ No newline at end of file
diff --git a/Aaru.Tests/Localization/Localization.resx b/Aaru.Tests/Localization/Localization.resx
index 3163ff31d..0aa9e6aaa 100644
--- a/Aaru.Tests/Localization/Localization.resx
+++ b/Aaru.Tests/Localization/Localization.resx
@@ -1,549 +1,551 @@
-
-
-
-
- text/microsoft-resx
-
-
- 1.3
-
-
- System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
- PublicKeyToken=b77a5c561934e089
-
-
-
- System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
- PublicKeyToken=b77a5c561934e089
-
-
-
+
+
+
+
+ text/microsoft-resx
+
+
+ 1.3
+
+
+ System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
+ PublicKeyToken=b77a5c561934e089
+
+
+
+ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.0.0, Culture=neutral,
+ PublicKeyToken=b77a5c561934e089
+
+
+
Size - {0}
-
+
Decoded - {0}
-
+
Manufacturer - {0}
-
+
Product name - {0}
-
+
Product revision - {0}
-
+
Serial number - {0}
-
+
Manufacturing date - {0}
-
+
CRC - {0}
-
+
Structure version - {0}
-
+
Specification version - {0}
-
+
TAAC - {0}
-
+
NSAC - {0}
-
+
Transfer speed - {0}
-
+
Classes - {0}
-
+
Read block length - {0}
-
+
Reads partial blocks - {0}
-
+
Writes misaligned blocks - {0}
-
+
Reads misaligned blocks - {0}
-
+
DSR implemented - {0}
-
+
Card size - {0}
-
+
Reading current at minimum Vdd - {0}
-
+
Reading current at maximum Vdd - {0}
-
+
Writing current at minimum Vdd - {0}
-
+
Writing current at maximum Vdd - {0}
-
+
Card size multiplier - {0}
-
+
Erase sector size - {0}
-
+
Erase group size - {0}
-
+
Write protect group size - {0}
-
+
Write protect group enable - {0}
-
+
Default ECC - {0}
-
+
Read to write factor - {0}
-
+
write block length - {0}
-
+
Writes partial blocks - {0}
-
+
File format group - {0}
-
+
Copy - {0}
-
+
Permanent write protect - {0}
-
+
Temporary write protect - {0}
-
+
File format - {0}
-
+
ECC - {0}
-
+
Not decoded - {0}
-
+
Version - {0}
-
+
Erase block enable - {0}
-
+
Data stat after erase - {0}
-
+
Security - {0}
-
+
Bus widths - {0}
-
+
Spec 3 - {0}
-
+
Extended security - {0}
-
+
Spec 4 - {0}
-
+
Spec X - {0}
-
+
Command support - {0}
-
+
Manufacturer reserved - {0}
-
+
Open: {0}
-
+
Sectors: {0}
-
+
Sector size: {0}
-
+
Media type: {0}
-
+
{0} not found
-
+
Filter: {0}
-
+
Image format: {0}
-
+
Cannot open image for {0}
-
+
No partitions found for {0}
-
+
Filesystem not identified for {0}
-
+
No filesystems found for {0}
-
+
Not identified for {0}
-
+
Could not instantiate filesystem for {0}
-
+
Application ID: {0}
-
+
Bootable: {0}
-
+
Clusters: {0}
-
+
Cluster size: {0}
-
+
System ID: {0}
-
+
Filesystem type: {0}
-
+
Volume name: {0}
-
+
Volume serial: {0}
-
+
Unmountable: {0}
-
+
Unexpected error {0} when reading directory "{1}" of {2}.
-
+
Unexpected error {0} retrieving stats for "{1}" in {2}
-
+
Wrong info for "{0}" in {1}
-
+
Got wrong data for directory "{0}" in {1}
-
+
Contents for "{0}" in {1} must be defined in unit test declaration!
-
+
Got wrong data for symbolic link "{0}" in {1}
-
+
Invalid target for symbolic link "{0}" in {1}
-
+
Defined extended attributes for "{0}" in {1} are not supported by filesystem.
-
+
Unexpected error {0} when listing extended attributes for "{1}" in {2}
-
+
Extended attributes for "{0}" in {1} must be defined in unit test declaration!
-
+
Could not find the children of "{0}" in {1}: {2}
-
+
Found the following unexpected children of "{0}" in {1}: {2}
-
+
Unexpected error {0} when reading "{1}" in {2}
-
+
Unexpected error {0} retrieving extended attributes for "{1}" in {2}
-
+
Got MD5 {0} for {1} of "{2}" in {3} but expected {4}
-
+
Could not find the following extended attributes of "{0}" in {1}: {2}
-
+
Found the following unexpected extended attributes of "{0}" in {1}: {2}
-
+
Hash: {0}
-
+
Expected {0} partitions in {1} but found {2}
-
+
Expected partition {0} to start at sector {1} but found it starts at {2} in {3}
-
+
Expected partition {0} to have {1} sectors but found it has {2} sectors in {3}
-
+
Could not instantiate filesystem plugin
-
+
Could not instantiate filesystem {0}
-
+
Could not mount {0} in partition {1}.
-
+
Tracks: {0}
-
+
Track session: {0}
-
+
Track start: {0}
-
+
Track end: {0}
-
+
Track pregap: {0}
-
+
Track flags: {0}
-
+
Last sector for tracks is {0}, but it is {1} for image
-
+
Expected {0} filesystems in {1} but found {2}
-
+
Could not instantiate filesystem for {0}, track {1}, filesystem {2}
-
+
Subchannel hash: {0}
-
+
Is tape?: {0}
-
+
Tape files: {0}
-
+
Tape partitions: {0}
-
+
Cannot open specified file.
-
+
Image format not identified, not proceeding with analysis.
-
+
Unable to open image format
-
+
No partitions found
-
+
Excepted {0} partitions but found {1}
-
+
Expected no filesystems identified in partition {0} but found {1}
-
+
Expected {0} filesystems identified in partition {1} but found {2}
-
+
Excepted volume name "{0}" for filesystem {1} in partition {2} but found "{3}"
-
+
Expected directories not found:
-
+
Expected files not found:
-
+
Error {0} reading root directory
-
+
Error getting stat for entry {0}
-
+
Found unexpected directory {0}
-
+
Found unexpected file {0}
-
+
Error {0} getting extended attributes for entry {1}
-
+
Found unexpected extended attribute {0} in file {1}
-
+
Error {0} reading extended attributes for entry {1}
-
+
Invalid checksum for xattr {0} for file {1}
-
+
Expected extended attributes not found for file {0}:
-
+
Error {0} reading file {1}
-
+
Invalid checksum for file {0}
-
+
No filesystems found.
-
+
Test file not found
-
+
Filter for test file is not detected
-
+
Image format for test file is not detected
-
+
Cannot open image for test file
-
+
Output file already exists, not continuing.
-
+
Input image format not identified, not proceeding with conversion.
-
+
Output format does not support media type, cannot continue...
-
+
Input image does not support long sectors.
-
+
Could not treat existing image as optical disc.
-
+
Could not treat new image as optical disc.
-
+
Existing image contains no tracks.
-
+
Error {0} creating output image.
-
+
Error {0} setting metadata.
-
+
Converting media tag {0}
-
+
{0} sectors to convert
-
+
Error {0} sending tracks list to output image.
-
+
Error {0} writing sector {1}, not continuing...
-
+
Error {0} reading tag, not continuing...
-
+
Error {0} writing tag, not continuing...
-
+
Error {0} writing tag for sector {1}, not continuing...
-
+
Error {0} closing output image... Contents are not correct.
-
+
Hashes are different
-
+
Image format for test file is not for an optical disc
-
+
Partitions: {0}
-
+
Could not instantiate input plugin for {0}
-
+
Could not instantiate output plugin for {0}
-
+
Trying to convert unsupported media type {0} for {1}
-
+
Error {0} writing sector {1}...
-
+
Open created: {0}
-
+
Sectors (output): {0}
-
+
Sector size (output): {0}
-
+
Tracks (output): {0}
-
+
Track session (output): {0}
-
+
Track start (output): {0}
-
+
Track end (output): {0}
-
+
Track pregap (output): {0}
-
+
Track flags (output): {0}
-
+
Last sector for tracks is {0}, but it is {1} for image (output)
-
+
Long hash (output)
-
+
Hash (output)
-
+
Subchannel hash (output): {0}
-
+
Got less bytes ({0}) than expected ({1}) when reading {2} in {3}
-
+
Got MD5 {0} for "{1}" in {2} but expected {3}
\ No newline at end of file
diff --git a/Aaru.Tests/Partitions/AppleMap.cs b/Aaru.Tests/Partitions/AppleMap.cs
index 6ccb18154..9cd09901f 100644
--- a/Aaru.Tests/Partitions/AppleMap.cs
+++ b/Aaru.Tests/Partitions/AppleMap.cs
@@ -37,6 +37,7 @@ public class AppleMap : PartitionSchemeTest
{
public override string DataFolder =>
Path.Combine(Consts.TestFilesRoot, "Partitioning schemes", "Apple Partition Map");
+
public override PartitionTest[] Tests => new[]
{
new PartitionTest
diff --git a/Aaru.Tests/Partitions/Atari.cs b/Aaru.Tests/Partitions/Atari.cs
index 3e6939d4e..cb66cc000 100644
--- a/Aaru.Tests/Partitions/Atari.cs
+++ b/Aaru.Tests/Partitions/Atari.cs
@@ -36,6 +36,7 @@ namespace Aaru.Tests.Partitions;
public class Atari : PartitionSchemeTest
{
public override string DataFolder => Path.Combine(Consts.TestFilesRoot, "Partitioning schemes", "Atari ST");
+
public override PartitionTest[] Tests => new[]
{
new PartitionTest
diff --git a/Aaru.Tests/Partitions/PartitionSchemeTest.cs b/Aaru.Tests/Partitions/PartitionSchemeTest.cs
index b77ac9d44..bfccc8f2e 100644
--- a/Aaru.Tests/Partitions/PartitionSchemeTest.cs
+++ b/Aaru.Tests/Partitions/PartitionSchemeTest.cs
@@ -42,7 +42,8 @@ public abstract class PartitionSchemeTest
Assert.IsNotNull(image, string.Format(Localization.Image_format_0, testFile));
- Assert.AreEqual(ErrorNumber.NoError, image.Open(inputFilter), string.Format(Localization.Cannot_open_image_for_0, testFile));
+ Assert.AreEqual(ErrorNumber.NoError, image.Open(inputFilter),
+ string.Format(Localization.Cannot_open_image_for_0, testFile));
List partitions = Core.Partitions.GetAll(image);
diff --git a/Aaru.Tests/WritableImages/AaruFormat/V1/FromAaru.cs b/Aaru.Tests/WritableImages/AaruFormat/V1/FromAaru.cs
index b16dbf47d..a39f173c6 100644
--- a/Aaru.Tests/WritableImages/AaruFormat/V1/FromAaru.cs
+++ b/Aaru.Tests/WritableImages/AaruFormat/V1/FromAaru.cs
@@ -10,6 +10,7 @@ public class FromAaru : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new DiscImages.AaruFormat();
public override IWritableImage OutputPlugin => new DiscImages.AaruFormat();
public override string OutputExtension => "aif";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/WritableImages/Alcohol/FromAaru.cs b/Aaru.Tests/WritableImages/Alcohol/FromAaru.cs
index 786c563cf..5806d64c9 100644
--- a/Aaru.Tests/WritableImages/Alcohol/FromAaru.cs
+++ b/Aaru.Tests/WritableImages/Alcohol/FromAaru.cs
@@ -11,6 +11,7 @@ public class FromAaru : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new DiscImages.AaruFormat();
public override IWritableImage OutputPlugin => new Alcohol120();
public override string OutputExtension => "mds";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/WritableImages/CDRDAO/FromAaru.cs b/Aaru.Tests/WritableImages/CDRDAO/FromAaru.cs
index 87f14421e..9089dd706 100644
--- a/Aaru.Tests/WritableImages/CDRDAO/FromAaru.cs
+++ b/Aaru.Tests/WritableImages/CDRDAO/FromAaru.cs
@@ -11,6 +11,7 @@ public class FromAaru : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new DiscImages.AaruFormat();
public override IWritableImage OutputPlugin => new Cdrdao();
public override string OutputExtension => "toc";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/WritableImages/CDRWin/FromAaru.cs b/Aaru.Tests/WritableImages/CDRWin/FromAaru.cs
index 0e46d86be..77fd7f1a9 100644
--- a/Aaru.Tests/WritableImages/CDRWin/FromAaru.cs
+++ b/Aaru.Tests/WritableImages/CDRWin/FromAaru.cs
@@ -11,6 +11,7 @@ public class FromAaru : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new DiscImages.AaruFormat();
public override IWritableImage OutputPlugin => new CdrWin();
public override string OutputExtension => "cue";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/WritableImages/CloneCD/FromAaru.cs b/Aaru.Tests/WritableImages/CloneCD/FromAaru.cs
index 16f69f5e8..cab931d35 100644
--- a/Aaru.Tests/WritableImages/CloneCD/FromAaru.cs
+++ b/Aaru.Tests/WritableImages/CloneCD/FromAaru.cs
@@ -11,6 +11,7 @@ public class FromAaru : WritableOpticalMediaImageTest
public override IMediaImage InputPlugin => new DiscImages.AaruFormat();
public override IWritableImage OutputPlugin => new CloneCd();
public override string OutputExtension => "ccd";
+
public override OpticalImageTestExpected[] Tests => new[]
{
new OpticalImageTestExpected
diff --git a/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs b/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs
index 771faa2d2..fd80e421c 100644
--- a/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs
+++ b/Aaru.Tests/WritableImages/WritableOpticalMediaImageTest.cs
@@ -55,14 +55,17 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(test.Sectors, image.Info.Sectors,
string.Format(Localization.Sectors_0, testFile));
if(test.SectorSize > 0)
+ {
Assert.AreEqual(test.SectorSize, image.Info.SectorSize,
string.Format(Localization.Sector_size_0, testFile));
+ }
Assert.AreEqual(test.MediaType, image.Info.MediaType,
string.Format(Localization.Media_type_0, testFile));
@@ -89,10 +92,10 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
BeEquivalentTo(test.Tracks.Select(s => s.Pregap),
string.Format(Localization.Track_pregap_0, testFile));
- int trackNo = 0;
+ var trackNo = 0;
- byte?[] flags = new byte?[image.Tracks.Count];
- ulong latestEndSector = 0;
+ var flags = new byte?[image.Tracks.Count];
+ ulong latestEndSector = 0;
foreach(Track currentTrack in image.Tracks)
{
@@ -118,6 +121,7 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
string.Format(Localization.Last_sector_for_tracks_is_0_but_it_is_1_for_image,
latestEndSector, image.Info.Sectors));
});
+ }
}
});
}
@@ -168,25 +172,28 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
string.Format(Localization.Trying_to_convert_unsupported_media_type_0_for_1,
inputFormat.Info.MediaType, testFile));
- bool useLong = inputFormat.Info.ReadableSectorTags.Except(new[]
- {
- SectorTagType.CdTrackFlags
- }).Any();
+ bool useLong = inputFormat.Info.ReadableSectorTags.Except(new[] { SectorTagType.CdTrackFlags }).Any();
foreach(SectorTagType sectorTag in inputFormat.Info.ReadableSectorTags.Where(sectorTag =>
!outputFormat.SupportedSectorTags.Contains(sectorTag)))
+ {
if(sectorTag != SectorTagType.CdTrackFlags &&
sectorTag != SectorTagType.CdTrackIsrc &&
sectorTag != SectorTagType.CdSectorSubchannel)
useLong = false;
+ }
- Assert.IsTrue(outputFormat.Create(outputPath, inputFormat.Info.MediaType, new Dictionary(), inputFormat.Info.Sectors, inputFormat.Info.SectorSize),
- string.Format(Localization.Error_0_creating_output_image, outputFormat.ErrorMessage));
+ Assert.IsTrue(
+ outputFormat.Create(outputPath, inputFormat.Info.MediaType, new Dictionary(),
+ inputFormat.Info.Sectors, inputFormat.Info.SectorSize),
+ string.Format(Localization.Error_0_creating_output_image, outputFormat.ErrorMessage));
foreach(MediaTagType mediaTag in inputFormat.Info.ReadableMediaTags.Where(mediaTag =>
outputFormat.SupportedMediaTags.Contains(mediaTag)))
+ {
if(inputFormat.ReadMediaTag(mediaTag, out byte[] buffer) == ErrorNumber.NoError)
outputFormat.WriteMediaTag(buffer, mediaTag);
+ }
Assert.IsTrue(outputFormat.SetTracks(inputFormat.Tracks),
string.Format(Localization.Error_0_sending_tracks_list_to_output_image,
@@ -210,8 +217,8 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
else
sectorsToDo = (uint)(trackSectors - doneSectors);
- bool useNotLong = false;
- bool result = false;
+ var useNotLong = false;
+ var result = false;
if(useLong)
{
@@ -221,10 +228,12 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
out sector);
if(errno == ErrorNumber.NoError)
+ {
result = sectorsToDo == 1
? outputFormat.WriteSectorLong(sector, doneSectors + track.StartSector)
: outputFormat.WriteSectorsLong(sector, doneSectors + track.StartSector,
sectorsToDo);
+ }
else
result = false;
@@ -261,9 +270,9 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
string mcn = null;
HashSet subchannelExtents = new();
Dictionary smallestPregapLbaPerTrack = new();
- Track[] tracks = new Track[inputFormat.Tracks.Count];
+ var tracks = new Track[inputFormat.Tracks.Count];
- for(int i = 0; i < tracks.Length; i++)
+ for(var i = 0; i < tracks.Length; i++)
{
tracks[i] = new Track
{
@@ -419,8 +428,10 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
result = true;
}
else
+ {
result = outputFormat.WriteSectorsTag(sector, doneSectors + track.StartSector,
sectorsToDo, tag);
+ }
}
Assert.IsTrue(result,
@@ -433,32 +444,46 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
}
if(isrcs.Count > 0)
+ {
foreach(KeyValuePair isrc in isrcs)
+ {
outputFormat.WriteSectorTag(Encoding.UTF8.GetBytes(isrc.Value), isrc.Key,
SectorTagType.CdTrackIsrc);
+ }
+ }
if(trackFlags.Count > 0)
+ {
foreach((byte track, byte flags) in trackFlags)
- outputFormat.WriteSectorTag(new[]
- {
- flags
- }, track, SectorTagType.CdTrackFlags);
+ {
+ outputFormat.WriteSectorTag(new[] { flags }, track, SectorTagType.CdTrackFlags);
+ }
+ }
if(mcn != null)
outputFormat.WriteMediaTag(Encoding.UTF8.GetBytes(mcn), MediaTagType.CD_MCN);
// TODO: Progress
if(inputFormat.Info.MediaType is MediaType.CD or MediaType.CDDA or MediaType.CDG or MediaType.CDEG
- or MediaType.CDI or MediaType.CDROM or MediaType.CDROMXA or MediaType.CDPLUS or MediaType.CDMO
- or MediaType.CDR or MediaType.CDRW or MediaType.CDMRW or MediaType.VCD or MediaType.SVCD
- or MediaType.PCD or MediaType.DTSCD or MediaType.CDMIDI or MediaType.CDV or MediaType.CDIREADY
- or MediaType.FMTOWNS or MediaType.PS1CD or MediaType.PS2CD or MediaType.MEGACD or MediaType.SATURNCD
- or MediaType.GDROM or MediaType.GDR or MediaType.MilCD or MediaType.SuperCDROM2 or MediaType.JaguarCD
- or MediaType.ThreeDO or MediaType.PCFX or MediaType.NeoGeoCD or MediaType.CDTV or MediaType.CD32
- or MediaType.Playdia or MediaType.Pippin or MediaType.VideoNow or MediaType.VideoNowColor
- or MediaType.VideoNowXp or MediaType.CVD)
+ or MediaType.CDI or MediaType.CDROM or MediaType.CDROMXA
+ or MediaType.CDPLUS or MediaType.CDMO
+ or MediaType.CDR or MediaType.CDRW or MediaType.CDMRW or MediaType.VCD
+ or MediaType.SVCD
+ or MediaType.PCD or MediaType.DTSCD or MediaType.CDMIDI or MediaType.CDV
+ or MediaType.CDIREADY
+ or MediaType.FMTOWNS or MediaType.PS1CD or MediaType.PS2CD
+ or MediaType.MEGACD or MediaType.SATURNCD
+ or MediaType.GDROM or MediaType.GDR or MediaType.MilCD
+ or MediaType.SuperCDROM2 or MediaType.JaguarCD
+ or MediaType.ThreeDO or MediaType.PCFX or MediaType.NeoGeoCD
+ or MediaType.CDTV or MediaType.CD32
+ or MediaType.Playdia or MediaType.Pippin or MediaType.VideoNow
+ or MediaType.VideoNowColor
+ or MediaType.VideoNowXp or MediaType.CVD)
+ {
CompactDisc.GenerateSubchannels(subchannelExtents, tracks, trackFlags, inputFormat.Info.Sectors,
null, null, null, null, null, outputFormat);
+ }
Assert.IsTrue(outputFormat.Close(),
string.Format(Localization.Error_0_closing_output_image_Contents_are_not_correct,
@@ -481,14 +506,17 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
continue;
using(new AssertionScope())
+ {
Assert.Multiple(() =>
{
Assert.AreEqual(test.Sectors, image.Info.Sectors,
string.Format(Localization.Sectors_output_0, testFile));
if(test.SectorSize > 0)
+ {
Assert.AreEqual(test.SectorSize, image.Info.SectorSize,
string.Format(Localization.Sector_size_output_0, testFile));
+ }
Assert.AreEqual(test.Tracks.Length, image.Tracks.Count,
string.Format(Localization.Tracks_output_0, testFile));
@@ -509,10 +537,10 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
BeEquivalentTo(test.Tracks.Select(s => s.Pregap),
string.Format(Localization.Track_pregap_output_0, testFile));
- int trackNo = 0;
+ var trackNo = 0;
- byte?[] flags = new byte?[image.Tracks.Count];
- ulong latestEndSector = 0;
+ var flags = new byte?[image.Tracks.Count];
+ ulong latestEndSector = 0;
foreach(Track currentTrack in image.Tracks)
{
@@ -536,9 +564,11 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
Assert.AreEqual(latestEndSector, image.Info.Sectors - 1,
string.
- Format(Localization.Last_sector_for_tracks_is_0_but_it_is_1_for_image_output,
- latestEndSector, image.Info.Sectors));
+ Format(
+ Localization.Last_sector_for_tracks_is_0_but_it_is_1_for_image_output,
+ latestEndSector, image.Info.Sectors));
});
+ }
Md5Context ctx;
@@ -560,8 +590,9 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
if(sectors - doneSectors >= SECTORS_TO_READ)
{
- errno = @long ? image.ReadSectorsLong(doneSectors, SECTORS_TO_READ,
- currentTrack.Sequence, out sector)
+ errno = @long
+ ? image.ReadSectorsLong(doneSectors, SECTORS_TO_READ,
+ currentTrack.Sequence, out sector)
: image.ReadSectors(doneSectors, SECTORS_TO_READ, currentTrack.Sequence,
out sector);
@@ -569,8 +600,9 @@ public abstract class WritableOpticalMediaImageTest : BaseWritableMediaImageTest
}
else
{
- errno = @long ? image.ReadSectorsLong(doneSectors, (uint)(sectors - doneSectors),
- currentTrack.Sequence, out sector)
+ errno = @long
+ ? image.ReadSectorsLong(doneSectors, (uint)(sectors - doneSectors),
+ currentTrack.Sequence, out sector)
: image.ReadSectors(doneSectors, (uint)(sectors - doneSectors),
currentTrack.Sequence, out sector);