Пример #1
0
        private static void TestEncoder(string original, int chunkSize, LZ4Settings settings)
        {
            original = Tools.FindFile(original);
            var encoded = Path.GetTempFileName();
            var decoded = Path.GetTempFileName();

            try
            {
                TestedLZ4.Encode(original, encoded, chunkSize, settings);
                ReferenceLZ4.Decode(encoded, decoded);
                Tools.SameFiles(original, decoded);
            }
            finally
            {
                File.Delete(encoded);
                File.Delete(decoded);
            }
        }
        private static void TestRoundtrip(string fileName, int chunkSize, LZ4Settings settings)
        {
            var original = Tools.FindFile(fileName);
            var encoded  = Path.GetTempFileName();
            var decoded  = Path.GetTempFileName();

            try
            {
                TestedLZ4.Encode(original, encoded, chunkSize, settings);
                TestedLZ4.Decode(encoded, decoded, chunkSize);
                Tools.SameFiles(original, decoded);
            }
            finally
            {
                File.Delete(encoded);
                File.Delete(decoded);
            }
        }