Added tests for checksums.

This commit is contained in:
2017-06-29 22:09:41 +01:00
parent 334cc66a53
commit 29738d6dec
18 changed files with 449 additions and 218 deletions

View File

@@ -0,0 +1,119 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Adler32.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
using NUnit.Framework;
using DiscImageChef.Checksums;
using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class Adler32
{
static readonly byte[] ExpectedEmpty = { 0x00, 0xf0, 0x00, 0x01 };
static readonly byte[] ExpectedRandom = { 0x37, 0x28, 0xd1, 0x86 };
[Test]
public void Adler32EmptyFile()
{
byte[] result = Adler32Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void Adler32EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
Adler32Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void Adler32EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
Adler32Context ctx = new Adler32Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void Adler32RandomFile()
{
byte[] result = Adler32Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void Adler32RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
Adler32Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void Adler32RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
Adler32Context ctx = new Adler32Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
Assert.AreEqual(ExpectedRandom, result);
}
}
}

View File

@@ -36,12 +36,84 @@
// ****************************************************************************/
// //$Id$
using System;
namespace Checksums
using NUnit.Framework;
using DiscImageChef.Checksums;
using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
{
public CRC16()
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
[Test]
public void CRC16EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
Assert.AreEqual(ExpectedRandom, result);
}
}
}

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : CRC32.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,39 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class CRC32
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
static readonly byte[] ExpectedEmpty = { 0xa7, 0x38, 0xea, 0x1c };
static readonly byte[] ExpectedRandom = { 0x2b, 0x6e, 0x68, 0x54 };
[Test]
public void CRC16EmptyFile()
public void CRC32EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
byte[] result = CRC32Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void CRC32EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
CRC32Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void CRC32EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
CRC32Context ctx = new CRC32Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +83,33 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void CRC32RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
byte[] result = CRC32Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void CRC32RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
CRC32Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void CRC32RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
CRC32Context ctx = new CRC32Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : CRC64.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,39 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class CRC64
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void CRC64EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
byte[] result = CRC64Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void CRC64EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
CRC64Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void CRC64EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
CRC64Context ctx = new CRC64Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +83,33 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void CRC64RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
byte[] result = CRC64Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void CRC64RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
CRC64Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void CRC64RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
CRC64Context ctx = new CRC64Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : MD5.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,43 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class MD5
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void MD5EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
MD5Context ctx = new MD5Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void MD5EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
MD5Context ctx = new MD5Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void MD5EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
MD5Context ctx = new MD5Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +87,37 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void MD5RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
MD5Context ctx = new MD5Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void MD5RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
MD5Context ctx = new MD5Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void MD5RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
MD5Context ctx = new MD5Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : RIPEMD160.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,43 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class RIPEMD160
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void RIPEMD160EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
RIPEMD160Context ctx = new RIPEMD160Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void RIPEMD160EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
RIPEMD160Context ctx = new RIPEMD160Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void RIPEMD160EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
RIPEMD160Context ctx = new RIPEMD160Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +87,37 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void RIPEMD160RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
RIPEMD160Context ctx = new RIPEMD160Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void RIPEMD160RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
RIPEMD160Context ctx = new RIPEMD160Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void RIPEMD160RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
RIPEMD160Context ctx = new RIPEMD160Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : SHA1.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,43 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class SHA1
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void SHA1EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
SHA1Context ctx = new SHA1Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void SHA1EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA1Context ctx = new SHA1Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void SHA1EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA1Context ctx = new SHA1Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +87,37 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void SHA1RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
SHA1Context ctx = new SHA1Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void SHA1RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA1Context ctx = new SHA1Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void SHA1RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA1Context ctx = new SHA1Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : SHA256.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,43 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class SHA256
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void SHA256EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
SHA256Context ctx = new SHA256Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void SHA256EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA256Context ctx = new SHA256Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void SHA256EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA256Context ctx = new SHA256Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +87,37 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void SHA256RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
SHA256Context ctx = new SHA256Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void SHA256RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA256Context ctx = new SHA256Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void SHA256RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA256Context ctx = new SHA256Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : SHA384.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,43 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class SHA384
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void SHA384EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
SHA384Context ctx = new SHA384Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void SHA384EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA384Context ctx = new SHA384Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void SHA384EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA384Context ctx = new SHA384Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +87,37 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void SHA384RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
SHA384Context ctx = new SHA384Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void SHA384RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA384Context ctx = new SHA384Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void SHA384RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA384Context ctx = new SHA384Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : SHA512.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,39 +43,43 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class SHA512
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
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 CRC16EmptyFile()
public void SHA512EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
SHA512Context ctx = new SHA512Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void SHA512EmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA512Context ctx = new SHA512Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void SHA512EmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA512Context ctx = new SHA512Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
@@ -83,33 +87,37 @@ namespace DiscImageChef.Tests.Checksums
}
[Test]
public void CRC16RandomFile()
public void SHA512RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
SHA512Context ctx = new SHA512Context();
ctx.Init();
byte[] result = ctx.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void SHA512RandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SHA512Context ctx = new SHA512Context();
ctx.Init();
ctx.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomInstance()
public void SHA512RandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SHA512Context ctx = new SHA512Context();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();

View File

@@ -2,7 +2,7 @@
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : CRC16.cs
// Filename : SpamSum.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
@@ -43,77 +43,65 @@ using System.IO;
namespace DiscImageChef.Tests.Checksums
{
[TestFixture]
public class CRC16
public class SpamSum
{
static readonly byte[] ExpectedEmpty = { 0x00, 0x00 };
static readonly byte[] ExpectedRandom = { 0x2d, 0x6d };
static readonly string ExpectedEmpty = "3::";
static readonly string ExpectedRandom = "24576:3dvzuAsHTQ16pc7O1Q/gS9qze+Swwn9s6IX:8/TQQpaVqze+JN6IX";
[Test]
public void CRC16EmptyFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"));
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyData()
public void SpamSumEmptyData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
SpamSumContext ctx = new SpamSumContext();
string result = ctx.Data(data, out byte[] tmp);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16EmptyInstance()
public void SpamSumEmptyInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "empty"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SpamSumContext ctx = new SpamSumContext();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
string result = ctx.End();
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16RandomFile()
{
byte[] result = CRC16Context.File(Path.Combine(Consts.TestFilesRoot, "checksums", "random"));
Assert.AreEqual(ExpectedRandom, result);
}
[Test]
public void CRC16RandomData()
public void SpamSumRandomData()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context.Data(data, out byte[] result);
Assert.AreEqual(ExpectedRandom, result);
SpamSumContext ctx = new SpamSumContext();
string result = ctx.Data(data, out byte[] tmp);
Assert.AreEqual(ExpectedEmpty, result);
}
[Test]
public void CRC16RandomInstance()
public void SpamSumRandomInstance()
{
byte[] data = new byte[1048576];
FileStream fs = new FileStream(Path.Combine(Consts.TestFilesRoot, "checksums", "random"), FileMode.Open, FileAccess.Read);
fs.Read(data, 0, 1048576);
fs.Close();
fs.Dispose();
CRC16Context ctx = new CRC16Context();
SpamSumContext ctx = new SpamSumContext();
ctx.Init();
ctx.Update(data);
byte[] result = ctx.Final();
Assert.AreEqual(ExpectedRandom, result);
string result = ctx.End();
Assert.AreEqual(ExpectedEmpty, result);
}
}
}

View File

@@ -35,13 +35,11 @@
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using System;
namespace DiscImageChef.Tests
{
public class Consts
public static class Consts
{
public Consts()
{
}
public const string TestFilesRoot = "/mnt/DiscImageChef/tests";
}
}

View File

@@ -10,6 +10,7 @@
<RootNamespace>DiscImageChef.Tests</RootNamespace>
<AssemblyName>DiscImageChef.Tests</AssemblyName>
<TargetFrameworkVersion>v4.6.1</TargetFrameworkVersion>
<ReleaseVersion>3.4.99.0</ReleaseVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
@@ -28,9 +29,55 @@
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="nunit.framework">
<HintPath>..\packages\NUnit.3.7.1\lib\net45\nunit.framework.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Test.cs" />
<Compile Include="Consts.cs" />
<Compile Include="Checksums\CRC16.cs" />
<Compile Include="Checksums\SHA384.cs" />
<Compile Include="Checksums\SHA256.cs" />
<Compile Include="Checksums\CRC32.cs" />
<Compile Include="Checksums\CRC64.cs" />
<Compile Include="Checksums\MD5.cs" />
<Compile Include="Checksums\RIPEMD160.cs" />
<Compile Include="Checksums\SHA1.cs" />
<Compile Include="Checksums\SpamSum.cs" />
<Compile Include="Checksums\SHA512.cs" />
<Compile Include="Checksums\Adler32.cs" />
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
<ItemGroup>
<Folder Include="Checksums\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\DiscImageChef.Checksums\DiscImageChef.Checksums.csproj">
<Project>{CC48B324-A532-4A45-87A6-6F91F7141E8D}</Project>
<Name>DiscImageChef.Checksums</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ProjectExtensions>
<MonoDevelop>
<Properties>
<Policies>
<TextStylePolicy FileWidth="120" TabWidth="4" IndentWidth="4" RemoveTrailingWhitespace="True" NoTabsAfterNonTabs="False" EolMarker="Native" TabsToSpaces="True" scope="text/x-csharp">
<inheritsSet />
<inheritsScope />
</TextStylePolicy>
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceAfterControlFlowStatementKeyword="True" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" scope="text/x-csharp">
<inheritsSet />
<inheritsScope />
</CSharpFormattingPolicy>
<DotNetNamingPolicy DirectoryNamespaceAssociation="PrefixedHierarchical" ResourceNamePolicy="MSBuild">
<inheritsSet />
<inheritsScope />
</DotNetNamingPolicy>
</Policies>
</Properties>
</MonoDevelop>
</ProjectExtensions>
</Project>

View File

@@ -1,50 +0,0 @@
// /***************************************************************************
// The Disc Image Chef
// ----------------------------------------------------------------------------
//
// Filename : Test.cs
// Version : 1.0
// Author(s) : Natalia Portillo
//
// Component : Component
//
// Revision : $Revision$
// Last change by : $Author$
// Date : $Date$
//
// --[ Description ] ----------------------------------------------------------
//
// Description
//
// --[ License ] --------------------------------------------------------------
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU General Public License for more details.
//
// You should have received a copy of the GNU General Public License
// along with this program. If not, see <http://www.gnu.org/licenses/>.
//
// ----------------------------------------------------------------------------
// Copyright (C) 2011-2015 Claunia.com
// ****************************************************************************/
// //$Id$
using NUnit.Framework;
using System;
namespace DiscImageChef.Tests
{
[TestFixture()]
public class Test
{
[Test()]
public void TestCase()
{
}
}
}

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="NUnit" version="2.6.4" targetFramework="net461" />
<package id="NUnit" version="3.7.1" targetFramework="net461" />
</packages>

View File

@@ -33,6 +33,8 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Core", "DiscI
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Server", "DiscImageChef.Server\DiscImageChef.Server.csproj", "{75342D7A-C5EA-4A6F-A511-850B54310E5B}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DiscImageChef.Tests", "DiscImageChef.Tests\DiscImageChef.Tests.csproj", "{B2ABC1F2-C365-4515-9F23-A5725050CC48}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|x86 = Debug|x86
@@ -103,6 +105,10 @@ Global
{75342D7A-C5EA-4A6F-A511-850B54310E5B}.Debug|x86.Build.0 = Debug|Any CPU
{75342D7A-C5EA-4A6F-A511-850B54310E5B}.Release|x86.ActiveCfg = Release|Any CPU
{75342D7A-C5EA-4A6F-A511-850B54310E5B}.Release|x86.Build.0 = Release|Any CPU
{B2ABC1F2-C365-4515-9F23-A5725050CC48}.Debug|x86.ActiveCfg = Debug|Any CPU
{B2ABC1F2-C365-4515-9F23-A5725050CC48}.Debug|x86.Build.0 = Debug|Any CPU
{B2ABC1F2-C365-4515-9F23-A5725050CC48}.Release|x86.ActiveCfg = Release|Any CPU
{B2ABC1F2-C365-4515-9F23-A5725050CC48}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(MonoDevelopProperties) = preSolution
Policies = $0

View File

@@ -1,3 +1,6 @@
* DiscImageChef.csproj:
Added tests for checksums.
* Commands/CreateSidecar.cs:
Pass filter UUID to sidecar creation, use it to detect filters and
calculate checksums of disk image and its contents correctly.

View File

@@ -156,7 +156,7 @@
<inheritsSet />
<inheritsScope />
</TextStylePolicy>
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceAfterControlFlowStatementKeyword="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" scope="text/x-csharp">
<CSharpFormattingPolicy IndentBlock="True" IndentBraces="False" IndentSwitchSection="True" IndentSwitchCaseSection="True" LabelPositioning="OneLess" NewLinesForBracesInTypes="True" NewLinesForBracesInMethods="True" NewLinesForBracesInProperties="True" NewLinesForBracesInAccessors="True" NewLinesForBracesInAnonymousMethods="True" NewLinesForBracesInControlBlocks="True" NewLinesForBracesInAnonymousTypes="True" NewLinesForBracesInObjectCollectionArrayInitializers="True" NewLinesForBracesInLambdaExpressionBody="True" NewLineForElse="True" NewLineForCatch="True" NewLineForFinally="True" NewLineForMembersInObjectInit="True" NewLineForMembersInAnonymousTypes="True" NewLineForClausesInQuery="True" SpacingAfterMethodDeclarationName="False" SpaceWithinMethodDeclarationParenthesis="False" SpaceBetweenEmptyMethodDeclarationParentheses="False" SpaceAfterMethodCallName="False" SpaceWithinMethodCallParentheses="False" SpaceBetweenEmptyMethodCallParentheses="False" SpaceWithinExpressionParentheses="False" SpaceWithinCastParentheses="False" SpaceWithinOtherParentheses="False" SpaceAfterCast="False" SpacesIgnoreAroundVariableDeclaration="False" SpaceBeforeOpenSquareBracket="False" SpaceBetweenEmptySquareBrackets="False" SpaceWithinSquareBrackets="False" SpaceAfterColonInBaseTypeDeclaration="True" SpaceAfterComma="True" SpaceAfterDot="False" SpaceAfterSemicolonsInForStatement="True" SpaceBeforeColonInBaseTypeDeclaration="True" SpaceBeforeComma="False" SpaceBeforeDot="False" SpaceBeforeSemicolonsInForStatement="False" SpacingAroundBinaryOperator="Single" WrappingPreserveSingleLine="True" WrappingKeepStatementsOnSingleLine="True" PlaceSystemDirectiveFirst="True" SpaceAfterControlFlowStatementKeyword="False" scope="text/x-csharp">
<inheritsSet />
<inheritsScope />
</CSharpFormattingPolicy>