I dunno man
This commit is contained in:
@@ -39,7 +39,7 @@ public class BitStreamTests
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestReadLong()
|
||||
public void TestReadInt()
|
||||
{
|
||||
var random = (uint)Random.Shared.Next();
|
||||
var bytes = BitConverter.GetBytes(random);
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
using fxl.codes.kisekae.data.Archives;
|
||||
using fxl.codes.kisekae.data.Archives.Algorithms;
|
||||
|
||||
namespace fxl.codes.kisekae.data.test;
|
||||
@@ -20,30 +19,10 @@ public class LZWTests
|
||||
{
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(_lzw.Encode(_unencoded), Is.EqualTo(_encoded), "Encoding failed");
|
||||
Assert.That(_lzw.Decode(_encoded), Is.EqualTo(_unencoded), "Decoding failed");
|
||||
var streamUnencoded = new MemoryStream(_unencoded);
|
||||
var streamEncoded = new MemoryStream(_encoded);
|
||||
Assert.That(_lzw.Encode(streamUnencoded), Is.EqualTo(_encoded), "Encoding failed");
|
||||
Assert.That(_lzw.Decode(streamEncoded), Is.EqualTo(_unencoded), "Decoding failed");
|
||||
});
|
||||
}
|
||||
|
||||
[Test]
|
||||
public void TestDecompressLzh()
|
||||
{
|
||||
var assembly = typeof(LZWTests).Assembly;
|
||||
foreach (var resource in assembly.GetManifestResourceNames())
|
||||
{
|
||||
using var stream = assembly.GetManifestResourceStream(resource);
|
||||
if (stream == null) continue;
|
||||
|
||||
var files = LhCodecService.GetFiles(in stream);
|
||||
foreach (var file in files)
|
||||
Assert.Multiple(() =>
|
||||
{
|
||||
Assert.That(file.CompressedFile, Is.Not.Null);
|
||||
Assert.That(file.CompressedFile, Is.Not.Empty);
|
||||
|
||||
var decompressed = _lzw.Decode(file.CompressedFile);
|
||||
Assert.That(decompressed, Is.Not.Null);
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user