Browse Source

Use different comparer on CI NETFX

af/octree-no-pixelmap
James Jackson-South 6 years ago
parent
commit
5bd59f5de8
  1. 13
      tests/ImageSharp.Tests/Processing/Processors/Quantization/QuantizerTests.cs

13
tests/ImageSharp.Tests/Processing/Processors/Quantization/QuantizerTests.cs

@ -141,7 +141,7 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Quantization
new WuQuantizer(OrderedDitherOptions), new WuQuantizer(OrderedDitherOptions),
}; };
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.05f); private static readonly ImageComparer ValidatorComparer = GetComparer();
[Theory] [Theory]
[WithFileCollection(nameof(CommonTestImages), nameof(Quantizers), PixelTypes.Rgba32)] [WithFileCollection(nameof(CommonTestImages), nameof(Quantizers), PixelTypes.Rgba32)]
@ -194,5 +194,16 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Quantization
testOutputDetails: testOutputDetails, testOutputDetails: testOutputDetails,
appendPixelTypeToFileName: false); appendPixelTypeToFileName: false);
} }
private static ImageComparer GetComparer()
{
// Net Framework on the CI produces different results than the Core output.
if (TestEnvironment.RunsOnCI && string.IsNullOrEmpty(TestEnvironment.NetCoreVersion))
{
ImageComparer.TolerantPercentage(1.5F);
}
return ImageComparer.TolerantPercentage(0.05F);
}
} }
} }

Loading…
Cancel
Save