Browse Source

skip some of the MemoryManager tests on 32 bit

af/merge-core
Anton Firszov 8 years ago
parent
commit
47439142aa
  1. 18
      tests/ImageSharp.Tests/Memory/ArrayPoolMemoryManagerTests.cs
  2. 8
      tests/ImageSharp.Tests/TestUtilities/TestUtils.cs

18
tests/ImageSharp.Tests/Memory/ArrayPoolMemoryManagerTests.cs

@ -175,6 +175,12 @@ namespace SixLabors.ImageSharp.Tests.Memory
[Fact]
public void CreateWithAggressivePooling()
{
if (!TestEnvironment.Is64BitProcess)
{
// can lead to OutOfMemoryException
return;
}
this.MemoryManager = ArrayPoolMemoryManager.CreateWithAggressivePooling();
Assert.True(this.CheckIsRentingPooledBuffer<Rgba32>(4096 * 4096));
@ -183,6 +189,12 @@ namespace SixLabors.ImageSharp.Tests.Memory
[Fact]
public void CreateDefault()
{
if (!TestEnvironment.Is64BitProcess)
{
// can lead to OutOfMemoryException
return;
}
this.MemoryManager = ArrayPoolMemoryManager.CreateDefault();
Assert.False(this.CheckIsRentingPooledBuffer<Rgba32>(2 * 4096 * 4096));
@ -192,6 +204,12 @@ namespace SixLabors.ImageSharp.Tests.Memory
[Fact]
public void CreateWithModeratePooling()
{
if (!TestEnvironment.Is64BitProcess)
{
// can lead to OutOfMemoryException
return;
}
this.MemoryManager = ArrayPoolMemoryManager.CreateWithModeratePooling();
Assert.False(this.CheckIsRentingPooledBuffer<Rgba32>(2048 * 2048));

8
tests/ImageSharp.Tests/TestUtilities/TestUtils.cs

@ -169,6 +169,7 @@ namespace SixLabors.ImageSharp.Tests
{
comparer = ImageComparer.Tolerant(0.5f / 100);
}
using (Image<TPixel> image = provider.GetImage())
{
image.Mutate(process);
@ -192,12 +193,17 @@ namespace SixLabors.ImageSharp.Tests
ImageComparer comparer = null)
where TPixel : struct, IPixel<TPixel>
{
if (comparer == null)
{
comparer = ImageComparer.Tolerant(0.5f / 100);
}
using (Image<TPixel> image = provider.GetImage())
{
var bounds = new Rectangle(image.Width / 4, image.Width / 4, image.Width / 2, image.Height / 2);
image.Mutate(x => process(x, bounds));
image.DebugSave(provider, testOutputDetails);
image.CompareToReferenceOutput(provider, testOutputDetails);
image.CompareToReferenceOutput(comparer, provider, testOutputDetails);
}
}

Loading…
Cancel
Save