mirror of
https://github.com/AssetRipper/AssetRipper.TextureDecoder.git
synced 2026-11-13 12:41:27 -10:00
32 lines
1.1 KiB
C#
32 lines
1.1 KiB
C#
using AssetRipper.TextureDecoder.Rgb.Formats;
|
|
|
|
namespace AssetRipper.TextureDecoder.Tests
|
|
{
|
|
public sealed class AtcTests
|
|
{
|
|
[Test]
|
|
public void DecompressAtcRgb4Test()
|
|
{
|
|
byte[] data = File.ReadAllBytes(TestFileFolders.AtcTestFiles + "test.atc_rgb4");
|
|
int bytesRead = Atc.AtcDecoder.DecompressAtcRgb4<ColorBGRA<byte>, byte>(data, 256, 256, out byte[] decodedData);
|
|
using (Assert.EnterMultipleScope())
|
|
{
|
|
Assert.That(bytesRead, Is.EqualTo(data.Length));
|
|
Assert.That(decodedData, Is.EqualTo(File.ReadAllBytes(TestFileFolders.AtcTestFiles + "test.atc_rgb4_decoded")));
|
|
}
|
|
}
|
|
|
|
[Test]
|
|
public void DecompressAtcRgba8Test()
|
|
{
|
|
byte[] data = File.ReadAllBytes(TestFileFolders.AtcTestFiles + "test.atc_rgba8");
|
|
int bytesRead = Atc.AtcDecoder.DecompressAtcRgba8<ColorBGRA<byte>, byte>(data, 256, 256, out byte[] decodedData);
|
|
using (Assert.EnterMultipleScope())
|
|
{
|
|
Assert.That(bytesRead, Is.EqualTo(data.Length));
|
|
Assert.That(decodedData, Is.EqualTo(File.ReadAllBytes(TestFileFolders.AtcTestFiles + "test.atc_rgba8_decoded")));
|
|
}
|
|
}
|
|
}
|
|
}
|