Skip to content

Commit f1a799e

Browse files
Amaury LevéEvangelink
authored andcommitted
Apply suggested change for test
Avoid relying on the submodule change by implementing the invert swizzle operation
1 parent 5f3bb97 commit f1a799e

File tree

1 file changed

+22
-5
lines changed

1 file changed

+22
-5
lines changed

tests/ImageSharp.Tests/Processing/Processors/Transforms/SwizzleTests.cs

Lines changed: 22 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@
22
// Licensed under the Apache License, Version 2.0.
33

44
using SixLabors.ImageSharp.PixelFormats;
5+
using SixLabors.ImageSharp.Processing;
56
using SixLabors.ImageSharp.Processing.Extensions.Transforms;
67
using SixLabors.ImageSharp.Processing.Processors.Transforms;
8+
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
79
using Xunit;
810

911
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms
@@ -31,11 +33,26 @@ public void Transform(Point point, out Point newPoint)
3133
public void InvertXAndYSwizzle<TPixel>(TestImageProvider<TPixel> provider)
3234
where TPixel : unmanaged, IPixel<TPixel>
3335
{
34-
Image<TPixel> image = provider.GetImage();
35-
provider.RunValidatingProcessorTest(
36-
ctx => ctx.Swizzle(new InvertXAndYSwizzler(new Size(image.Width, image.Height))),
37-
testOutputDetails: nameof(InvertXAndYSwizzler),
38-
appendPixelTypeToFileName: false);
36+
using Image<TPixel> expectedImage = provider.GetImage();
37+
using Image<TPixel> image = provider.GetImage();
38+
39+
image.Mutate(ctx => ctx.Swizzle(new InvertXAndYSwizzler(new Size(image.Width, image.Height))));
40+
41+
image.DebugSave(
42+
provider,
43+
nameof(InvertXAndYSwizzler),
44+
appendPixelTypeToFileName: false,
45+
appendSourceFileOrDescription: true);
46+
47+
image.Mutate(ctx => ctx.Swizzle(new InvertXAndYSwizzler(new Size(image.Width, image.Height))));
48+
49+
image.DebugSave(
50+
provider,
51+
"Unswizzle",
52+
appendPixelTypeToFileName: false,
53+
appendSourceFileOrDescription: true);
54+
55+
ImageComparer.Exact.VerifySimilarity(expectedImage, image);
3956
}
4057
}
4158
}

0 commit comments

Comments
 (0)