Browse Source

Skip limited buffer bitmap test on NETFX

js/color-alpha-handling
James Jackson-South 6 years ago
parent
commit
586f2dca75
  1. 30
      tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs

30
tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs

@ -39,22 +39,34 @@ namespace SixLabors.ImageSharp.Tests.Formats.Bmp
}; };
[Theory] [Theory]
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32, false)] [WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32)]
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32, true)] public void BmpDecoder_CanDecode_MiscellaneousBitmaps<TPixel>(TestImageProvider<TPixel> provider)
public void BmpDecoder_CanDecode_MiscellaneousBitmaps<TPixel>(TestImageProvider<TPixel> provider, bool enforceDiscontiguousBuffers) where TPixel : unmanaged, IPixel<TPixel>
{
using Image<TPixel> image = provider.GetImage(BmpDecoder);
image.DebugSave(provider);
if (TestEnvironment.IsWindows)
{
image.CompareToOriginal(provider);
}
}
[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)]
[Theory]
[WithFileCollection(nameof(MiscBmpFiles), PixelTypes.Rgba32)]
public void BmpDecoder_CanDecode_MiscellaneousBitmaps_WithLimitedAllocatorBufferCapacity<TPixel>(
TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> where TPixel : unmanaged, IPixel<TPixel>
{ {
static void RunTest(string providerDump, string nonContiguousBuffersStr) static void RunTest(string providerDump, string nonContiguousBuffersStr)
{ {
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump); TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
if (!string.IsNullOrEmpty(nonContiguousBuffersStr)) provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100);
{
provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100);
}
using Image<TPixel> image = provider.GetImage(BmpDecoder); using Image<TPixel> image = provider.GetImage(BmpDecoder);
image.DebugSave(provider, testOutputDetails: nonContiguousBuffersStr); image.DebugSave(provider, nonContiguousBuffersStr);
if (TestEnvironment.IsWindows) if (TestEnvironment.IsWindows)
{ {
@ -66,7 +78,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Bmp
RemoteExecutor.Invoke( RemoteExecutor.Invoke(
RunTest, RunTest,
providerDump, providerDump,
enforceDiscontiguousBuffers ? "Disco" : string.Empty) "Disco")
.Dispose(); .Dispose();
} }

Loading…
Cancel
Save