Browse Source

introduced test for #178

af/merge-core
Anton Firszov 9 years ago
parent
commit
72289466f7
  1. 9
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  2. 4
      tests/ImageSharp.Tests/TestImages.cs
  3. 3
      tests/Images/Input/Jpg/issues/Issue178Lemon-ProgressiveWithTooManyCoefficients.jpg

9
tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

@ -36,13 +36,16 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
TestImages.Jpeg.Baseline.Jpeg420Small,
TestImages.Jpeg.Baseline.Jpeg444,
TestImages.Jpeg.Baseline.Bad.BadEOF,
TestImages.Jpeg.Baseline.Bad.ExifUndefType
TestImages.Jpeg.Baseline.Bad.ExifUndefType,
};
public static string[] ProgressiveTestJpegs =
{
TestImages.Jpeg.Progressive.Fb, TestImages.Jpeg.Progressive.Progress,
TestImages.Jpeg.Progressive.Festzug, TestImages.Jpeg.Progressive.Bad.BadEOF
TestImages.Jpeg.Progressive.Festzug, TestImages.Jpeg.Progressive.Bad.BadEOF,
TestImages.Jpeg.Issues.ProgressiveWithTooManyCoefficients178
};
public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.RgbaVector;
@ -136,7 +139,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Jpg
}
[Theory]
[WithFile(TestImages.Jpeg.Issues.Issue214CriticalEOF, PixelTypes.Rgba32)]
[WithFile(TestImages.Jpeg.Issues.CriticalEOF214, PixelTypes.Rgba32)]
public void DecodeBaselineJpeg_CriticalEOF_ShouldThrow_Orig<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : struct, IPixel<TPixel>
{

4
tests/ImageSharp.Tests/TestImages.cs

@ -114,9 +114,9 @@ namespace SixLabors.ImageSharp.Tests
public class Issues
{
public const string Issue214CriticalEOF = "Jpg/issues/Issue214-CriticalEOF .jpg";
public const string CriticalEOF214 = "Jpg/issues/Issue214-CriticalEOF.jpg";
public const string Issue159Girl = "Jpg/issues/Issue159Girl.jpg";
public const string Issue178Lemon = "Jpg/issues/Issue178.jpg";
public const string ProgressiveWithTooManyCoefficients178 = "Jpg/issues/Issue178Lemon-ProgressiveWithTooManyCoefficients.jpg";
}
public static readonly string[] All = Baseline.All.Concat(Progressive.All).ToArray();

3
tests/Images/Input/Jpg/issues/Issue178Lemon-ProgressiveWithTooManyCoefficients.jpg

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