More code cleanup after decoding optimization

This commit is contained in:
Grigory Chudov
2013-03-19 22:31:43 -04:00
parent 264d9b7637
commit ecbb572b29
10 changed files with 310 additions and 107 deletions

View File

@@ -80,6 +80,23 @@ namespace CUETools.TestCodecs
Assert.AreEqual<uint>(crcA, Crc32.Substract(crcAB, crcB, lenB), "CRC32 was not substracted correctly.");
}
/// <summary>
///A test for Combine
///</summary>
[TestMethod()]
public void CombineTest16()
{
int lenAB = testBytes.Length;
int lenA = 7;
int lenB = lenAB - lenA;
ushort crcAB = Crc16.ComputeChecksum(0, testBytes, 0, lenAB);
ushort crcA = Crc16.ComputeChecksum(0, testBytes, 0, lenA);
ushort crcB = Crc16.ComputeChecksum(0, testBytes, lenA, lenB);
Assert.AreEqual<uint>(crcAB, Crc16.Combine(crcA, crcB, lenB), "CRC16 was not combined correctly.");
Assert.AreEqual<uint>(crcB, Crc16.Combine(crcA, crcAB, lenB), "CRC16 was not substracted correctly.");
Assert.AreEqual<uint>(crcA, Crc16.Substract(crcAB, crcB, lenB), "CRC16 was not substracted correctly.");
}
/// <summary>
///A test for ComputeChecksum
///</summary>