Exemple #1
0
        public void HighEntropyData(string options, int chunkSize)
        {
            var filename = Path.GetTempFileName();

            try
            {
                Tools.WriteRandom(filename, 10 * Mem.M1 + 1337);
                TestEncoder(filename, chunkSize, Tools.ParseSettings(options));
            }
            finally
            {
                File.Delete(filename);
            }
        }
Exemple #2
0
        public void WholeCorpus(string options, int chunkSize)
        {
            var settings = Tools.ParseSettings(options);

            foreach (var filename in Tools.CorpusNames)
            {
                try
                {
                    TestEncoder($".corpus/{filename}", chunkSize, settings);
                }
                catch (Exception e)
                {
                    throw new Exception(
                              $"Failed to process: {filename} @ {options}/{chunkSize}", e);
                }
            }
        }
Exemple #3
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);
            }
        }
Exemple #4
0
 public void LargeChunkSize(string filename, string options, int chunkSize)
 {
     TestEncoder($".corpus/{filename}", chunkSize, Tools.ParseSettings(options));
 }