Browse Source

moved ResizeProfilingBenchmarks

af/merge-core
Anton Firszov 9 years ago
parent
commit
2509d4138a
  1. 30
      tests/ImageSharp.Tests/Processors/Filters/ResizeProfilingBenchmarks.cs
  2. 26
      tests/ImageSharp.Tests/Processors/Filters/ResizeTests.cs

30
tests/ImageSharp.Tests/Processors/Filters/ResizeProfilingBenchmarks.cs

@ -0,0 +1,30 @@
namespace ImageSharp.Tests
{
using Xunit;
using Xunit.Abstractions;
public class ResizeProfilingBenchmarks : MeasureFixture
{
public ResizeProfilingBenchmarks(ITestOutputHelper output)
: base(output)
{
}
public int ExecutionCount { get; set; } = 50;
// [Theory] // Benchmark, enable manually!
[InlineData(100, 100)]
[InlineData(2000, 2000)]
public void ResizeBicubic(int width, int height)
{
this.Measure(this.ExecutionCount,
() =>
{
using (Image image = new Image(width, height))
{
image.Resize(width / 4, height / 4);
}
});
}
}
}

26
tests/ImageSharp.Tests/Processors/Filters/ResizeTests.cs

@ -8,32 +8,6 @@ namespace ImageSharp.Tests
using System.IO;
using Processing;
using Xunit;
using Xunit.Abstractions;
public class ResizeProfilingBenchmarks : MeasureFixture
{
public ResizeProfilingBenchmarks(ITestOutputHelper output)
: base(output)
{
}
public int ExecutionCount { get; set; } = 50;
[Theory]
[InlineData(100, 100)]
[InlineData(2000, 2000)]
public void ResizeBicubic(int width, int height)
{
this.Measure(this.ExecutionCount,
() =>
{
using (Image image = new Image(width, height))
{
image.Resize(width / 4, height / 4);
}
});
}
}
public class ResizeTests : FileTestBase
{

Loading…
Cancel
Save