Improved Unit Test for BitWriter

This commit is contained in:
Grigory Chudov
2013-05-09 19:26:42 -04:00
parent 9e44eca610
commit 5d8f8a775b

View File

@@ -85,6 +85,7 @@ namespace CUETools.TestCodecs
} }
while (target.Length < buf.Length - 32); while (target.Length < buf.Length - 32);
target.flush(); target.flush();
ushort c1 = target.get_crc16(), c2;
rnd = new Random(seed); rnd = new Random(seed);
unsafe unsafe
{ {
@@ -98,8 +99,11 @@ namespace CUETools.TestCodecs
ulong val1 = reader.readbits64(bits); ulong val1 = reader.readbits64(bits);
Assert.AreEqual(val, val1, string.Format("i = {0}, bits = {1}, seed = {2}, pos = {3}", i, bits, seed, reader.Position)); Assert.AreEqual(val, val1, string.Format("i = {0}, bits = {1}, seed = {2}, pos = {3}", i, bits, seed, reader.Position));
} }
reader.flush();
c2 = reader.get_crc16();
} }
} }
Assert.AreEqual(c1, c2, string.Format("seed = {0}", seed));
} }
} }
} }