Browse Source

build and testrunning fix

af/merge-core
Anton Firszov 9 years ago
parent
commit
74f853a55b
  1. 3
      src/ImageSharp/Common/Memory/PixelDataPool{T}.cs
  2. 11
      tests/ImageSharp.Tests/Colors/BulkPixelOperationsTests.cs

3
src/ImageSharp/Common/Memory/PixelDataPool{T}.cs

@ -46,7 +46,8 @@ namespace ImageSharp
/// <returns>The maxArrayLength value</returns>
internal static int CalculateMaxArrayLength()
{
if (typeof(IPixel).IsAssignableFrom(typeof(T)))
// ReSharper disable once SuspiciousTypeConversion.Global
if (default(T) is IPixel)
{
const int MaximumExpectedImageSize = 16384;
return MaximumExpectedImageSize * MaximumExpectedImageSize;

11
tests/ImageSharp.Tests/Colors/BulkPixelOperationsTests.cs

@ -9,22 +9,21 @@
{
public class Color : BulkPixelOperationsTests<ImageSharp.Color>
{
// MemberData does not work without redeclaring the public field in the derived test class:
public static TheoryData<int> ArraySizesData = new TheoryData<int> { 7, 16, 1111 };
// For 4.6 test runner MemberData does not work without redeclaring the public field in the derived test class:
public static new TheoryData<int> ArraySizesData => new TheoryData<int> { 7, 16, 1111 };
}
public class Argb : BulkPixelOperationsTests<ImageSharp.Argb>
{
// MemberData does not work without redeclaring the public field in the derived test class:
public static TheoryData<int> ArraySizesData = new TheoryData<int> { 7, 16, 1111 };
// For 4.6 test runner MemberData does not work without redeclaring the public field in the derived test class:
public static new TheoryData<int> ArraySizesData => new TheoryData<int> { 7, 16, 1111 };
}
}
public abstract class BulkPixelOperationsTests<TColor>
where TColor : struct, IPixel<TColor>
{
// The field is private so it can be safely redeclared in inherited non-abstract test classes.
private static TheoryData<int> ArraySizesData = new TheoryData<int> { 7, 16, 1111 };
public static TheoryData<int> ArraySizesData => new TheoryData<int> { 7, 16, 1111 };
[Theory]
[MemberData(nameof(ArraySizesData))]

Loading…
Cancel
Save