Browse Source

reproduce us!

af/UniformUnmanagedMemoryPoolMemoryAllocator-02-MemoryGuards
Anton Firszov 5 years ago
parent
commit
768e792573
  1. 22
      tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs
  2. 71
      tests/ImageSharp.Tests/Processing/Processors/Overlays/OverlayTestBase.cs
  3. 22
      tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs

22
tests/ImageSharp.Tests/Processing/Processors/Overlays/GlowTest.cs

@ -17,4 +17,26 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays
protected override void Apply(IImageProcessingContext ctx, Rectangle rect) => ctx.Glow(rect); protected override void Apply(IImageProcessingContext ctx, Rectangle rect) => ctx.Glow(rect);
} }
public class GlowTest_00 : GlowTest { }
public class GlowTest_01 : GlowTest { }
public class GlowTest_02 : GlowTest { }
public class GlowTest_03 : GlowTest { }
public class GlowTest_04 : GlowTest { }
public class GlowTest_05 : GlowTest { }
public class GlowTest_06 : GlowTest { }
public class GlowTest_07 : GlowTest { }
public class GlowTest_08 : GlowTest { }
public class GlowTest_09 : GlowTest { }
public class GlowTest_10 : GlowTest { }
public class GlowTest_11 : GlowTest { }
public class GlowTest_12 : GlowTest { }
public class GlowTest_13 : GlowTest { }
public class GlowTest_14 : GlowTest { }
public class GlowTest_15 : GlowTest { }
public class GlowTest_16 : GlowTest { }
public class GlowTest_17 : GlowTest { }
public class GlowTest_18 : GlowTest { }
public class GlowTest_19 : GlowTest { }
public class GlowTest_20 : GlowTest { }
} }

71
tests/ImageSharp.Tests/Processing/Processors/Overlays/OverlayTestBase.cs

@ -19,49 +19,50 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.05f); private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.05f);
[Theory] // [Theory]
[WithFileCollection(nameof(InputImages), nameof(ColorNames), PixelTypes.Rgba32)] // [WithFileCollection(nameof(InputImages), nameof(ColorNames), PixelTypes.Rgba32)]
public void FullImage_ApplyColor<TPixel>(TestImageProvider<TPixel> provider, string colorName) // public void FullImage_ApplyColor<TPixel>(TestImageProvider<TPixel> provider, string colorName)
where TPixel : unmanaged, IPixel<TPixel> // where TPixel : unmanaged, IPixel<TPixel>
{ // {
provider.Utility.TestGroupName = this.GetType().Name; // provider.Utility.TestGroupName = this.GetType().Name;
Color color = TestUtils.GetColorByName(colorName); // Color color = TestUtils.GetColorByName(colorName);
//
provider.RunValidatingProcessorTest(x => this.Apply(x, color), colorName, ValidatorComparer, appendPixelTypeToFileName: false); // provider.RunValidatingProcessorTest(x => this.Apply(x, color), colorName, ValidatorComparer, appendPixelTypeToFileName: false);
} // }
//
[Theory] // [Theory]
[WithFileCollection(nameof(InputImages), PixelTypes.Rgba32)] // [WithFileCollection(nameof(InputImages), PixelTypes.Rgba32)]
public void FullImage_ApplyRadius<TPixel>(TestImageProvider<TPixel> provider) // public void FullImage_ApplyRadius<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> // where TPixel : unmanaged, IPixel<TPixel>
{ // {
provider.Utility.TestGroupName = this.GetType().Name; // provider.Utility.TestGroupName = this.GetType().Name;
provider.RunValidatingProcessorTest( // provider.RunValidatingProcessorTest(
x => // x =>
{ // {
Size size = x.GetCurrentSize(); // Size size = x.GetCurrentSize();
this.Apply(x, size.Width / 4f, size.Height / 4f); // this.Apply(x, size.Width / 4f, size.Height / 4f);
}, // },
comparer: ValidatorComparer, // comparer: ValidatorComparer,
appendPixelTypeToFileName: false); // appendPixelTypeToFileName: false);
} // }
[Theory] // [Theory]
[WithFileCollection(nameof(InputImages), PixelTypes.Rgba32)] // [WithFileCollection(nameof(InputImages), PixelTypes.Rgba32)]
public void InBox<TPixel>(TestImageProvider<TPixel> provider) // public void InBox<TPixel>(TestImageProvider<TPixel> provider)
where TPixel : unmanaged, IPixel<TPixel> // where TPixel : unmanaged, IPixel<TPixel>
{ // {
provider.Utility.TestGroupName = this.GetType().Name; // provider.Utility.TestGroupName = this.GetType().Name;
provider.RunRectangleConstrainedValidatingProcessorTest(this.Apply); // provider.RunRectangleConstrainedValidatingProcessorTest(this.Apply);
} // }
public static TheoryData<int> Replicas = new() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 }; public static TheoryData<int> Replicas = new() { 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 70, 71, 72, 73, 74, 75, 76, 77, 78, 79, 80, 81, 82, 83, 84, 85, 86, 87, 88, 89, 90, 91, 92, 93, 94, 95, 96, 97, 98, 99 };
[Theory] [Theory]
[WithTestPatternImages(nameof(Replicas), 70, 120, PixelTypes.Rgba32)] [WithTestPatternImages(nameof(Replicas), 70, 120, PixelTypes.Rgba32)]
public void WorksWithDiscoBuffers<TPixel>(TestImageProvider<TPixel> provider) public void WorksWithDiscoBuffers<TPixel>(TestImageProvider<TPixel> provider, int dummy)
where TPixel : unmanaged, IPixel<TPixel> where TPixel : unmanaged, IPixel<TPixel>
{ {
Assert.Equal(dummy * 2, dummy + dummy);
provider.RunBufferCapacityLimitProcessorTest(37, c => this.Apply(c, Color.DarkRed)); provider.RunBufferCapacityLimitProcessorTest(37, c => this.Apply(c, Color.DarkRed));
} }

22
tests/ImageSharp.Tests/Processing/Processors/Overlays/VignetteTest.cs

@ -17,4 +17,26 @@ namespace SixLabors.ImageSharp.Tests.Processing.Processors.Overlays
protected override void Apply(IImageProcessingContext ctx, Rectangle rect) => ctx.Vignette(rect); protected override void Apply(IImageProcessingContext ctx, Rectangle rect) => ctx.Vignette(rect);
} }
public class VignetteTest_00 : VignetteTest { }
public class VignetteTest_01 : VignetteTest { }
public class VignetteTest_02 : VignetteTest { }
public class VignetteTest_03 : VignetteTest { }
public class VignetteTest_04 : VignetteTest { }
public class VignetteTest_05 : VignetteTest { }
public class VignetteTest_06 : VignetteTest { }
public class VignetteTest_07 : VignetteTest { }
public class VignetteTest_08 : VignetteTest { }
public class VignetteTest_09 : VignetteTest { }
public class VignetteTest_10 : VignetteTest { }
public class VignetteTest_11 : VignetteTest { }
public class VignetteTest_12 : VignetteTest { }
public class VignetteTest_13 : VignetteTest { }
public class VignetteTest_14 : VignetteTest { }
public class VignetteTest_15 : VignetteTest { }
public class VignetteTest_16 : VignetteTest { }
public class VignetteTest_17 : VignetteTest { }
public class VignetteTest_18 : VignetteTest { }
public class VignetteTest_19 : VignetteTest { }
public class VignetteTest_20 : VignetteTest { }
} }

Loading…
Cancel
Save