Browse Source

Change percentages for mac

pull/2180/head
James Jackson-South 4 years ago
parent
commit
3b6b30a2f5
  1. 2
      tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs
  2. 2
      tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs
  3. 2
      tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs
  4. 28
      tests/ImageSharp.Tests/TestUtilities/ImageComparison/Exceptions/ImageDifferenceIsOverThresholdException.cs

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

@ -56,7 +56,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Gif
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
image.CompareToReferenceOutput(
ImageComparer.Exact,
ImageComparer.TolerantPercentage(0.0001F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

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

@ -764,7 +764,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Tga
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
image.CompareToReferenceOutput(
ImageComparer.Exact,
ImageComparer.TolerantPercentage(0.0001F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

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

@ -372,7 +372,7 @@ namespace SixLabors.ImageSharp.Tests.Formats.Webp
image.DebugSave(provider, testOutputDetails: details, appendPixelTypeToFileName: false);
image.CompareToReferenceOutput(
ImageComparer.Exact,
ImageComparer.TolerantPercentage(0.0006F),
provider,
testOutputDetails: details,
appendPixelTypeToFileName: false);

28
tests/ImageSharp.Tests/TestUtilities/ImageComparison/Exceptions/ImageDifferenceIsOverThresholdException.cs

@ -24,8 +24,7 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison
sb.Append(Environment.NewLine);
// TODO: We should add macOS.
sb.AppendFormat("Test Environment OS : {0}", TestEnvironment.IsWindows ? "Windows" : "Linux");
sb.AppendFormat("Test Environment OS : {0}", GetEnvironmentName());
sb.Append(Environment.NewLine);
sb.AppendFormat("Test Environment is CI : {0}", TestEnvironment.RunsOnCI);
@ -33,11 +32,14 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison
sb.AppendFormat("Test Environment is .NET Core : {0}", !TestEnvironment.IsFramework);
sb.Append(Environment.NewLine);
sb.AppendFormat("Test Environment is Mono : {0}", TestEnvironment.IsMono);
sb.Append(Environment.NewLine);
int i = 0;
foreach (ImageSimilarityReport r in reports)
{
sb.Append($"Report ImageFrame {i}: ");
sb.Append("Report ImageFrame {i}: ");
sb.Append(r);
sb.Append(Environment.NewLine);
i++;
@ -45,5 +47,25 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison
return sb.ToString();
}
private static string GetEnvironmentName()
{
if (TestEnvironment.IsMacOS)
{
return "Mac OS";
}
if (TestEnvironment.IsMacOS)
{
return "Linux";
}
if (TestEnvironment.IsWindows)
{
return "Windows";
}
return "Unknown";
}
}
}

Loading…
Cancel
Save