Browse Source

try to mitigate 32 bit failures

af/UniformUnmanagedMemoryPoolMemoryAllocator-02-MemoryGuards
Anton Firszov 5 years ago
parent
commit
1a86d6d57d
  1. 9
      tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs
  2. 8
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs

9
tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs

@ -29,6 +29,15 @@ namespace SixLabors.ImageSharp.Tests.Formats.Gif
{ TestImages.Gif.Ratio4x1, 4, 1, PixelResolutionUnit.AspectRatio } { TestImages.Gif.Ratio4x1, 4, 1, PixelResolutionUnit.AspectRatio }
}; };
public GifEncoderTests()
{
// Free the pool on 32 bit:
if (!TestEnvironment.Is64BitProcess)
{
Configuration.Default.MemoryAllocator.ReleaseRetainedResources();
}
}
[Theory] [Theory]
[WithTestPatternImages(100, 100, TestPixelTypes, false)] [WithTestPatternImages(100, 100, TestPixelTypes, false)]
[WithTestPatternImages(100, 100, TestPixelTypes, false)] [WithTestPatternImages(100, 100, TestPixelTypes, false)]

8
tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs

@ -21,11 +21,17 @@ namespace SixLabors.ImageSharp.Tests
public abstract partial class TestImageProvider<TPixel> : ITestImageProvider, IXunitSerializable public abstract partial class TestImageProvider<TPixel> : ITestImageProvider, IXunitSerializable
where TPixel : unmanaged, IPixel<TPixel> where TPixel : unmanaged, IPixel<TPixel>
{ {
public TestImageProvider()
{
this.Configuration = Configuration.CreateDefaultInstance();
this.Configuration.MemoryAllocator = Configuration.Default.MemoryAllocator;
}
public PixelTypes PixelType { get; private set; } = typeof(TPixel).GetPixelType(); public PixelTypes PixelType { get; private set; } = typeof(TPixel).GetPixelType();
public virtual string SourceFileOrDescription => string.Empty; public virtual string SourceFileOrDescription => string.Empty;
public Configuration Configuration { get; set; } = Configuration.CreateDefaultInstance(); public Configuration Configuration { get; set; }
/// <summary> /// <summary>
/// Gets the utility instance to provide information about the test image & manage input/output. /// Gets the utility instance to provide information about the test image & manage input/output.

Loading…
Cancel
Save