diff --git a/Compression.BSA.Test/Program.cs b/Compression.BSA.Test/Program.cs index 72d4b882..14b0b299 100644 --- a/Compression.BSA.Test/Program.cs +++ b/Compression.BSA.Test/Program.cs @@ -10,11 +10,19 @@ namespace Compression.BSA.Test class Program { const string TestDir = "c:\\Mod Organizer 2\\mods"; + const string TempDir = "c:\\tmp\\out"; static void Main(string[] args) { - foreach (var bsa in Directory.EnumerateFiles(TestDir, "*.bsa", SearchOption.AllDirectories).Skip(2)) + foreach (var bsa in Directory.EnumerateFiles(TestDir, "*.bsa", SearchOption.AllDirectories).Skip(16)) { Console.WriteLine($"From {bsa}"); + Console.WriteLine("Cleaning Output Dir"); + if (Directory.Exists(TempDir)) + { + Directory.Delete(TempDir, true); + } + Directory.CreateDirectory(TempDir); + using (var a = new BSAReader(bsa)) { @@ -45,6 +53,7 @@ namespace Compression.BSA.Test w.Build("c:\\tmp\\built.bsa"); + // Sanity Checks Equal(a.Files.Count(), w.Files.Count()); Equal(a.Files.Select(f => f.Path).ToHashSet(), w.Files.Select(f => f.Path).ToHashSet()); diff --git a/Compression.BSA/BSAReader.cs b/Compression.BSA/BSAReader.cs index 88cbd141..765402ae 100644 --- a/Compression.BSA/BSAReader.cs +++ b/Compression.BSA/BSAReader.cs @@ -336,10 +336,6 @@ namespace Compression.BSA var original_size = rdr.ReadUInt32(); if (_bsa.HeaderType == VersionType.SSE) { - var settings = new LZ4DecoderSettings() - { - ExtraMemory = 1024 * 1024 * 8 - }; var r = LZ4Stream.Decode(rdr.BaseStream); r.CopyTo(output); }