Skip to content

Commit 93e4faa

Browse files
Merge pull request #1885 from SixLabors/bp/removeRunSerial
Remove RunSerial from tests
2 parents ca8e984 + edf7014 commit 93e4faa

18 files changed

+35
-52
lines changed

tests/ImageSharp.Tests/Formats/Bmp/BmpDecoderTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@
1919
// ReSharper disable InconsistentNaming
2020
namespace SixLabors.ImageSharp.Tests.Formats.Bmp
2121
{
22-
[Collection("RunSerial")]
2322
[Trait("Format", "Bmp")]
2423
public class BmpDecoderTests
2524
{

tests/ImageSharp.Tests/Formats/Bmp/BmpEncoderTests.cs

+3-4
Original file line numberDiff line numberDiff line change
@@ -17,27 +17,26 @@
1717
// ReSharper disable InconsistentNaming
1818
namespace SixLabors.ImageSharp.Tests.Formats.Bmp
1919
{
20-
[Collection("RunSerial")]
2120
[Trait("Format", "Bmp")]
2221
public class BmpEncoderTests
2322
{
2423
public static readonly TheoryData<BmpBitsPerPixel> BitsPerPixel =
25-
new TheoryData<BmpBitsPerPixel>
24+
new()
2625
{
2726
BmpBitsPerPixel.Pixel24,
2827
BmpBitsPerPixel.Pixel32
2928
};
3029

3130
public static readonly TheoryData<string, int, int, PixelResolutionUnit> RatioFiles =
32-
new TheoryData<string, int, int, PixelResolutionUnit>
31+
new()
3332
{
3433
{ Car, 3780, 3780, PixelResolutionUnit.PixelsPerMeter },
3534
{ V5Header, 3780, 3780, PixelResolutionUnit.PixelsPerMeter },
3635
{ RLE8, 2835, 2835, PixelResolutionUnit.PixelsPerMeter }
3736
};
3837

3938
public static readonly TheoryData<string, BmpBitsPerPixel> BmpBitsPerPixelFiles =
40-
new TheoryData<string, BmpBitsPerPixel>
39+
new()
4140
{
4241
{ Bit1, BmpBitsPerPixel.Pixel1 },
4342
{ Bit4, BmpBitsPerPixel.Pixel4 },

tests/ImageSharp.Tests/Formats/GeneralFormatTests.cs

+3-5
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,13 @@
88
using System.Reflection;
99
using SixLabors.ImageSharp.Formats;
1010
using SixLabors.ImageSharp.Formats.Png;
11-
using SixLabors.ImageSharp.Memory;
1211
using SixLabors.ImageSharp.PixelFormats;
1312
using SixLabors.ImageSharp.Processing;
1413
using SixLabors.ImageSharp.Processing.Processors.Quantization;
1514
using Xunit;
1615

1716
namespace SixLabors.ImageSharp.Tests.Formats
1817
{
19-
[Collection("RunSerial")]
2018
public class GeneralFormatTests
2119
{
2220
/// <summary>
@@ -34,7 +32,7 @@ public class GeneralFormatTests
3432
/// <summary>
3533
/// The collection of image files to test against.
3634
/// </summary>
37-
protected static readonly List<TestFile> Files = new List<TestFile>
35+
protected static readonly List<TestFile> Files = new()
3836
{
3937
TestFile.Create(TestImages.Jpeg.Baseline.Calliphora),
4038
TestFile.Create(TestImages.Bmp.Car),
@@ -85,8 +83,8 @@ public void DecodeThenEncodeImageFromStreamShouldSucceed()
8583
}
8684

8785
public static readonly TheoryData<string> QuantizerNames =
88-
new TheoryData<string>
89-
{
86+
new()
87+
{
9088
nameof(KnownQuantizers.Octree),
9189
nameof(KnownQuantizers.WebSafe),
9290
nameof(KnownQuantizers.Werner),

tests/ImageSharp.Tests/Formats/Gif/GifDecoderTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,13 +17,12 @@
1717
// ReSharper disable InconsistentNaming
1818
namespace SixLabors.ImageSharp.Tests.Formats.Gif
1919
{
20-
[Collection("RunSerial")]
2120
[Trait("Format", "Gif")]
2221
public class GifDecoderTests
2322
{
2423
private const PixelTypes TestPixelTypes = PixelTypes.Rgba32 | PixelTypes.RgbaVector | PixelTypes.Argb32;
2524

26-
private static GifDecoder GifDecoder => new GifDecoder();
25+
private static GifDecoder GifDecoder => new();
2726

2827
public static readonly string[] MultiFrameTestFiles =
2928
{

tests/ImageSharp.Tests/Formats/Gif/GifEncoderTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,15 +13,14 @@
1313
// ReSharper disable InconsistentNaming
1414
namespace SixLabors.ImageSharp.Tests.Formats.Gif
1515
{
16-
[Collection("RunSerial")]
1716
[Trait("Format", "Gif")]
1817
public class GifEncoderTests
1918
{
2019
private const PixelTypes TestPixelTypes = PixelTypes.Rgba32 | PixelTypes.RgbaVector | PixelTypes.Argb32;
2120
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.0015F);
2221

2322
public static readonly TheoryData<string, int, int, PixelResolutionUnit> RatioFiles =
24-
new TheoryData<string, int, int, PixelResolutionUnit>
23+
new()
2524
{
2625
{ TestImages.Gif.Rings, (int)ImageMetadata.DefaultHorizontalResolution, (int)ImageMetadata.DefaultVerticalResolution, PixelResolutionUnit.PixelsPerInch },
2726
{ TestImages.Gif.Ratio1x4, 1, 4, PixelResolutionUnit.AspectRatio },

tests/ImageSharp.Tests/Formats/Gif/GifMetadataTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -12,20 +12,19 @@
1212

1313
namespace SixLabors.ImageSharp.Tests.Formats.Gif
1414
{
15-
[Collection("RunSerial")]
1615
[Trait("Format", "Gif")]
1716
public class GifMetadataTests
1817
{
1918
public static readonly TheoryData<string, int, int, PixelResolutionUnit> RatioFiles =
20-
new TheoryData<string, int, int, PixelResolutionUnit>
19+
new()
2120
{
2221
{ TestImages.Gif.Rings, (int)ImageMetadata.DefaultHorizontalResolution, (int)ImageMetadata.DefaultVerticalResolution, PixelResolutionUnit.PixelsPerInch },
2322
{ TestImages.Gif.Ratio1x4, 1, 4, PixelResolutionUnit.AspectRatio },
2423
{ TestImages.Gif.Ratio4x1, 4, 1, PixelResolutionUnit.AspectRatio }
2524
};
2625

2726
public static readonly TheoryData<string, uint> RepeatFiles =
28-
new TheoryData<string, uint>
27+
new()
2928
{
3029
{ TestImages.Gif.Cheers, 0 },
3130
{ TestImages.Gif.Receipt, 1 },

tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,7 @@
2121
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
2222
{
2323
// TODO: Scatter test cases into multiple test classes
24-
[Collection("RunSerial")]
25-
[Trait("Format", "Jpg")]
24+
[Trait("Format", "Jpg")]
2625
public partial class JpegDecoderTests
2726
{
2827
public const PixelTypes CommonNonDefaultPixelTypes = PixelTypes.Rgba32 | PixelTypes.Argb32 | PixelTypes.Bgr24 | PixelTypes.RgbaVector;

tests/ImageSharp.Tests/Formats/Jpg/JpegEncoderTests.cs

+6-7
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,22 @@
1919

2020
namespace SixLabors.ImageSharp.Tests.Formats.Jpg
2121
{
22-
[Collection("RunSerial")]
2322
[Trait("Format", "Jpg")]
2423
public class JpegEncoderTests
2524
{
26-
private static JpegEncoder JpegEncoder => new JpegEncoder();
25+
private static JpegEncoder JpegEncoder => new();
2726

28-
private static JpegDecoder JpegDecoder => new JpegDecoder();
27+
private static JpegDecoder JpegDecoder => new();
2928

3029
public static readonly TheoryData<string, int> QualityFiles =
31-
new TheoryData<string, int>
30+
new()
3231
{
3332
{ TestImages.Jpeg.Baseline.Calliphora, 80 },
3433
{ TestImages.Jpeg.Progressive.Fb, 75 }
3534
};
3635

3736
public static readonly TheoryData<JpegColorType, int> BitsPerPixel_Quality =
38-
new TheoryData<JpegColorType, int>
37+
new()
3938
{
4039
{ JpegColorType.YCbCrRatio420, 40 },
4140
{ JpegColorType.YCbCrRatio420, 60 },
@@ -49,15 +48,15 @@ public class JpegEncoderTests
4948
};
5049

5150
public static readonly TheoryData<int> Grayscale_Quality =
52-
new TheoryData<int>
51+
new()
5352
{
5453
{ 40 },
5554
{ 60 },
5655
{ 100 }
5756
};
5857

5958
public static readonly TheoryData<string, int, int, PixelResolutionUnit> RatioFiles =
60-
new TheoryData<string, int, int, PixelResolutionUnit>
59+
new()
6160
{
6261
{ TestImages.Jpeg.Baseline.Ratio1x1, 1, 1, PixelResolutionUnit.AspectRatio },
6362
{ TestImages.Jpeg.Baseline.Snake, 300, 300, PixelResolutionUnit.PixelsPerInch },

tests/ImageSharp.Tests/Formats/Png/PngDecoderTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,12 @@
1616
// ReSharper disable InconsistentNaming
1717
namespace SixLabors.ImageSharp.Tests.Formats.Png
1818
{
19-
[Collection("RunSerial")]
2019
[Trait("Format", "Png")]
2120
public partial class PngDecoderTests
2221
{
2322
private const PixelTypes PixelTypes = Tests.PixelTypes.Rgba32 | Tests.PixelTypes.RgbaVector | Tests.PixelTypes.Argb32;
2423

25-
private static PngDecoder PngDecoder => new PngDecoder();
24+
private static PngDecoder PngDecoder => new();
2625

2726
public static readonly string[] CommonTestImages =
2827
{

tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs

+9-10
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,20 @@
1515

1616
namespace SixLabors.ImageSharp.Tests.Formats.Png
1717
{
18-
[Collection("RunSerial")]
1918
[Trait("Format", "Png")]
2019
public partial class PngEncoderTests
2120
{
22-
private static PngEncoder PngEncoder => new PngEncoder();
21+
private static PngEncoder PngEncoder => new();
2322

2423
public static readonly TheoryData<string, PngBitDepth> PngBitDepthFiles =
25-
new TheoryData<string, PngBitDepth>
24+
new()
2625
{
2726
{ TestImages.Png.Rgb48Bpp, PngBitDepth.Bit16 },
2827
{ TestImages.Png.Bpp1, PngBitDepth.Bit1 }
2928
};
3029

3130
public static readonly TheoryData<string, PngBitDepth, PngColorType> PngTrnsFiles =
32-
new TheoryData<string, PngBitDepth, PngColorType>
31+
new()
3332
{
3433
{ TestImages.Png.Gray1BitTrans, PngBitDepth.Bit1, PngColorType.Grayscale },
3534
{ TestImages.Png.Gray2BitTrans, PngBitDepth.Bit2, PngColorType.Grayscale },
@@ -43,15 +42,15 @@ public partial class PngEncoderTests
4342
/// <summary>
4443
/// All types except Palette
4544
/// </summary>
46-
public static readonly TheoryData<PngColorType> PngColorTypes = new TheoryData<PngColorType>
45+
public static readonly TheoryData<PngColorType> PngColorTypes = new()
4746
{
4847
PngColorType.RgbWithAlpha,
4948
PngColorType.Rgb,
5049
PngColorType.Grayscale,
5150
PngColorType.GrayscaleWithAlpha,
5251
};
5352

54-
public static readonly TheoryData<PngFilterMethod> PngFilterMethods = new TheoryData<PngFilterMethod>
53+
public static readonly TheoryData<PngFilterMethod> PngFilterMethods = new()
5554
{
5655
PngFilterMethod.None,
5756
PngFilterMethod.Sub,
@@ -65,7 +64,7 @@ public partial class PngEncoderTests
6564
/// All types except Palette
6665
/// </summary>
6766
public static readonly TheoryData<PngCompressionLevel> CompressionLevels
68-
= new TheoryData<PngCompressionLevel>
67+
= new()
6968
{
7069
PngCompressionLevel.Level0,
7170
PngCompressionLevel.Level1,
@@ -79,12 +78,12 @@ public static readonly TheoryData<PngCompressionLevel> CompressionLevels
7978
PngCompressionLevel.Level9,
8079
};
8180

82-
public static readonly TheoryData<int> PaletteSizes = new TheoryData<int>
81+
public static readonly TheoryData<int> PaletteSizes = new()
8382
{
8483
30, 55, 100, 201, 255
8584
};
8685

87-
public static readonly TheoryData<int> PaletteLargeOnly = new TheoryData<int>
86+
public static readonly TheoryData<int> PaletteLargeOnly = new()
8887
{
8988
80, 100, 120, 230
9089
};
@@ -96,7 +95,7 @@ public static readonly TheoryData<PngCompressionLevel> CompressionLevels
9695
};
9796

9897
public static readonly TheoryData<string, int, int, PixelResolutionUnit> RatioFiles =
99-
new TheoryData<string, int, int, PixelResolutionUnit>
98+
new()
10099
{
101100
{ TestImages.Png.Splash, 11810, 11810, PixelResolutionUnit.PixelsPerMeter },
102101
{ TestImages.Png.Ratio1x4, 1, 4, PixelResolutionUnit.AspectRatio },

tests/ImageSharp.Tests/Formats/Tga/TgaDecoderTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -15,11 +15,10 @@
1515
// ReSharper disable InconsistentNaming
1616
namespace SixLabors.ImageSharp.Tests.Formats.Tga
1717
{
18-
[Collection("RunSerial")]
1918
[Trait("Format", "Tga")]
2019
public class TgaDecoderTests
2120
{
22-
private static TgaDecoder TgaDecoder => new TgaDecoder();
21+
private static TgaDecoder TgaDecoder => new();
2322

2423
[Theory]
2524
[WithFile(Gray8BitTopLeft, PixelTypes.Rgba32)]

tests/ImageSharp.Tests/Formats/Tga/TgaEncoderTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -11,19 +11,18 @@
1111
// ReSharper disable InconsistentNaming
1212
namespace SixLabors.ImageSharp.Tests.Formats.Tga
1313
{
14-
[Collection("RunSerial")]
1514
[Trait("Format", "Tga")]
1615
public class TgaEncoderTests
1716
{
1817
public static readonly TheoryData<TgaBitsPerPixel> BitsPerPixel =
19-
new TheoryData<TgaBitsPerPixel>
18+
new()
2019
{
2120
TgaBitsPerPixel.Pixel24,
2221
TgaBitsPerPixel.Pixel32
2322
};
2423

2524
public static readonly TheoryData<string, TgaBitsPerPixel> TgaBitsPerPixelFiles =
26-
new TheoryData<string, TgaBitsPerPixel>
25+
new()
2726
{
2827
{ Gray8BitBottomLeft, TgaBitsPerPixel.Pixel8 },
2928
{ Bit16BottomLeft, TgaBitsPerPixel.Pixel16 },

tests/ImageSharp.Tests/Formats/Tiff/TiffDecoderTests.cs

+2-3
Original file line numberDiff line numberDiff line change
@@ -15,15 +15,14 @@
1515

1616
namespace SixLabors.ImageSharp.Tests.Formats.Tiff
1717
{
18-
[Collection("RunSerial")]
1918
[Trait("Format", "Tiff")]
2019
public class TiffDecoderTests
2120
{
2221
public static readonly string[] MultiframeTestImages = Multiframes;
2322

24-
private static TiffDecoder TiffDecoder => new TiffDecoder();
23+
private static TiffDecoder TiffDecoder => new();
2524

26-
private static MagickReferenceDecoder ReferenceDecoder => new MagickReferenceDecoder();
25+
private static MagickReferenceDecoder ReferenceDecoder => new();
2726

2827
[Theory]
2928
[WithFile(RgbUncompressedTiled, PixelTypes.Rgba32)]

tests/ImageSharp.Tests/Formats/Tiff/TiffEncoderTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace SixLabors.ImageSharp.Tests.Formats.Tiff
1313
{
14-
[Collection("RunSerial")]
1514
[Trait("Format", "Tiff")]
1615
public class TiffEncoderTests : TiffEncoderBaseTester
1716
{

tests/ImageSharp.Tests/Formats/Tiff/TiffMetadataTests.cs

+1-2
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,10 @@
1717

1818
namespace SixLabors.ImageSharp.Tests.Formats.Tiff
1919
{
20-
[Collection("RunSerial")]
2120
[Trait("Format", "Tiff")]
2221
public class TiffMetadataTests
2322
{
24-
private static TiffDecoder TiffDecoder => new TiffDecoder();
23+
private static TiffDecoder TiffDecoder => new();
2524

2625
private class NumberComparer : IEqualityComparer<Number>
2726
{

tests/ImageSharp.Tests/Formats/WebP/WebpDecoderTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
// ReSharper disable InconsistentNaming
1313
namespace SixLabors.ImageSharp.Tests.Formats.Webp
1414
{
15-
[Collection("RunSerial")]
1615
[Trait("Format", "Webp")]
1716
public class WebpDecoderTests
1817
{

tests/ImageSharp.Tests/Formats/WebP/WebpEncoderTests.cs

-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@
1111

1212
namespace SixLabors.ImageSharp.Tests.Formats.Webp
1313
{
14-
[Collection("RunSerial")]
1514
[Trait("Format", "Webp")]
1615
public class WebpEncoderTests
1716
{

tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs

+2-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) Six Labors.
1+
// Copyright (c) Six Labors.
22
// Licensed under the Apache License, Version 2.0.
33

44
using System;
@@ -310,6 +310,7 @@ private static void AllocateGroupAndForget(UniformUnmanagedMemoryPoolMemoryAlloc
310310
}
311311
}
312312

313+
[ActiveIssue("https://github.com/SixLabors/ImageSharp/issues/1887", TestPlatforms.OSX)]
313314
[Theory]
314315
[InlineData(300)] // Group of single SharedArrayPoolBuffer<T>
315316
[InlineData(600)] // Group of single UniformUnmanagedMemoryPool buffer

0 commit comments

Comments
 (0)