From 3860fb6f5bcd23e3fdd1f2e907df44806f28dde1 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Fri, 19 Apr 2019 21:15:50 +0200 Subject: [PATCH] more robust tests --- .../Processing/Processors/Transforms/ResizeTests.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index 2ffb42916f..6d02b4b458 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -112,11 +112,8 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms Assert.NotEmpty(allocator.AllocationLog); - var internalAllocations = allocator.AllocationLog.Where( - e => e.ElementType == typeof(Vector4)).ToArray(); - - int maxAllocationSize = internalAllocations.Max(e => e.LengthInBytes); - + int maxAllocationSize = allocator.AllocationLog.Where( + e => e.ElementType == typeof(Vector4)).Max(e => e.LengthInBytes); Assert.True(maxAllocationSize <= Math.Max(workingBufferSizeHintInBytes, minimumWorkerAllocationInBytes)); } @@ -256,6 +253,9 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms var comparer = ImageComparer.TolerantPercentage(allowHigherInaccuracy ? 0.3f : 0.017f); + // Let's make the working buffer size non-default: + provider.Configuration.WorkingBufferSizeHintInBytes = 16 * 1024 * SizeOfVector4; + provider.RunValidatingProcessorTest( ctx => {