REFACTOR: Reformat code.

This commit is contained in:
2017-12-19 20:33:03 +00:00
parent 77edc7c91c
commit e6f6ace80b
704 changed files with 82627 additions and 83641 deletions

View File

@@ -35,8 +35,8 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class Adler32
{
static readonly byte[] ExpectedEmpty = { 0x00, 0xf0, 0x00, 0x01 };
static readonly byte[] ExpectedRandom = { 0x37, 0x28, 0xd1, 0x86 };
static readonly byte[] ExpectedEmpty = {0x00, 0xf0, 0x00, 0x01};
static readonly byte[] ExpectedRandom = {0x37, 0x28, 0xd1, 0x86};
[Test]
public void Adler32EmptyFile()
@@ -49,7 +49,8 @@ namespace DiscImageChef.Tests.Checksums
public void Adler32EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -61,7 +62,8 @@ namespace DiscImageChef.Tests.Checksums
public void Adler32EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -83,7 +85,8 @@ namespace DiscImageChef.Tests.Checksums
public void Adler32RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -95,7 +98,8 @@ namespace DiscImageChef.Tests.Checksums
public void Adler32RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -106,4 +110,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,8 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class CRC16
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
static readonly byte[] ExpectedEmpty = {0x00, 0x00};
static readonly byte[] ExpectedRandom = {0x2d, 0x6d};
[Test]
public void CRC16EmptyFile()
@@ -49,7 +49,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC16EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -61,7 +62,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC16EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -83,7 +85,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC16RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -95,7 +98,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC16RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -106,4 +110,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,8 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class CRC32
{
static readonly byte[] ExpectedEmpty = { 0xa7, 0x38, 0xea, 0x1c };
static readonly byte[] ExpectedRandom = { 0x2b, 0x6e, 0x68, 0x54 };
static readonly byte[] ExpectedEmpty = {0xa7, 0x38, 0xea, 0x1c};
static readonly byte[] ExpectedRandom = {0x2b, 0x6e, 0x68, 0x54};
[Test]
public void CRC32EmptyFile()
@@ -49,7 +49,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC32EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -61,7 +62,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC32EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -83,7 +85,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC32RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -95,7 +98,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC32RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -106,4 +110,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,8 @@ namespace DiscImageChef.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[] ExpectedEmpty = {0x60, 0x6b, 0x70, 0xa2, 0x3e, 0xba, 0xf6, 0xc2};
static readonly byte[] ExpectedRandom = {0xbf, 0x09, 0x99, 0x2c, 0xc5, 0xed, 0xe3, 0x8e};
[Test]
public void CRC64EmptyFile()
@@ -49,7 +49,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC64EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -61,7 +62,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC64EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -83,7 +85,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC64RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -95,7 +98,8 @@ namespace DiscImageChef.Tests.Checksums
public void CRC64RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -106,4 +110,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,10 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class MD5
{
static readonly byte[] ExpectedEmpty = { 0xb6, 0xd8, 0x1b, 0x36, 0x0a, 0x56, 0x72, 0xd8, 0x0c, 0x27, 0x43, 0x0f, 0x39, 0x15, 0x3e, 0x2c };
static readonly byte[] ExpectedRandom = { 0xd7, 0x8f, 0x0e, 0xec, 0x41, 0x7b, 0xe3, 0x86, 0x21, 0x9b, 0x21, 0xb7, 0x00, 0x04, 0x4b, 0x95 };
static readonly byte[] ExpectedEmpty =
{0xb6, 0xd8, 0x1b, 0x36, 0x0a, 0x56, 0x72, 0xd8, 0x0c, 0x27, 0x43, 0x0f, 0x39, 0x15, 0x3e, 0x2c};
static readonly byte[] ExpectedRandom =
{0xd7, 0x8f, 0x0e, 0xec, 0x41, 0x7b, 0xe3, 0x86, 0x21, 0x9b, 0x21, 0xb7, 0x00, 0x04, 0x4b, 0x95};
[Test]
public void MD5EmptyFile()
@@ -51,7 +53,8 @@ namespace DiscImageChef.Tests.Checksums
public void MD5EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -65,7 +68,8 @@ namespace DiscImageChef.Tests.Checksums
public void MD5EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -89,7 +93,8 @@ namespace DiscImageChef.Tests.Checksums
public void MD5RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -103,7 +108,8 @@ namespace DiscImageChef.Tests.Checksums
public void MD5RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -114,4 +120,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,16 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class RIPEMD160
{
static readonly byte[] ExpectedEmpty = { 0x59, 0xf4, 0x4e, 0x7d, 0xaf, 0xba, 0xe0, 0xfa, 0x30, 0x15, 0xc1, 0x96, 0x41, 0xc5, 0xa5, 0xaf, 0x2d, 0x93, 0x99, 0x8d };
static readonly byte[] ExpectedRandom = { 0x2a, 0x7b, 0x6c, 0x0e, 0xc1, 0x80, 0xce, 0x6a, 0xe2, 0xfd, 0x77, 0xb4, 0xe0, 0xb6, 0x80, 0xc5, 0xd9, 0x9f, 0xf6, 0x7b };
static readonly byte[] ExpectedEmpty =
{
0x59, 0xf4, 0x4e, 0x7d, 0xaf, 0xba, 0xe0, 0xfa, 0x30, 0x15, 0xc1, 0x96, 0x41, 0xc5, 0xa5, 0xaf, 0x2d, 0x93,
0x99, 0x8d
};
static readonly byte[] ExpectedRandom =
{
0x2a, 0x7b, 0x6c, 0x0e, 0xc1, 0x80, 0xce, 0x6a, 0xe2, 0xfd, 0x77, 0xb4, 0xe0, 0xb6, 0x80, 0xc5, 0xd9, 0x9f,
0xf6, 0x7b
};
[Test]
public void RIPEMD160EmptyFile()
@@ -51,7 +59,8 @@ namespace DiscImageChef.Tests.Checksums
public void RIPEMD160EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -65,7 +74,8 @@ namespace DiscImageChef.Tests.Checksums
public void RIPEMD160EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -89,7 +99,8 @@ namespace DiscImageChef.Tests.Checksums
public void RIPEMD160RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -103,7 +114,8 @@ namespace DiscImageChef.Tests.Checksums
public void RIPEMD160RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -114,4 +126,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,16 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class SHA1
{
static readonly byte[] ExpectedEmpty = { 0x3b, 0x71, 0xf4, 0x3f, 0xf3, 0x0f, 0x4b, 0x15, 0xb5, 0xcd, 0x85, 0xdd, 0x9e, 0x95, 0xeb, 0xc7, 0xe8, 0x4e, 0xb5, 0xa3 };
static readonly byte[] ExpectedRandom = { 0x72, 0x0d, 0x3b, 0x71, 0x7d, 0xe0, 0xc7, 0x4c, 0x77, 0xdd, 0x9c, 0xaa, 0x9e, 0xba, 0x50, 0x60, 0xdc, 0xbd, 0x28, 0x8d };
static readonly byte[] ExpectedEmpty =
{
0x3b, 0x71, 0xf4, 0x3f, 0xf3, 0x0f, 0x4b, 0x15, 0xb5, 0xcd, 0x85, 0xdd, 0x9e, 0x95, 0xeb, 0xc7, 0xe8, 0x4e,
0xb5, 0xa3
};
static readonly byte[] ExpectedRandom =
{
0x72, 0x0d, 0x3b, 0x71, 0x7d, 0xe0, 0xc7, 0x4c, 0x77, 0xdd, 0x9c, 0xaa, 0x9e, 0xba, 0x50, 0x60, 0xdc, 0xbd,
0x28, 0x8d
};
[Test]
public void SHA1EmptyFile()
@@ -51,7 +59,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA1EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -65,7 +74,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA1EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -89,7 +99,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA1RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -103,7 +114,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA1RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -114,4 +126,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,16 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class SHA256
{
static readonly byte[] ExpectedEmpty = { 0x30, 0xe1, 0x49, 0x55, 0xeb, 0xf1, 0x35, 0x22, 0x66, 0xdc, 0x2f, 0xf8, 0x06, 0x7e, 0x68, 0x10, 0x46, 0x07, 0xe7, 0x50, 0xab, 0xb9, 0xd3, 0xb3, 0x65, 0x82, 0xb8, 0xaf, 0x90, 0x9f, 0xcb, 0x58 };
static readonly byte[] ExpectedRandom = { 0x4d, 0x1a, 0x6b, 0x8a, 0x54, 0x67, 0x00, 0xc4, 0x8e, 0xda, 0x70, 0xd3, 0x39, 0x1c, 0x8f, 0x15, 0x8a, 0x8d, 0x12, 0xb2, 0x38, 0x92, 0x89, 0x29, 0x50, 0x47, 0x8c, 0x41, 0x8e, 0x25, 0xcc, 0x39 };
static readonly byte[] ExpectedEmpty =
{
0x30, 0xe1, 0x49, 0x55, 0xeb, 0xf1, 0x35, 0x22, 0x66, 0xdc, 0x2f, 0xf8, 0x06, 0x7e, 0x68, 0x10, 0x46, 0x07,
0xe7, 0x50, 0xab, 0xb9, 0xd3, 0xb3, 0x65, 0x82, 0xb8, 0xaf, 0x90, 0x9f, 0xcb, 0x58
};
static readonly byte[] ExpectedRandom =
{
0x4d, 0x1a, 0x6b, 0x8a, 0x54, 0x67, 0x00, 0xc4, 0x8e, 0xda, 0x70, 0xd3, 0x39, 0x1c, 0x8f, 0x15, 0x8a, 0x8d,
0x12, 0xb2, 0x38, 0x92, 0x89, 0x29, 0x50, 0x47, 0x8c, 0x41, 0x8e, 0x25, 0xcc, 0x39
};
[Test]
public void SHA256EmptyFile()
@@ -51,7 +59,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA256EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -65,7 +74,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA256EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -89,7 +99,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA256RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -103,7 +114,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA256RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -114,4 +126,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,18 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class SHA384
{
static readonly byte[] ExpectedEmpty = { 0x31, 0x64, 0x67, 0x3a, 0x8a, 0xc2, 0x75, 0x76, 0xab, 0x5f, 0xc0, 0x6b, 0x9a, 0xdc, 0x4c, 0xe0, 0xac, 0xa5, 0xbd, 0x30, 0x25, 0x38, 0x4b, 0x1c, 0xf2, 0x12, 0x8a, 0x87, 0x95, 0xe7, 0x47, 0xc4, 0x31, 0xe8, 0x82, 0x78, 0x5a, 0x0b, 0xf8, 0xdc, 0x70, 0xb4, 0x29, 0x95, 0xdb, 0x38, 0x85, 0x75 };
static readonly byte[] ExpectedRandom = { 0xdb, 0x53, 0x0e, 0x17, 0x9b, 0x81, 0xfe, 0x5f, 0x6d, 0x20, 0x41, 0x04, 0x6e, 0x77, 0xd9, 0x85, 0xf2, 0x85, 0x8a, 0x66, 0xca, 0xd3, 0x8d, 0x1a, 0xd5, 0xac, 0x67, 0xa9, 0x74, 0xe1, 0xef, 0x3f, 0x4d, 0xdf, 0x94, 0x15, 0x2e, 0xac, 0x2e, 0xfe, 0x16, 0x95, 0x81, 0x54, 0xdc, 0x59, 0xd4, 0xc3 };
static readonly byte[] ExpectedEmpty =
{
0x31, 0x64, 0x67, 0x3a, 0x8a, 0xc2, 0x75, 0x76, 0xab, 0x5f, 0xc0, 0x6b, 0x9a, 0xdc, 0x4c, 0xe0, 0xac, 0xa5,
0xbd, 0x30, 0x25, 0x38, 0x4b, 0x1c, 0xf2, 0x12, 0x8a, 0x87, 0x95, 0xe7, 0x47, 0xc4, 0x31, 0xe8, 0x82, 0x78,
0x5a, 0x0b, 0xf8, 0xdc, 0x70, 0xb4, 0x29, 0x95, 0xdb, 0x38, 0x85, 0x75
};
static readonly byte[] ExpectedRandom =
{
0xdb, 0x53, 0x0e, 0x17, 0x9b, 0x81, 0xfe, 0x5f, 0x6d, 0x20, 0x41, 0x04, 0x6e, 0x77, 0xd9, 0x85, 0xf2, 0x85,
0x8a, 0x66, 0xca, 0xd3, 0x8d, 0x1a, 0xd5, 0xac, 0x67, 0xa9, 0x74, 0xe1, 0xef, 0x3f, 0x4d, 0xdf, 0x94, 0x15,
0x2e, 0xac, 0x2e, 0xfe, 0x16, 0x95, 0x81, 0x54, 0xdc, 0x59, 0xd4, 0xc3
};
[Test]
public void SHA384EmptyFile()
@@ -51,7 +61,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA384EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -65,7 +76,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA384EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -89,7 +101,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA384RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -103,7 +116,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA384RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -114,4 +128,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -35,8 +35,20 @@ namespace DiscImageChef.Tests.Checksums
[TestFixture]
public class SHA512
{
static readonly byte[] ExpectedEmpty = { 0xd6, 0x29, 0x26, 0x85, 0xb3, 0x80, 0xe3, 0x38, 0xe0, 0x25, 0xb3, 0x41, 0x5a, 0x90, 0xfe, 0x8f, 0x9d, 0x39, 0xa4, 0x6e, 0x7b, 0xdb, 0xa8, 0xcb, 0x78, 0xc5, 0x0a, 0x33, 0x8c, 0xef, 0xca, 0x74, 0x1f, 0x69, 0xe4, 0xe4, 0x64, 0x11, 0xc3, 0x2d, 0xe1, 0xaf, 0xde, 0xdf, 0xb2, 0x68, 0xe5, 0x79, 0xa5, 0x1f, 0x81, 0xff, 0x85, 0xe5, 0x6f, 0x55, 0xb0, 0xee, 0x7c, 0x33, 0xfe, 0x8c, 0x25, 0xc9 };
static readonly byte[] ExpectedRandom = { 0x6a, 0x0a, 0x18, 0xc2, 0xad, 0xf8, 0x83, 0xac, 0x58, 0xe6, 0x21, 0x96, 0xdb, 0x8d, 0x3d, 0x0e, 0xb9, 0x87, 0xd1, 0x49, 0x24, 0x97, 0xdb, 0x15, 0xb9, 0xfc, 0xcc, 0xb0, 0x36, 0xdf, 0x64, 0xae, 0xdb, 0x3e, 0x82, 0xa0, 0x4d, 0xdc, 0xd1, 0x37, 0x48, 0x92, 0x95, 0x51, 0xf9, 0xdd, 0xab, 0x82, 0xf4, 0x8a, 0x85, 0x3f, 0x9a, 0x01, 0xb5, 0xf2, 0x8c, 0xbb, 0x4a, 0xa5, 0x1b, 0x40, 0x7c, 0xb6 };
static readonly byte[] ExpectedEmpty =
{
0xd6, 0x29, 0x26, 0x85, 0xb3, 0x80, 0xe3, 0x38, 0xe0, 0x25, 0xb3, 0x41, 0x5a, 0x90, 0xfe, 0x8f, 0x9d, 0x39,
0xa4, 0x6e, 0x7b, 0xdb, 0xa8, 0xcb, 0x78, 0xc5, 0x0a, 0x33, 0x8c, 0xef, 0xca, 0x74, 0x1f, 0x69, 0xe4, 0xe4,
0x64, 0x11, 0xc3, 0x2d, 0xe1, 0xaf, 0xde, 0xdf, 0xb2, 0x68, 0xe5, 0x79, 0xa5, 0x1f, 0x81, 0xff, 0x85, 0xe5,
0x6f, 0x55, 0xb0, 0xee, 0x7c, 0x33, 0xfe, 0x8c, 0x25, 0xc9
};
static readonly byte[] ExpectedRandom =
{
0x6a, 0x0a, 0x18, 0xc2, 0xad, 0xf8, 0x83, 0xac, 0x58, 0xe6, 0x21, 0x96, 0xdb, 0x8d, 0x3d, 0x0e, 0xb9, 0x87,
0xd1, 0x49, 0x24, 0x97, 0xdb, 0x15, 0xb9, 0xfc, 0xcc, 0xb0, 0x36, 0xdf, 0x64, 0xae, 0xdb, 0x3e, 0x82, 0xa0,
0x4d, 0xdc, 0xd1, 0x37, 0x48, 0x92, 0x95, 0x51, 0xf9, 0xdd, 0xab, 0x82, 0xf4, 0x8a, 0x85, 0x3f, 0x9a, 0x01,
0xb5, 0xf2, 0x8c, 0xbb, 0x4a, 0xa5, 0x1b, 0x40, 0x7c, 0xb6
};
[Test]
public void SHA512EmptyFile()
@@ -51,7 +63,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA512EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -65,7 +78,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA512EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -89,7 +103,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA512RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -103,7 +118,8 @@ namespace DiscImageChef.Tests.Checksums
public void SHA512RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -114,4 +130,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}

View File

@@ -42,7 +42,8 @@ namespace DiscImageChef.Tests.Checksums
public void SpamSumEmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -55,7 +56,8 @@ namespace DiscImageChef.Tests.Checksums
public void SpamSumEmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -70,7 +72,8 @@ namespace DiscImageChef.Tests.Checksums
public void SpamSumRandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -83,7 +86,8 @@ namespace DiscImageChef.Tests.Checksums
public void SpamSumRandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open,
FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
@@ -94,4 +98,4 @@ namespace DiscImageChef.Tests.Checksums
Assert.AreEqual(ExpectedRandom, result);
}
}
}
}