Browse Source

Change test images, add additional tests

pull/1026/head
Brian Popow 7 years ago
parent
commit
391cb445f2
  1. 60
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 21
      tests/ImageSharp.Tests/TestImages.cs
  3. BIN
      tests/Images/Input/Tga/bike_16bit.tga
  4. BIN
      tests/Images/Input/Tga/bike_16bit_rle.tga
  5. BIN
      tests/Images/Input/Tga/bike_24bit.tga
  6. BIN
      tests/Images/Input/Tga/bike_24bit_rle.tga
  7. BIN
      tests/Images/Input/Tga/bike_32bit.tga
  8. BIN
      tests/Images/Input/Tga/bike_32bit_rle.tga
  9. BIN
      tests/Images/Input/Tga/bike_8bit.tga
  10. BIN
      tests/Images/Input/Tga/bike_8bit_rle.tga
  11. BIN
      tests/Images/Input/Tga/ccm8.tga
  12. BIN
      tests/Images/Input/Tga/rgb15.tga
  13. BIN
      tests/Images/Input/Tga/rgb15rle.tga
  14. BIN
      tests/Images/Input/Tga/targa.png
  15. BIN
      tests/Images/Input/Tga/targa_16bit.tga
  16. BIN
      tests/Images/Input/Tga/targa_16bit_pal.tga
  17. BIN
      tests/Images/Input/Tga/targa_16bit_rle.tga
  18. BIN
      tests/Images/Input/Tga/targa_24bit.tga
  19. BIN
      tests/Images/Input/Tga/targa_24bit_pal.tga
  20. BIN
      tests/Images/Input/Tga/targa_24bit_rle.tga
  21. BIN
      tests/Images/Input/Tga/targa_32bit.tga
  22. BIN
      tests/Images/Input/Tga/targa_32bit_rle.tga
  23. BIN
      tests/Images/Input/Tga/targa_8bit.tga
  24. BIN
      tests/Images/Input/Tga/targa_8bit_rle.tga

60
tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs

@ -31,6 +31,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit15, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_15Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit15Rle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_15Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit16, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_16Bit<TPixel>(TestImageProvider<TPixel> provider)
@ -43,6 +67,18 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit16PalRle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_RunLengthEncoded_WithPalette_16Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_Uncompressed_24Bit<TPixel>(TestImageProvider<TPixel> provider)
@ -115,6 +151,30 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(Bit16Pal, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_16Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
[Theory]
[WithFile(Bit24Pal, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithPalette_24Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(new TgaDecoder()))
{
image.DebugSave(provider);
CompareWithReferenceDecoder(provider, image);
}
}
private void CompareWithReferenceDecoder<TPixel>(TestImageProvider<TPixel> provider, Image<TPixel> image)
where TPixel : struct, IPixel<TPixel>
{

21
tests/ImageSharp.Tests/TestImages.cs

@ -368,14 +368,19 @@ namespace SixLabors.ImageSharp.Tests
public static class Tga
{
public const string Bit32 = "Tga/bike_32bit.tga";
public const string Bit24 = "Tga/bike_24bit.tga";
public const string Bit16 = "Tga/bike_16bit.tga";
public const string Grey = "Tga/bike_8bit.tga";
public const string Bit32Rle = "Tga/bike_32bit_rle.tga";
public const string Bit24Rle = "Tga/bike_24bit_rle.tga";
public const string Bit16Rle = "Tga/bike_16bit_rle.tga";
public const string GreyRle = "Tga/bike_8bit_rle.tga";
public const string Bit15 = "Tga/rgb15.tga";
public const string Bit15Rle = "Tga/rgb15rle.tga";
public const string Bit16 = "Tga/targa_16bit.tga";
public const string Bit16PalRle = "Tga/ccm8.tga";
public const string Bit24 = "Tga/targa_24bit.tga";
public const string Bit32 = "Tga/targa_32bit.tga";
public const string Grey = "Tga/targa_8bit.tga";
public const string GreyRle = "Tga/targa_8bit_rle.tga";
public const string Bit16Rle = "Tga/targa_16bit_rle.tga";
public const string Bit24Rle = "Tga/targa_24bit_rle.tga";
public const string Bit32Rle = "Tga/targa_32bit_rle.tga";
public const string Bit16Pal = "Tga/targa_16bit_pal.tga";
public const string Bit24Pal = "Tga/targa_24bit_pal.tga";
}
}
}

BIN
tests/Images/Input/Tga/bike_16bit.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 95 KiB

BIN
tests/Images/Input/Tga/bike_16bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/bike_24bit.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 143 KiB

BIN
tests/Images/Input/Tga/bike_24bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/bike_32bit.tga

Binary file not shown.

Before

Width:  |  Height:  |  Size: 190 KiB

BIN
tests/Images/Input/Tga/bike_32bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/bike_8bit.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/bike_8bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/ccm8.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/rgb15.tga

Binary file not shown.

After

Width:  |  Height:  |  Size: 79 KiB

BIN
tests/Images/Input/Tga/rgb15rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 104 KiB

BIN
tests/Images/Input/Tga/targa_16bit.tga

Binary file not shown.

After

Width:  |  Height:  |  Size: 69 KiB

BIN
tests/Images/Input/Tga/targa_16bit_pal.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_16bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_24bit.tga

Binary file not shown.

After

Width:  |  Height:  |  Size: 103 KiB

BIN
tests/Images/Input/Tga/targa_24bit_pal.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_24bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_32bit.tga

Binary file not shown.

After

Width:  |  Height:  |  Size: 138 KiB

BIN
tests/Images/Input/Tga/targa_32bit_rle.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_8bit.tga

Binary file not shown.

BIN
tests/Images/Input/Tga/targa_8bit_rle.tga

Binary file not shown.
Loading…
Cancel
Save