Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Dependencies #1378

Merged
merged 18 commits into from
Oct 15, 2020
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Don't use generics.
Could have saved myself days of issues if i'd just thought of this first.
JimBobSquarePants committed Oct 15, 2020
commit 314e9f6b07c200f1fda3475a40653957b2b3fba9
16 changes: 4 additions & 12 deletions tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs
Original file line number Diff line number Diff line change
@@ -52,26 +52,18 @@ public void BmpDecoder_CanDecode_MiscellaneousBitmaps<TPixel>(TestImageProvider<
}
}

[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>
public void BmpDecoder_CanDecode_MiscellaneousBitmaps_WithLimitedAllocatorBufferCapacity(
TestImageProvider<Rgba32> provider)
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

static void RunTest(string providerDump, string nonContiguousBuffersStr)
{
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
TestImageProvider<Rgba32> provider = BasicSerializer.Deserialize<TestImageProvider<Rgba32>>(providerDump);

provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100);

using Image<TPixel> image = provider.GetImage(BmpDecoder);
using Image<Rgba32> image = provider.GetImage(BmpDecoder);
image.DebugSave(provider, nonContiguousBuffersStr);

if (TestEnvironment.IsWindows)
16 changes: 5 additions & 11 deletions tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
Original file line number Diff line number Diff line change
@@ -195,26 +195,20 @@ public void GifDecoder_DegenerateMemoryRequest_ShouldTranslateTo_ImageFormatExce
Assert.IsType<InvalidMemoryOperationException>(ex.InnerException);
}

[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)]
[Theory]
[WithFile(TestImages.Gif.Giphy, PixelTypes.Rgba32)]
[WithFile(TestImages.Gif.Kumin, PixelTypes.Rgba32)]
public void GifDecoder_CanDecode_WithLimitedAllocatorBufferCapacity<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
public void GifDecoder_CanDecode_WithLimitedAllocatorBufferCapacity(
TestImageProvider<Rgba32> provider)
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

static void RunTest(string providerDump, string nonContiguousBuffersStr)
{
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
TestImageProvider<Rgba32> provider
= BasicSerializer.Deserialize<TestImageProvider<Rgba32>>(providerDump);

provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100);

using Image<TPixel> image = provider.GetImage(GifDecoder);
using Image<Rgba32> image = provider.GetImage(GifDecoder);
image.DebugSave(provider, nonContiguousBuffersStr);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch

image.CompareToOriginal(provider);
}
20 changes: 6 additions & 14 deletions tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.Progressive.cs
Original file line number Diff line number Diff line change
@@ -28,26 +28,18 @@ public void DecodeProgressiveJpeg<TPixel>(TestImageProvider<TPixel> provider)
appendPixelTypeToFileName: false);
}

[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)]
[Theory]
[WithFile(TestImages.Jpeg.Progressive.Progress, PixelTypes.Rgba32)]
public void DecodeProgressiveJpeg_WithLimitedAllocatorBufferCapacity<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
public void DecodeProgressiveJpeg_WithLimitedAllocatorBufferCapacity(TestImageProvider<Rgba32> provider)
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

static void RunTest(string providerDump, string nonContiguousBuffersStr)
{
TestImageProvider<TPixel> provider =
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
TestImageProvider<Rgba32> provider =
BasicSerializer.Deserialize<TestImageProvider<Rgba32>>(providerDump);

provider.LimitAllocatorBufferCapacity().InBytesSqrt(200);

using Image<TPixel> image = provider.GetImage(JpegDecoder);
using Image<Rgba32> image = provider.GetImage(JpegDecoder);
image.DebugSave(provider, nonContiguousBuffersStr);

provider.Utility.TestName = DecodeProgressiveJpegOutputName;
@@ -62,8 +54,8 @@ static void RunTest(string providerDump, string nonContiguousBuffersStr)
RemoteExecutor.Invoke(
RunTest,
providerDump,
"Disco")
.Dispose();
"Disco")
.Dispose();
}
}
}
20 changes: 3 additions & 17 deletions tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs
Original file line number Diff line number Diff line change
@@ -396,37 +396,23 @@ public void Issue410_MalformedApplePng<TPixel>(TestImageProvider<TPixel> provide
public void PngDecoder_DegenerateMemoryRequest_ShouldTranslateTo_ImageFormatException<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

provider.LimitAllocatorBufferCapacity().InPixelsSqrt(10);
InvalidImageContentException ex = Assert.Throws<InvalidImageContentException>(() => provider.GetImage(PngDecoder));
Assert.IsType<InvalidMemoryOperationException>(ex.InnerException);
}

[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)]
[Theory]
[WithFile(TestImages.Png.Splash, PixelTypes.Rgba32)]
[WithFile(TestImages.Png.Bike, PixelTypes.Rgba32)]
public void PngDecoder_CanDecode_WithLimitedAllocatorBufferCapacity<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
public void PngDecoder_CanDecode_WithLimitedAllocatorBufferCapacity(TestImageProvider<Rgba32> provider)
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

static void RunTest(string providerDump, string nonContiguousBuffersStr)
{
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
TestImageProvider<Rgba32> provider = BasicSerializer.Deserialize<TestImageProvider<Rgba32>>(providerDump);

provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100);

using Image<TPixel> image = provider.GetImage(PngDecoder);
using Image<Rgba32> image = provider.GetImage(PngDecoder);
image.DebugSave(provider, testOutputDetails: nonContiguousBuffersStr);
image.CompareToOriginal(provider);
}
14 changes: 3 additions & 11 deletions tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs
Original file line number Diff line number Diff line change
@@ -534,22 +534,14 @@ public void Encode_WorksWithDiscontiguousBuffers<TPixel>(TestImageProvider<TPixe
}
}

[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)]
[Theory]
[WithTestPatternImages(100, 100, PixelTypes.Rgba32)]
public void EncodeWorksWithoutSsse3Intrinsics<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
public void EncodeWorksWithoutSsse3Intrinsics(TestImageProvider<Rgba32> provider)
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

static void RunTest(string providerDump)
{
TestImageProvider<TPixel> provider =
BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
TestImageProvider<Rgba32> provider =
BasicSerializer.Deserialize<TestImageProvider<Rgba32>>(providerDump);
#if SUPPORTS_RUNTIME_INTRINSICS
Assert.False(Ssse3.IsSupported);
#endif
14 changes: 3 additions & 11 deletions tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
Original file line number Diff line number Diff line change
@@ -744,26 +744,18 @@ public void TgaDecoder_DegenerateMemoryRequest_ShouldTranslateTo_ImageFormatExce
Assert.IsType<InvalidMemoryOperationException>(ex.InnerException);
}

[ActiveIssue("https://github.com/dotnet/arcade/issues/6393", TargetFrameworkMonikers.NetFramework)]
[Theory]
[WithFile(Bit24BottomLeft, PixelTypes.Rgba32)]
[WithFile(Bit32BottomLeft, PixelTypes.Rgba32)]
public void TgaDecoder_CanDecode_WithLimitedAllocatorBufferCapacity<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel>
public void TgaDecoder_CanDecode_WithLimitedAllocatorBufferCapacity(TestImageProvider<Rgba32> provider)
{
// dotnet xunit doesn't respect filter.
if (TestEnvironment.IsFramework)
{
return;
}

static void RunTest(string providerDump, string nonContiguousBuffersStr)
{
TestImageProvider<TPixel> provider = BasicSerializer.Deserialize<TestImageProvider<TPixel>>(providerDump);
TestImageProvider<Rgba32> provider = BasicSerializer.Deserialize<TestImageProvider<Rgba32>>(providerDump);

provider.LimitAllocatorBufferCapacity().InPixelsSqrt(100);

using Image<TPixel> image = provider.GetImage(TgaDecoder);
using Image<Rgba32> image = provider.GetImage(TgaDecoder);
image.DebugSave(provider, testOutputDetails: nonContiguousBuffersStr);

if (TestEnvironment.IsWindows)