Browse Source

adding a few more cases to PngEncoderTests

af/merge-core
Anton Firszov 8 years ago
parent
commit
70ed6c7b82
  1. 18
      tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs
  2. 2
      tests/Images/External

18
tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs

@ -45,7 +45,13 @@ namespace SixLabors.ImageSharp.Tests
30, 55, 100, 201, 255
};
public static readonly TheoryData<int> PaletteLargeOnly = new TheoryData<int>()
{
80, 100, 120, 230
};
[Theory]
[WithFile(TestImages.Png.Palette8Bpp, nameof(PngColorTypes), PixelTypes.Rgba32)]
[WithTestPatternImages(nameof(PngColorTypes), 48, 24, PixelTypes.Rgba32)]
[WithTestPatternImages(nameof(PngColorTypes), 47, 8, PixelTypes.Rgba32)]
[WithTestPatternImages(nameof(PngColorTypes), 49, 7, PixelTypes.Rgba32)]
@ -56,7 +62,7 @@ namespace SixLabors.ImageSharp.Tests
{
TestPngEncoderCore(provider, pngColorType, appendPngColorType: true);
}
[Theory]
[WithTestPatternImages(nameof(PngColorTypes), 24, 24, PixelTypes.Rgba32 | PixelTypes.Bgra32 | PixelTypes.Rgb24)]
public void IsNotBoundToSinglePixelType<TPixel>(TestImageProvider<TPixel> provider, PngColorType pngColorType)
@ -73,6 +79,16 @@ namespace SixLabors.ImageSharp.Tests
TestPngEncoderCore(provider, PngColorType.RgbWithAlpha, compressionLevel, appendCompressionLevel: true);
}
[Theory]
[WithFile(TestImages.Png.Palette8Bpp, nameof(PaletteLargeOnly), PixelTypes.Rgba32)]
public void PaletteColorType_WuQuantizer_File<TPixel>(
TestImageProvider<TPixel> provider,
int paletteSize)
where TPixel : struct, IPixel<TPixel>
{
this.PaletteColorType_WuQuantizer(provider, paletteSize);
}
[Theory]
[WithTestPatternImages(nameof(PaletteSizes), 72, 72, PixelTypes.Rgba32)]
public void PaletteColorType_WuQuantizer<TPixel>(TestImageProvider<TPixel> provider, int paletteSize)

2
tests/Images/External

@ -1 +1 @@
Subproject commit 550a157d8af7a6883646a010c609f9c7c5c015ac
Subproject commit b3be1178d4e970efc624181480094e50b0d57a90
Loading…
Cancel
Save