Browse Source

Use less tolerant comparer when Fma.IsSupported for resize tests

pull/2440/head
Brian Popow 3 years ago
parent
commit
3541a4e08b
  1. 7
      tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
  2. 7
      tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs
  3. 6
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  4. 6
      tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs
  5. 6
      tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs

7
tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using Microsoft.DotNet.RemoteExecutor;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Gif;
@ -51,10 +51,11 @@ public class GifDecoderTests
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
// Floating point differences result in minor pixel differences.
// Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
// Output have been manually verified.
// For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
image.CompareToReferenceOutput(
ImageComparer.TolerantPercentage(TestEnvironment.OSArchitecture == Architecture.Arm64 ? 0.0002F : 0.0001F),
ImageComparer.TolerantPercentage(Fma.IsSupported ? 0.0001F : 0.0002F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

7
tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs

@ -1,7 +1,7 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using Microsoft.DotNet.RemoteExecutor;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Png;
@ -122,10 +122,11 @@ public partial class PngDecoderTests
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
// Floating point differences result in minor pixel differences.
// Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
// Output have been manually verified.
// For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
image.CompareToReferenceOutput(
ImageComparer.TolerantPercentage(TestEnvironment.OSArchitecture == Architecture.Arm64 ? 0.0005F : 0.0003F),
ImageComparer.TolerantPercentage(Fma.IsSupported ? 0.0003F : 0.0005F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

6
tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs

@ -2,6 +2,7 @@
// Licensed under the Six Labors Split License.
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using Microsoft.DotNet.RemoteExecutor;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Tga;
@ -760,10 +761,11 @@ public class TgaDecoderTests
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
// Floating point differences result in minor pixel differences.
// Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
// Output have been manually verified.
// For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
image.CompareToReferenceOutput(
ImageComparer.TolerantPercentage(TestEnvironment.OSArchitecture == Architecture.Arm64 ? 0.0016F : 0.0001F),
ImageComparer.TolerantPercentage(Fma.IsSupported ? 0.0001F : 0.0016F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

6
tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

@ -3,6 +3,7 @@
// ReSharper disable InconsistentNaming
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Tiff;
using SixLabors.ImageSharp.Metadata;
@ -695,10 +696,11 @@ public class TiffDecoderTests : TiffDecoderBaseTester
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
// Floating point differences result in minor pixel differences.
// Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
// Output have been manually verified.
// For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
image.CompareToReferenceOutput(
TestEnvironment.OSArchitecture == Architecture.Arm64 ? ImageComparer.TolerantPercentage(0.0006F) : ImageComparer.Exact,
Fma.IsSupported ? ImageComparer.Exact : ImageComparer.TolerantPercentage(0.0006F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

6
tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs

@ -2,6 +2,7 @@
// Licensed under the Six Labors Split License.
using System.Runtime.InteropServices;
using System.Runtime.Intrinsics.X86;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Formats.Webp;
using SixLabors.ImageSharp.PixelFormats;
@ -367,10 +368,11 @@ public class WebpDecoderTests
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
// Floating point differences result in minor pixel differences.
// Floating point differences in FMA used in the ResizeKernel result in minor pixel differences.
// Output have been manually verified.
// For more details see discussion: https://github.com/SixLabors/ImageSharp/pull/1513#issuecomment-763643594
image.CompareToReferenceOutput(
ImageComparer.TolerantPercentage(TestEnvironment.OSArchitecture == Architecture.Arm64 ? 0.0156F : 0.0007F),
ImageComparer.TolerantPercentage(Fma.IsSupported ? 0.0007F : 0.0156F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

Loading…
Cancel
Save