From e4c7febccb4dc9bb4557afe68e19b8adafbec564 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Fri, 30 Nov 2018 03:17:48 +0100 Subject: [PATCH] less strict tolerance for 32bit .NET + NearestNeighborResampler, more strict tolerance for the rest --- .../Processing/Processors/Transforms/ResizeTests.cs | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs index cdaf3cea3..5c2dffe58 100644 --- a/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs +++ b/tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeTests.cs @@ -51,7 +51,16 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms { IResampler sampler = TestUtils.GetResampler(samplerName); - var comparer = ImageComparer.TolerantPercentage(0.02f); + // NeirestNeighbourResampler is producing slightly different results With classic .NET framework on 32bit + // most likely because of differences in numeric behavior. + // The difference is well visible when comparing output for + // Resize_WorksWithAllResamplers_TestPattern301x1180_NearestNeighbor-300x480.png + // TODO: Should we investigate this? + bool allowHigherInaccuracy = !TestEnvironment.Is64BitProcess + && string.IsNullOrEmpty(TestEnvironment.NetCoreVersion) + && sampler is NearestNeighborResampler; + + var comparer = ImageComparer.TolerantPercentage(allowHigherInaccuracy ? 0.3f : 0.01f); provider.RunValidatingProcessorTest( ctx =>