Browse Source

Change test images, add additional tests

af/merge-core
Brian Popow 6 years ago
parent
commit
296e75bb3f
  1. 60
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 21
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Tga/bike_16bit.tga
  4. 3
      tests/Images/Input/Tga/bike_16bit_rle.tga
  5. 3
      tests/Images/Input/Tga/bike_24bit.tga
  6. 3
      tests/Images/Input/Tga/bike_24bit_rle.tga
  7. 3
      tests/Images/Input/Tga/bike_32bit.tga
  8. 3
      tests/Images/Input/Tga/bike_32bit_rle.tga
  9. 3
      tests/Images/Input/Tga/bike_8bit.tga
  10. 3
      tests/Images/Input/Tga/bike_8bit_rle.tga
  11. 3
      tests/Images/Input/Tga/ccm8.tga
  12. 3
      tests/Images/Input/Tga/rgb15.tga
  13. 3
      tests/Images/Input/Tga/rgb15rle.tga
  14. 3
      tests/Images/Input/Tga/targa.png
  15. 3
      tests/Images/Input/Tga/targa_16bit.tga
  16. 3
      tests/Images/Input/Tga/targa_16bit_pal.tga
  17. 3
      tests/Images/Input/Tga/targa_16bit_rle.tga
  18. 3
      tests/Images/Input/Tga/targa_24bit.tga
  19. 3
      tests/Images/Input/Tga/targa_24bit_pal.tga
  20. 3
      tests/Images/Input/Tga/targa_24bit_rle.tga
  21. 3
      tests/Images/Input/Tga/targa_32bit.tga
  22. 3
      tests/Images/Input/Tga/targa_32bit_rle.tga
  23. 3
      tests/Images/Input/Tga/targa_8bit.tga
  24. 3
      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";
}
}
}

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3b2bc922e2397ce8cd8b1e7792f20e2c7edad68ad8fac037a5b91bba5148a80b
size 97518

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:c9f7381f04b3ce23e3144f6b5789d7eccc0c0f010fc901f42d01171556181c1c
size 56938

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:26d55794c9b012b07517d1129630ccc35ca56015cbdd481debea00826130f925
size 146268

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:88f7936db92cf536c9656a8ff00c25842c71b93823e05322a1efc3aef2c0a80e
size 106721

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:cb3774b695d2409f3e7584dc67ce7b3d8a75377c194e7f33e4cc315b3ae36a35
size 195018

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:815e9f32f29a8c51bbd0f2c7d507d6331a709f157fb7bd65188fd07677764c59
size 141452

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:75f3ce893f38d90767c692eb9628026c0421330934a5cbb686813ec26a9606d2
size 48768

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

@ -1,3 +0,0 @@
version https://git-lfs.github.com/spec/v1
oid sha256:1531a0f8a95fb4a57e0bde1842b6ee65f5cabfc62ad883d1f9dbc2c5616e498f
size 37259

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:67b3ffaaa75561d8b959258d6b26a1f9ca3228b02a3df98a614ea43241aaea52
size 9271

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:390cfff190bc41386fa134eca70ea0d3ffdc32a285c73278ed34046b09c46c9d
size 80537

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:3219186fc9a9f859c99c2b31cf81e7f0ab4292956d22fc659e714d0cdb51cfa7
size 19941

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:abc382cec34a04815bd53ad30707c6cdeeceece8731244244e2ab91026d60957
size 106139

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f3adea897f8843b73d0042e23bdfbd0115a7f534df90699134e768df57061f46
size 70518

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:97a4ac0cecfe69e1b5c74db5288fb8ca3bf29968e3b5288c4e5ce03bb4f06915
size 35780

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:47d7ebf37672ea846ce071155733697e34083de36aeaafaebd78317708feffde
size 19566

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:35921b6250e43ba8e1fb125ebe4939a57a67efb0aa9eac0d3605bf90e93309b1
size 105768

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:4926969e5ae6c9af38d33fa18429de756c48d06edd87c5d27cb8d5232b066ab2
size 36036

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:56a79ab92d84bbe8c7efbc2711051938fa3ba97b48830aea0cb1dafd7d1fe222
size 37711

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:e3a220619e25e86bab01b01a2e231ee64fd004e047fa86016bf68de576877352
size 141018

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:f415d6a246909c18fe604248ab5fe27c74aff9a63df58d8cdeab7c4c3cbe056a
size 49994

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:6aaae46d0e55f32a72732fbe48ed9dc4044c53432999ab66e9475e45e40f0133
size 35268

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

@ -0,0 +1,3 @@
version https://git-lfs.github.com/spec/v1
oid sha256:a18d7fd98bc9ab62276103b4e7b474be93b3d7241f4f06aa564e32150e205a71
size 13145
Loading…
Cancel
Save