Browse Source

Split tga alpha bits tests in 16 bit and 32 bit tests

pull/1157/head
Brian Popow 6 years ago
parent
commit
19ebfbdf5c
  1. 20
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  2. 2
      tests/ImageSharp.Tests/TestImages.cs
  3. 2
      tests/Images/External
  4. 0
      tests/Images/Input/Tga/32bit_no_alphabits.tga

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

@ -7,6 +7,7 @@ using SixLabors.ImageSharp.Formats.Tga;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using Xunit;
// ReSharper disable InconsistentNaming
@ -199,11 +200,9 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
[Theory]
[WithFile(NoAlphaBits32Bit, PixelTypes.Rgba32)]
[WithFile(NoAlphaBits16Bit, PixelTypes.Rgba32)]
[WithFile(NoAlphaBits32BitRle, PixelTypes.Rgba32)]
[WithFile(NoAlphaBits16BitRle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WhenAlphaBitsNotSet<TPixel>(TestImageProvider<TPixel> provider)
public void TgaDecoder_CanDecode_WhenAlphaBitsNotSet_16Bit<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
@ -213,6 +212,21 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
}
}
[Theory]
[WithFile(NoAlphaBits32Bit, PixelTypes.Rgba32)]
[WithFile(NoAlphaBits32BitRle, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WhenAlphaBitsNotSet<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
using (Image<TPixel> image = provider.GetImage(TgaDecoder))
{
// Using here the reference output instead of the the reference decoder,
// because the reference decoder does not ignore the alpha data here.
image.DebugSave(provider);
image.CompareToReferenceOutput(ImageComparer.Exact, provider);
}
}
[Theory]
[WithFile(Bit16, PixelTypes.Rgba32)]
[WithFile(Bit24, PixelTypes.Rgba32)]

2
tests/ImageSharp.Tests/TestImages.cs

@ -392,7 +392,7 @@ namespace SixLabors.ImageSharp.Tests
public const string Bit24Pal = "Tga/targa_24bit_pal.tga";
public const string NoAlphaBits16Bit = "Tga/16bit_noalphabits.tga";
public const string NoAlphaBits16BitRle = "Tga/16bit_rle_noalphabits.tga";
public const string NoAlphaBits32Bit = "Tga/32bit_noalphabits.tga";
public const string NoAlphaBits32Bit = "Tga/32bit_no_alphabits.tga";
public const string NoAlphaBits32BitRle = "Tga/32bit_rle_no_alphabits.tga";
}
}

2
tests/Images/External

@ -1 +1 @@
Subproject commit d809551931858cd3873bad49d2fe915fddff7a26
Subproject commit 985e050aa7ac11830ae7a178ca2283f8b6307e4c

0
tests/Images/Input/Tga/32bit_noalphabits.tga → tests/Images/Input/Tga/32bit_no_alphabits.tga

Before

Width:  |  Height:  |  Size: 60 KiB

After

Width:  |  Height:  |  Size: 60 KiB

Loading…
Cancel
Save