Skip to content

Commit

Permalink
Adapt BmpDecoder_ThrowsException_Issue2696 for V2
Browse files Browse the repository at this point in the history
  • Loading branch information
antonfirsov committed Apr 10, 2024
1 parent 5c6ec5d commit 3d298db
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -624,9 +624,13 @@ public void BmpDecoder_CanDecode_Os2BitmapArray<TPixel>(TestImageProvider<TPixel
[WithFile(Issue2696, PixelTypes.Rgba32)]
public void BmpDecoder_ThrowsException_Issue2696<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
=> Assert.Throws<InvalidImageContentException>(() =>
{
using Image<TPixel> image = provider.GetImage(BmpDecoder);
});
{
// On V2 this is throwing InvalidOperationException,
// because of the validation logic in BmpInfoHeader.VerifyDimensions().
Assert.Throws<InvalidOperationException>(() =>
{
using Image<TPixel> image = provider.GetImage(BmpDecoder);
});
}
}
}
4 changes: 2 additions & 2 deletions tests/Images/Input/Bmp/issue-2696.bmp
Git LFS file not shown

0 comments on commit 3d298db

Please sign in to comment.