Skip to content

Commit 6743903

Browse files
committed
Updated unit test due to changes in ImageMagick.
1 parent 7ada073 commit 6743903

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

tests/Magick.NET.Tests/MagickImageTests/TheCompareMethod.cs

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ public void ShouldUseTheColorFuzz()
168168
[InlineData(ErrorMetric.MeanSquared, 0.2233)]
169169
[InlineData(ErrorMetric.NormalizedCrossCorrelation, 0.0682)]
170170
[InlineData(ErrorMetric.PeakAbsolute, 1)]
171-
[InlineData(ErrorMetric.PeakSignalToNoiseRatio, 0.1441)]
171+
[InlineData(ErrorMetric.PeakSignalToNoiseRatio, -0.1351)]
172172
[InlineData(ErrorMetric.PerceptualHash, 0)]
173173
[InlineData(ErrorMetric.RootMeanSquared, 0.4726)]
174174
[InlineData(ErrorMetric.StructuralSimilarity, 0.4220)]
@@ -181,7 +181,10 @@ public void ShouldReturnTheCorrectValueForEachErrorMetric(ErrorMetric errorMetri
181181
using var other = image.CloneAndMutate(image => image.Rotate(180));
182182

183183
var result = image.Compare(other, errorMetric);
184-
Assert.InRange(result, expectedResult, expectedResult + 0.0001);
184+
if (expectedResult < 0)
185+
Assert.InRange(result, expectedResult - 0.0001, expectedResult);
186+
else
187+
Assert.InRange(result, expectedResult, expectedResult + 0.0001);
185188
}
186189
}
187190
}

0 commit comments

Comments
 (0)