Browse Source

Migrate tests from xUnit v2 to xUnit.v3 3.2.2

Breaking changes addressed:
- Update xunit.v3 to 3.2.2 and xunit.runner.visualstudio to 3.1.5
- Remove Microsoft.DotNet.XUnitExtensions (conflicts with xunit.v3 via xunit.core v2)
- Replace ConditionalFact/ConditionalTheory with Fact/Theory SkipUnless/SkipWhen/SkipType
- Remove 'using Xunit.Abstractions' (ITestOutputHelper now in Xunit namespace globally)
- Fix TestFrameworkAttribute: string args → typeof(T) form
- Fix XunitTestFramework ctor: no longer takes IMessageSink
- Fix BeforeAfterTestAttribute Before/After: added IXunitTest parameter, use Xunit.v3 ns
- Fix DataAttribute: new GetData signature (DisposalTracker), add SupportsDiscoveryEnumeration()
- Fix IXunitSerializable/IXunitSerializationInfo: add 'using Xunit.Sdk' to all consumers
- Fix BasicSerializer: implement new IXunitSerializationInfo.GetValue(string) returning object?
  Store type info in dump format (key:TypeAQN:value) to enable typed reconstruction
- Fix TheoryData<T> CS0121 ambiguity on C# 12/net8.0: add explicit casts (T)value
  Affects ExifValuesTests, PixelOperationsTests, QuantizerTests, DitherTests,
  TestImageProviderTests, RotateTests, L8Tests, La16Tests
- Fix PngEncoderTests: TheoryData<T> now yields TheoryDataRow<T>, not object[]
pull/2854/head
Stefan Nikolei 2 months ago
parent
commit
67a94113e4
  1. 1
      tests/Directory.Build.targets
  2. 1
      tests/ImageSharp.Tests.ProfilingSandbox/Program.cs
  3. 1
      tests/ImageSharp.Tests/ColorProfiles/Icc/ColorProfileConverterTests.Icc.cs
  4. 1
      tests/ImageSharp.Tests/Common/NumericsTests.cs
  5. 1
      tests/ImageSharp.Tests/Common/SimdUtilsTests.cs
  6. 1
      tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs
  7. 1
      tests/ImageSharp.Tests/Formats/Jpg/Block8x8Tests.cs
  8. 1
      tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs
  9. 1
      tests/ImageSharp.Tests/Formats/Jpg/HuffmanScanEncoderTests.cs
  10. 1
      tests/ImageSharp.Tests/Formats/Jpg/JpegColorConverterTests.cs
  11. 1
      tests/ImageSharp.Tests/Formats/Jpg/JpegDecoderTests.cs
  12. 1
      tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs
  13. 1
      tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.AccurateDCT.cs
  14. 1
      tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.FastFloatingPointDCT.cs
  15. 1
      tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.StandardIntegerDCT.cs
  16. 1
      tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs
  17. 1
      tests/ImageSharp.Tests/Formats/Jpg/SpectralJpegTests.cs
  18. 1
      tests/ImageSharp.Tests/Formats/Jpg/SpectralToPixelConversionTests.cs
  19. 1
      tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs
  20. 1
      tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs
  21. 1
      tests/ImageSharp.Tests/Formats/Jpg/Utils/VerifyJpeg.cs
  22. 1
      tests/ImageSharp.Tests/Formats/Png/PngEncoderFilterTests.cs
  23. 8
      tests/ImageSharp.Tests/Formats/Png/PngEncoderTests.cs
  24. 1
      tests/ImageSharp.Tests/Helpers/ParallelRowIteratorTests.cs
  25. 2
      tests/ImageSharp.Tests/Image/ImageTests.Decode_Cancellation.cs
  26. 1
      tests/ImageSharp.Tests/ImageSharp.Tests.csproj
  27. 2
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs
  28. 3
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs
  29. 2
      tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedPoolMemoryAllocatorTests.cs
  30. 502
      tests/ImageSharp.Tests/Metadata/Profiles/Exif/Values/ExifValuesTests.cs
  31. 2
      tests/ImageSharp.Tests/PixelFormats/L8Tests.cs
  32. 2
      tests/ImageSharp.Tests/PixelFormats/La16Tests.cs
  33. 1
      tests/ImageSharp.Tests/PixelFormats/PixelOperations/Generated/PixelOperationsTests.Specialized.Generated.cs
  34. 59
      tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs
  35. 2
      tests/ImageSharp.Tests/Processing/Processors/Convolution/BokehBlurTest.cs
  36. 4
      tests/ImageSharp.Tests/Processing/Processors/Dithering/DitherTests.cs
  37. 126
      tests/ImageSharp.Tests/Processing/Processors/Quantization/QuantizerTests.cs
  38. 1
      tests/ImageSharp.Tests/Processing/Processors/Transforms/AffineTransformTests.cs
  39. 1
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ProjectiveTransformTests.cs
  40. 1
      tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeKernelMapTests.cs
  41. 2
      tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs
  42. 1
      tests/ImageSharp.Tests/ProfilingBenchmarks/LoadResizeSaveProfilingBenchmarks.cs
  43. 1
      tests/ImageSharp.Tests/ProfilingBenchmarks/ResizeProfilingBenchmarks.cs
  44. 14
      tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs
  45. 44
      tests/ImageSharp.Tests/TestUtilities/BasicSerializer.cs
  46. 2
      tests/ImageSharp.Tests/TestUtilities/FeatureTesting/FeatureTestRunner.cs
  47. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/BasicTestPatternProvider.cs
  48. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs
  49. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs
  50. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs
  51. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs
  52. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs
  53. 2
      tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs
  54. 1
      tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs
  55. 14
      tests/ImageSharp.Tests/TestUtilities/SixLaborsXunitTestFramework.cs
  56. 2
      tests/ImageSharp.Tests/TestUtilities/TestPixel.cs
  57. 3
      tests/ImageSharp.Tests/TestUtilities/TestType.cs
  58. 2
      tests/ImageSharp.Tests/TestUtilities/TestVector4.cs
  59. 2
      tests/ImageSharp.Tests/TestUtilities/Tests/BasicSerializerTests.cs
  60. 2
      tests/ImageSharp.Tests/TestUtilities/Tests/FeatureTestRunnerTests.cs
  61. 1
      tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs
  62. 1
      tests/ImageSharp.Tests/TestUtilities/Tests/MagickReferenceCodecTests.cs
  63. 1
      tests/ImageSharp.Tests/TestUtilities/Tests/ReferenceDecoderBenchmarks.cs
  64. 1
      tests/ImageSharp.Tests/TestUtilities/Tests/SystemDrawingReferenceCodecTests.cs
  65. 3
      tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs
  66. 9
      tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs
  67. 1
      tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs
  68. 6
      tests/ImageSharp.Tests/ValidateDisposedMemoryAllocationsAttribute.cs

1
tests/Directory.Build.targets

@ -21,7 +21,6 @@
<PackageReference Update="Colourful" Version="3.2.0" />
<PackageReference Update="Magick.NET-Q16-AnyCPU" Version="14.11.1" />
<PackageReference Update="Microsoft.DotNet.RemoteExecutor" Version="10.0.0-beta.25563.105" />
<PackageReference Update="Microsoft.DotNet.XUnitExtensions" Version="8.0.0-beta.23580.1" />
<PackageReference Update="Moq" Version="4.20.72" />
<PackageReference Update="NetVips" Version="3.0.0" />
<PackageReference Update="NetVips.Native" Version="8.16.0" />

1
tests/ImageSharp.Tests.ProfilingSandbox/Program.cs

@ -4,7 +4,6 @@
using SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations;
using SixLabors.ImageSharp.Tests.ProfilingBenchmarks;
using SixLabors.ImageSharp.Tests.ProfilingSandbox;
using Xunit.Abstractions;
// in this file, comments are used for disabling stuff for local execution
#pragma warning disable SA1515

1
tests/ImageSharp.Tests/ColorProfiles/Icc/ColorProfileConverterTests.Icc.cs

@ -6,7 +6,6 @@ using SixLabors.ImageSharp.ColorProfiles;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using Wacton.Unicolour;
using Wacton.Unicolour.Icc;
using Xunit.Abstractions;
using Rgb = SixLabors.ImageSharp.ColorProfiles.Rgb;
namespace SixLabors.ImageSharp.Tests.ColorProfiles.Icc;

1
tests/ImageSharp.Tests/Common/NumericsTests.cs

@ -1,7 +1,6 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Common;

1
tests/ImageSharp.Tests/Common/SimdUtilsTests.cs

@ -7,7 +7,6 @@ using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Common;

1
tests/ImageSharp.Tests/Formats/Jpg/Block8x8FTests.cs

@ -7,7 +7,6 @@ using System.Runtime.Intrinsics;
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/Block8x8Tests.cs

@ -4,7 +4,6 @@
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/DCTTests.cs

@ -4,7 +4,6 @@
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/HuffmanScanEncoderTests.cs

@ -2,7 +2,6 @@
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.Formats.Jpeg.Components.Encoder;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/JpegColorConverterTests.cs

@ -6,7 +6,6 @@ using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Tests.ColorProfiles;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

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

@ -9,7 +9,6 @@ using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/ParseStreamTests.cs

@ -6,7 +6,6 @@ using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.AccurateDCT.cs

@ -3,7 +3,6 @@
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.FastFloatingPointDCT.cs

@ -4,7 +4,6 @@
// ReSharper disable InconsistentNaming
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.StandardIntegerDCT.cs

@ -3,7 +3,6 @@
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/ReferenceImplementationsTests.cs

@ -1,7 +1,6 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/SpectralJpegTests.cs

@ -9,7 +9,6 @@ using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Metadata.Profiles.Icc;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/SpectralToPixelConversionTests.cs

@ -7,7 +7,6 @@ using SixLabors.ImageSharp.IO;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg;

1
tests/ImageSharp.Tests/Formats/Jpg/Utils/JpegFixture.cs

@ -6,7 +6,6 @@ using System.Text;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;

1
tests/ImageSharp.Tests/Formats/Jpg/Utils/ReferenceImplementations.LLM_FloatingPoint_DCT.cs

@ -5,7 +5,6 @@ using System.Numerics;
using System.Runtime.CompilerServices;
using SixLabors.ImageSharp.Formats.Jpeg.Components;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;

1
tests/ImageSharp.Tests/Formats/Jpg/Utils/VerifyJpeg.cs

@ -3,7 +3,6 @@
using SixLabors.ImageSharp.Formats.Jpeg.Components.Decoder;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Jpg.Utils;

1
tests/ImageSharp.Tests/Formats/Png/PngEncoderFilterTests.cs

@ -6,7 +6,6 @@
using SixLabors.ImageSharp.Formats.Png;
using SixLabors.ImageSharp.Formats.Png.Filters;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Formats.Png;

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

@ -200,14 +200,14 @@ public partial class PngEncoderTests
return;
}
foreach (object[] filterMethod in PngFilterMethods)
foreach (TheoryDataRow<PngFilterMethod> filterMethod in PngFilterMethods)
{
foreach (PngInterlaceMode interlaceMode in InterlaceMode)
{
TestPngEncoderCore(
provider,
pngColorType,
(PngFilterMethod)filterMethod[0],
filterMethod.Data,
pngBitDepth,
interlaceMode,
appendPngColorType: true,
@ -236,14 +236,14 @@ public partial class PngEncoderTests
public void WorksWithAllBitDepthsAndExcludeAllFilter<TPixel>(TestImageProvider<TPixel> provider, PngColorType pngColorType, PngBitDepth pngBitDepth)
where TPixel : unmanaged, IPixel<TPixel>
{
foreach (object[] filterMethod in PngFilterMethods)
foreach (TheoryDataRow<PngFilterMethod> filterMethod in PngFilterMethods)
{
foreach (PngInterlaceMode interlaceMode in InterlaceMode)
{
TestPngEncoderCore(
provider,
pngColorType,
(PngFilterMethod)filterMethod[0],
filterMethod.Data,
pngBitDepth,
interlaceMode,
appendPngColorType: true,

1
tests/ImageSharp.Tests/Helpers/ParallelRowIteratorTests.cs

@ -7,7 +7,6 @@ using Castle.Core.Configuration;
using SixLabors.ImageSharp.Advanced;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Helpers;

2
tests/ImageSharp.Tests/Image/ImageTests.Decode_Cancellation.cs

@ -58,7 +58,7 @@ public partial class ImageTests
public static TheoryData<bool, string, double> LoadData { get; } = CreateLoadData();
// TODO: Figure out cancellation failures on Linux
[ConditionalTheory(typeof(TestEnvironment), nameof(TestEnvironment.IsWindows))]
[Theory(SkipType = typeof(TestEnvironment), SkipUnless = nameof(TestEnvironment.IsWindows))]
[MemberData(nameof(LoadData))]
public async Task LoadAsync_IsCancellable(bool useMemoryStream, string file, double percentageOfStreamReadToCancel)
{

1
tests/ImageSharp.Tests/ImageSharp.Tests.csproj

@ -45,7 +45,6 @@
<PackageReference Include="BenchmarkDotNet" Version="0.13.0" />
<PackageReference Include="Magick.NET-Q16-AnyCPU" />
<PackageReference Include="Microsoft.DotNet.RemoteExecutor" />
<PackageReference Include="Microsoft.DotNet.XUnitExtensions" />
<PackageReference Include="Moq" />
<PackageReference Include="runtime.osx.10.10-x64.CoreCompat.System.Drawing" Condition="'$(IsOSX)'=='true'" />
<PackageReference Include="SharpZipLib" />

2
tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.Trim.cs

@ -57,7 +57,7 @@ public partial class UniformUnmanagedMemoryPoolTests
// TODO: Investigate failures on macOS. All handles are released after GC.
// (It seems to happen more consistently on .NET 6.)
[ConditionalFact(nameof(IsNotMacOS))]
[Fact(SkipUnless = nameof(IsNotMacOS))]
public void MultiplePoolInstances_TrimPeriodElapsed_AllAreTrimmed()
{
if (!TestEnvironment.RunsOnCI)

3
tests/ImageSharp.Tests/Memory/Allocators/UniformUnmanagedMemoryPoolTests.cs

@ -5,7 +5,6 @@ using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Microsoft.DotNet.RemoteExecutor;
using SixLabors.ImageSharp.Memory.Internals;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Memory.Allocators;
@ -241,7 +240,7 @@ public partial class UniformUnmanagedMemoryPoolTests
public static readonly bool IsNotMacOS = !TestEnvironment.IsMacOS;
// TODO: Investigate macOS failures
[ConditionalTheory(nameof(IsNotMacOS))]
[Theory(SkipUnless = nameof(IsNotMacOS))]
[InlineData(false)]
[InlineData(true)]
public void RentReturnRelease_SubsequentRentReturnsDifferentHandles(bool multiple)

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

@ -584,7 +584,7 @@ public class UniformUnmanagedPoolMemoryAllocatorTests
}
}
[ConditionalFact(typeof(Environment), nameof(Environment.Is64BitProcess))]
[Fact(SkipType = typeof(Environment), SkipUnless = nameof(Environment.Is64BitProcess))]
public void MemoryAllocator_Create_SetHighLimit()
{
RemoteExecutor.Invoke(RunTest).Dispose();

502
tests/ImageSharp.Tests/Metadata/Profiles/Exif/Values/ExifValuesTests.cs

@ -11,329 +11,329 @@ public class ExifValuesTests
{
public static TheoryData<ExifTag> ByteTags => new()
{
{ ExifTag.FaxProfile },
{ ExifTag.ModeNumber },
{ ExifTag.GPSAltitudeRef }
{ (ExifTag)ExifTag.FaxProfile },
{ (ExifTag)ExifTag.ModeNumber },
{ (ExifTag)ExifTag.GPSAltitudeRef }
};
public static TheoryData<ExifTag> ByteArrayTags => new()
{
{ ExifTag.ClipPath },
{ ExifTag.VersionYear },
{ ExifTag.XMP },
{ ExifTag.CFAPattern2 },
{ ExifTag.TIFFEPStandardID },
{ ExifTag.GPSVersionID },
{ (ExifTag)ExifTag.ClipPath },
{ (ExifTag)ExifTag.VersionYear },
{ (ExifTag)ExifTag.XMP },
{ (ExifTag)ExifTag.CFAPattern2 },
{ (ExifTag)ExifTag.TIFFEPStandardID },
{ (ExifTag)ExifTag.GPSVersionID },
};
public static TheoryData<ExifTag> DoubleArrayTags => new()
{
{ ExifTag.PixelScale },
{ ExifTag.IntergraphMatrix },
{ ExifTag.ModelTiePoint },
{ ExifTag.ModelTransform }
{ (ExifTag)ExifTag.PixelScale },
{ (ExifTag)ExifTag.IntergraphMatrix },
{ (ExifTag)ExifTag.ModelTiePoint },
{ (ExifTag)ExifTag.ModelTransform }
};
public static TheoryData<ExifTag> LongTags => new()
{
{ ExifTag.SubfileType },
{ ExifTag.SubIFDOffset },
{ ExifTag.GPSIFDOffset },
{ ExifTag.T4Options },
{ ExifTag.T6Options },
{ ExifTag.XClipPathUnits },
{ ExifTag.YClipPathUnits },
{ ExifTag.ProfileType },
{ ExifTag.CodingMethods },
{ ExifTag.T82ptions },
{ ExifTag.JPEGInterchangeFormat },
{ ExifTag.JPEGInterchangeFormatLength },
{ ExifTag.MDFileTag },
{ ExifTag.StandardOutputSensitivity },
{ ExifTag.RecommendedExposureIndex },
{ ExifTag.ISOSpeed },
{ ExifTag.ISOSpeedLatitudeyyy },
{ ExifTag.ISOSpeedLatitudezzz },
{ ExifTag.FaxRecvParams },
{ ExifTag.FaxRecvTime },
{ ExifTag.ImageNumber },
{ (ExifTag)ExifTag.SubfileType },
{ (ExifTag)ExifTag.SubIFDOffset },
{ (ExifTag)ExifTag.GPSIFDOffset },
{ (ExifTag)ExifTag.T4Options },
{ (ExifTag)ExifTag.T6Options },
{ (ExifTag)ExifTag.XClipPathUnits },
{ (ExifTag)ExifTag.YClipPathUnits },
{ (ExifTag)ExifTag.ProfileType },
{ (ExifTag)ExifTag.CodingMethods },
{ (ExifTag)ExifTag.T82ptions },
{ (ExifTag)ExifTag.JPEGInterchangeFormat },
{ (ExifTag)ExifTag.JPEGInterchangeFormatLength },
{ (ExifTag)ExifTag.MDFileTag },
{ (ExifTag)ExifTag.StandardOutputSensitivity },
{ (ExifTag)ExifTag.RecommendedExposureIndex },
{ (ExifTag)ExifTag.ISOSpeed },
{ (ExifTag)ExifTag.ISOSpeedLatitudeyyy },
{ (ExifTag)ExifTag.ISOSpeedLatitudezzz },
{ (ExifTag)ExifTag.FaxRecvParams },
{ (ExifTag)ExifTag.FaxRecvTime },
{ (ExifTag)ExifTag.ImageNumber },
};
public static TheoryData<ExifTag> LongArrayTags => new()
{
{ ExifTag.FreeOffsets },
{ ExifTag.FreeByteCounts },
{ ExifTag.ColorResponseUnit },
{ ExifTag.SMinSampleValue },
{ ExifTag.SMaxSampleValue },
{ ExifTag.JPEGQTables },
{ ExifTag.JPEGDCTables },
{ ExifTag.JPEGACTables },
{ ExifTag.StripRowCounts },
{ ExifTag.IntergraphRegisters }
{ (ExifTag)ExifTag.FreeOffsets },
{ (ExifTag)ExifTag.FreeByteCounts },
{ (ExifTag)ExifTag.ColorResponseUnit },
{ (ExifTag)ExifTag.SMinSampleValue },
{ (ExifTag)ExifTag.SMaxSampleValue },
{ (ExifTag)ExifTag.JPEGQTables },
{ (ExifTag)ExifTag.JPEGDCTables },
{ (ExifTag)ExifTag.JPEGACTables },
{ (ExifTag)ExifTag.StripRowCounts },
{ (ExifTag)ExifTag.IntergraphRegisters }
};
public static TheoryData<ExifTag> NumberTags => new()
{
{ ExifTag.ImageWidth },
{ ExifTag.ImageLength },
{ ExifTag.TileWidth },
{ ExifTag.TileLength },
{ ExifTag.BadFaxLines },
{ ExifTag.ConsecutiveBadFaxLines },
{ ExifTag.PixelXDimension },
{ ExifTag.PixelYDimension }
{ (ExifTag)ExifTag.ImageWidth },
{ (ExifTag)ExifTag.ImageLength },
{ (ExifTag)ExifTag.TileWidth },
{ (ExifTag)ExifTag.TileLength },
{ (ExifTag)ExifTag.BadFaxLines },
{ (ExifTag)ExifTag.ConsecutiveBadFaxLines },
{ (ExifTag)ExifTag.PixelXDimension },
{ (ExifTag)ExifTag.PixelYDimension }
};
public static TheoryData<ExifTag> NumberArrayTags => new()
{
{ ExifTag.StripOffsets },
{ ExifTag.StripByteCounts },
{ ExifTag.TileByteCounts },
{ ExifTag.TileOffsets },
{ ExifTag.ImageLayer }
{ (ExifTag)ExifTag.StripOffsets },
{ (ExifTag)ExifTag.StripByteCounts },
{ (ExifTag)ExifTag.TileByteCounts },
{ (ExifTag)ExifTag.TileOffsets },
{ (ExifTag)ExifTag.ImageLayer }
};
public static TheoryData<ExifTag> RationalTags => new()
{
{ ExifTag.XPosition },
{ ExifTag.YPosition },
{ ExifTag.XResolution },
{ ExifTag.YResolution },
{ ExifTag.BatteryLevel },
{ ExifTag.ExposureTime },
{ ExifTag.FNumber },
{ ExifTag.MDScalePixel },
{ ExifTag.CompressedBitsPerPixel },
{ ExifTag.ApertureValue },
{ ExifTag.MaxApertureValue },
{ ExifTag.SubjectDistance },
{ ExifTag.FocalLength },
{ ExifTag.FlashEnergy2 },
{ ExifTag.FocalPlaneXResolution2 },
{ ExifTag.FocalPlaneYResolution2 },
{ ExifTag.ExposureIndex2 },
{ ExifTag.Humidity },
{ ExifTag.Pressure },
{ ExifTag.Acceleration },
{ ExifTag.FlashEnergy },
{ ExifTag.FocalPlaneXResolution },
{ ExifTag.FocalPlaneYResolution },
{ ExifTag.ExposureIndex },
{ ExifTag.DigitalZoomRatio },
{ ExifTag.GPSAltitude },
{ ExifTag.GPSDOP },
{ ExifTag.GPSSpeed },
{ ExifTag.GPSTrack },
{ ExifTag.GPSImgDirection },
{ ExifTag.GPSDestBearing },
{ ExifTag.GPSDestDistance },
{ ExifTag.GPSHPositioningError },
{ (ExifTag)ExifTag.XPosition },
{ (ExifTag)ExifTag.YPosition },
{ (ExifTag)ExifTag.XResolution },
{ (ExifTag)ExifTag.YResolution },
{ (ExifTag)ExifTag.BatteryLevel },
{ (ExifTag)ExifTag.ExposureTime },
{ (ExifTag)ExifTag.FNumber },
{ (ExifTag)ExifTag.MDScalePixel },
{ (ExifTag)ExifTag.CompressedBitsPerPixel },
{ (ExifTag)ExifTag.ApertureValue },
{ (ExifTag)ExifTag.MaxApertureValue },
{ (ExifTag)ExifTag.SubjectDistance },
{ (ExifTag)ExifTag.FocalLength },
{ (ExifTag)ExifTag.FlashEnergy2 },
{ (ExifTag)ExifTag.FocalPlaneXResolution2 },
{ (ExifTag)ExifTag.FocalPlaneYResolution2 },
{ (ExifTag)ExifTag.ExposureIndex2 },
{ (ExifTag)ExifTag.Humidity },
{ (ExifTag)ExifTag.Pressure },
{ (ExifTag)ExifTag.Acceleration },
{ (ExifTag)ExifTag.FlashEnergy },
{ (ExifTag)ExifTag.FocalPlaneXResolution },
{ (ExifTag)ExifTag.FocalPlaneYResolution },
{ (ExifTag)ExifTag.ExposureIndex },
{ (ExifTag)ExifTag.DigitalZoomRatio },
{ (ExifTag)ExifTag.GPSAltitude },
{ (ExifTag)ExifTag.GPSDOP },
{ (ExifTag)ExifTag.GPSSpeed },
{ (ExifTag)ExifTag.GPSTrack },
{ (ExifTag)ExifTag.GPSImgDirection },
{ (ExifTag)ExifTag.GPSDestBearing },
{ (ExifTag)ExifTag.GPSDestDistance },
{ (ExifTag)ExifTag.GPSHPositioningError },
};
public static TheoryData<ExifTag> RationalArrayTags => new()
{
{ ExifTag.WhitePoint },
{ ExifTag.PrimaryChromaticities },
{ ExifTag.YCbCrCoefficients },
{ ExifTag.ReferenceBlackWhite },
{ ExifTag.GPSLatitude },
{ ExifTag.GPSLongitude },
{ ExifTag.GPSTimestamp },
{ ExifTag.GPSDestLatitude },
{ ExifTag.GPSDestLongitude },
{ ExifTag.LensSpecification }
{ (ExifTag)ExifTag.WhitePoint },
{ (ExifTag)ExifTag.PrimaryChromaticities },
{ (ExifTag)ExifTag.YCbCrCoefficients },
{ (ExifTag)ExifTag.ReferenceBlackWhite },
{ (ExifTag)ExifTag.GPSLatitude },
{ (ExifTag)ExifTag.GPSLongitude },
{ (ExifTag)ExifTag.GPSTimestamp },
{ (ExifTag)ExifTag.GPSDestLatitude },
{ (ExifTag)ExifTag.GPSDestLongitude },
{ (ExifTag)ExifTag.LensSpecification }
};
public static TheoryData<ExifTag> ShortTags => new()
{
{ ExifTag.OldSubfileType },
{ ExifTag.Compression },
{ ExifTag.PhotometricInterpretation },
{ ExifTag.Thresholding },
{ ExifTag.CellWidth },
{ ExifTag.CellLength },
{ ExifTag.FillOrder },
{ ExifTag.Orientation },
{ ExifTag.SamplesPerPixel },
{ ExifTag.PlanarConfiguration },
{ ExifTag.Predictor },
{ ExifTag.GrayResponseUnit },
{ ExifTag.ResolutionUnit },
{ ExifTag.CleanFaxData },
{ ExifTag.InkSet },
{ ExifTag.NumberOfInks },
{ ExifTag.DotRange },
{ ExifTag.Indexed },
{ ExifTag.OPIProxy },
{ ExifTag.JPEGProc },
{ ExifTag.JPEGRestartInterval },
{ ExifTag.YCbCrPositioning },
{ ExifTag.Rating },
{ ExifTag.RatingPercent },
{ ExifTag.ExposureProgram },
{ ExifTag.Interlace },
{ ExifTag.SelfTimerMode },
{ ExifTag.SensitivityType },
{ ExifTag.MeteringMode },
{ ExifTag.LightSource },
{ ExifTag.FocalPlaneResolutionUnit2 },
{ ExifTag.SensingMethod2 },
{ ExifTag.Flash },
{ ExifTag.ColorSpace },
{ ExifTag.FocalPlaneResolutionUnit },
{ ExifTag.SensingMethod },
{ ExifTag.CustomRendered },
{ ExifTag.ExposureMode },
{ ExifTag.WhiteBalance },
{ ExifTag.FocalLengthIn35mmFilm },
{ ExifTag.SceneCaptureType },
{ ExifTag.GainControl },
{ ExifTag.Contrast },
{ ExifTag.Saturation },
{ ExifTag.Sharpness },
{ ExifTag.SubjectDistanceRange },
{ ExifTag.GPSDifferential }
{ (ExifTag)ExifTag.OldSubfileType },
{ (ExifTag)ExifTag.Compression },
{ (ExifTag)ExifTag.PhotometricInterpretation },
{ (ExifTag)ExifTag.Thresholding },
{ (ExifTag)ExifTag.CellWidth },
{ (ExifTag)ExifTag.CellLength },
{ (ExifTag)ExifTag.FillOrder },
{ (ExifTag)ExifTag.Orientation },
{ (ExifTag)ExifTag.SamplesPerPixel },
{ (ExifTag)ExifTag.PlanarConfiguration },
{ (ExifTag)ExifTag.Predictor },
{ (ExifTag)ExifTag.GrayResponseUnit },
{ (ExifTag)ExifTag.ResolutionUnit },
{ (ExifTag)ExifTag.CleanFaxData },
{ (ExifTag)ExifTag.InkSet },
{ (ExifTag)ExifTag.NumberOfInks },
{ (ExifTag)ExifTag.DotRange },
{ (ExifTag)ExifTag.Indexed },
{ (ExifTag)ExifTag.OPIProxy },
{ (ExifTag)ExifTag.JPEGProc },
{ (ExifTag)ExifTag.JPEGRestartInterval },
{ (ExifTag)ExifTag.YCbCrPositioning },
{ (ExifTag)ExifTag.Rating },
{ (ExifTag)ExifTag.RatingPercent },
{ (ExifTag)ExifTag.ExposureProgram },
{ (ExifTag)ExifTag.Interlace },
{ (ExifTag)ExifTag.SelfTimerMode },
{ (ExifTag)ExifTag.SensitivityType },
{ (ExifTag)ExifTag.MeteringMode },
{ (ExifTag)ExifTag.LightSource },
{ (ExifTag)ExifTag.FocalPlaneResolutionUnit2 },
{ (ExifTag)ExifTag.SensingMethod2 },
{ (ExifTag)ExifTag.Flash },
{ (ExifTag)ExifTag.ColorSpace },
{ (ExifTag)ExifTag.FocalPlaneResolutionUnit },
{ (ExifTag)ExifTag.SensingMethod },
{ (ExifTag)ExifTag.CustomRendered },
{ (ExifTag)ExifTag.ExposureMode },
{ (ExifTag)ExifTag.WhiteBalance },
{ (ExifTag)ExifTag.FocalLengthIn35mmFilm },
{ (ExifTag)ExifTag.SceneCaptureType },
{ (ExifTag)ExifTag.GainControl },
{ (ExifTag)ExifTag.Contrast },
{ (ExifTag)ExifTag.Saturation },
{ (ExifTag)ExifTag.Sharpness },
{ (ExifTag)ExifTag.SubjectDistanceRange },
{ (ExifTag)ExifTag.GPSDifferential }
};
public static TheoryData<ExifTag> ShortArrayTags => new()
{
{ ExifTag.BitsPerSample },
{ ExifTag.MinSampleValue },
{ ExifTag.MaxSampleValue },
{ ExifTag.GrayResponseCurve },
{ ExifTag.ColorMap },
{ ExifTag.ExtraSamples },
{ ExifTag.PageNumber },
{ ExifTag.TransferFunction },
{ ExifTag.HalftoneHints },
{ ExifTag.SampleFormat },
{ ExifTag.TransferRange },
{ ExifTag.DefaultImageColor },
{ ExifTag.JPEGLosslessPredictors },
{ ExifTag.JPEGPointTransforms },
{ ExifTag.YCbCrSubsampling },
{ ExifTag.CFARepeatPatternDim },
{ ExifTag.IntergraphPacketData },
{ ExifTag.ISOSpeedRatings },
{ ExifTag.SubjectArea },
{ ExifTag.SubjectLocation }
{ (ExifTag)ExifTag.BitsPerSample },
{ (ExifTag)ExifTag.MinSampleValue },
{ (ExifTag)ExifTag.MaxSampleValue },
{ (ExifTag)ExifTag.GrayResponseCurve },
{ (ExifTag)ExifTag.ColorMap },
{ (ExifTag)ExifTag.ExtraSamples },
{ (ExifTag)ExifTag.PageNumber },
{ (ExifTag)ExifTag.TransferFunction },
{ (ExifTag)ExifTag.HalftoneHints },
{ (ExifTag)ExifTag.SampleFormat },
{ (ExifTag)ExifTag.TransferRange },
{ (ExifTag)ExifTag.DefaultImageColor },
{ (ExifTag)ExifTag.JPEGLosslessPredictors },
{ (ExifTag)ExifTag.JPEGPointTransforms },
{ (ExifTag)ExifTag.YCbCrSubsampling },
{ (ExifTag)ExifTag.CFARepeatPatternDim },
{ (ExifTag)ExifTag.IntergraphPacketData },
{ (ExifTag)ExifTag.ISOSpeedRatings },
{ (ExifTag)ExifTag.SubjectArea },
{ (ExifTag)ExifTag.SubjectLocation }
};
public static TheoryData<ExifTag> SignedRationalTags => new()
{
{ ExifTag.ShutterSpeedValue },
{ ExifTag.BrightnessValue },
{ ExifTag.ExposureBiasValue },
{ ExifTag.AmbientTemperature },
{ ExifTag.WaterDepth },
{ ExifTag.CameraElevationAngle }
{ (ExifTag)ExifTag.ShutterSpeedValue },
{ (ExifTag)ExifTag.BrightnessValue },
{ (ExifTag)ExifTag.ExposureBiasValue },
{ (ExifTag)ExifTag.AmbientTemperature },
{ (ExifTag)ExifTag.WaterDepth },
{ (ExifTag)ExifTag.CameraElevationAngle }
};
public static TheoryData<ExifTag> SignedRationalArrayTags => new()
{
{ ExifTag.Decode }
{ (ExifTag)ExifTag.Decode }
};
public static TheoryData<ExifTag> SignedShortArrayTags => new()
{
{ ExifTag.TimeZoneOffset }
{ (ExifTag)ExifTag.TimeZoneOffset }
};
public static TheoryData<ExifTag> StringTags => new()
{
{ ExifTag.ImageDescription },
{ ExifTag.Make },
{ ExifTag.Model },
{ ExifTag.Software },
{ ExifTag.DateTime },
{ ExifTag.Artist },
{ ExifTag.HostComputer },
{ ExifTag.Copyright },
{ ExifTag.DocumentName },
{ ExifTag.PageName },
{ ExifTag.InkNames },
{ ExifTag.TargetPrinter },
{ ExifTag.ImageID },
{ ExifTag.MDLabName },
{ ExifTag.MDSampleInfo },
{ ExifTag.MDPrepDate },
{ ExifTag.MDPrepTime },
{ ExifTag.MDFileUnits },
{ ExifTag.SEMInfo },
{ ExifTag.SpectralSensitivity },
{ ExifTag.DateTimeOriginal },
{ ExifTag.DateTimeDigitized },
{ ExifTag.SubsecTime },
{ ExifTag.SubsecTimeOriginal },
{ ExifTag.SubsecTimeDigitized },
{ ExifTag.RelatedSoundFile },
{ ExifTag.FaxSubaddress },
{ ExifTag.OffsetTime },
{ ExifTag.OffsetTimeOriginal },
{ ExifTag.OffsetTimeDigitized },
{ ExifTag.SecurityClassification },
{ ExifTag.ImageHistory },
{ ExifTag.ImageUniqueID },
{ ExifTag.OwnerName },
{ ExifTag.SerialNumber },
{ ExifTag.LensMake },
{ ExifTag.LensModel },
{ ExifTag.LensSerialNumber },
{ ExifTag.GDALMetadata },
{ ExifTag.GDALNoData },
{ ExifTag.GPSLatitudeRef },
{ ExifTag.GPSLongitudeRef },
{ ExifTag.GPSSatellites },
{ ExifTag.GPSStatus },
{ ExifTag.GPSMeasureMode },
{ ExifTag.GPSSpeedRef },
{ ExifTag.GPSTrackRef },
{ ExifTag.GPSImgDirectionRef },
{ ExifTag.GPSMapDatum },
{ ExifTag.GPSDestLatitudeRef },
{ ExifTag.GPSDestLongitudeRef },
{ ExifTag.GPSDestBearingRef },
{ ExifTag.GPSDestDistanceRef },
{ ExifTag.GPSDateStamp },
{ (ExifTag)ExifTag.ImageDescription },
{ (ExifTag)ExifTag.Make },
{ (ExifTag)ExifTag.Model },
{ (ExifTag)ExifTag.Software },
{ (ExifTag)ExifTag.DateTime },
{ (ExifTag)ExifTag.Artist },
{ (ExifTag)ExifTag.HostComputer },
{ (ExifTag)ExifTag.Copyright },
{ (ExifTag)ExifTag.DocumentName },
{ (ExifTag)ExifTag.PageName },
{ (ExifTag)ExifTag.InkNames },
{ (ExifTag)ExifTag.TargetPrinter },
{ (ExifTag)ExifTag.ImageID },
{ (ExifTag)ExifTag.MDLabName },
{ (ExifTag)ExifTag.MDSampleInfo },
{ (ExifTag)ExifTag.MDPrepDate },
{ (ExifTag)ExifTag.MDPrepTime },
{ (ExifTag)ExifTag.MDFileUnits },
{ (ExifTag)ExifTag.SEMInfo },
{ (ExifTag)ExifTag.SpectralSensitivity },
{ (ExifTag)ExifTag.DateTimeOriginal },
{ (ExifTag)ExifTag.DateTimeDigitized },
{ (ExifTag)ExifTag.SubsecTime },
{ (ExifTag)ExifTag.SubsecTimeOriginal },
{ (ExifTag)ExifTag.SubsecTimeDigitized },
{ (ExifTag)ExifTag.RelatedSoundFile },
{ (ExifTag)ExifTag.FaxSubaddress },
{ (ExifTag)ExifTag.OffsetTime },
{ (ExifTag)ExifTag.OffsetTimeOriginal },
{ (ExifTag)ExifTag.OffsetTimeDigitized },
{ (ExifTag)ExifTag.SecurityClassification },
{ (ExifTag)ExifTag.ImageHistory },
{ (ExifTag)ExifTag.ImageUniqueID },
{ (ExifTag)ExifTag.OwnerName },
{ (ExifTag)ExifTag.SerialNumber },
{ (ExifTag)ExifTag.LensMake },
{ (ExifTag)ExifTag.LensModel },
{ (ExifTag)ExifTag.LensSerialNumber },
{ (ExifTag)ExifTag.GDALMetadata },
{ (ExifTag)ExifTag.GDALNoData },
{ (ExifTag)ExifTag.GPSLatitudeRef },
{ (ExifTag)ExifTag.GPSLongitudeRef },
{ (ExifTag)ExifTag.GPSSatellites },
{ (ExifTag)ExifTag.GPSStatus },
{ (ExifTag)ExifTag.GPSMeasureMode },
{ (ExifTag)ExifTag.GPSSpeedRef },
{ (ExifTag)ExifTag.GPSTrackRef },
{ (ExifTag)ExifTag.GPSImgDirectionRef },
{ (ExifTag)ExifTag.GPSMapDatum },
{ (ExifTag)ExifTag.GPSDestLatitudeRef },
{ (ExifTag)ExifTag.GPSDestLongitudeRef },
{ (ExifTag)ExifTag.GPSDestBearingRef },
{ (ExifTag)ExifTag.GPSDestDistanceRef },
{ (ExifTag)ExifTag.GPSDateStamp },
};
public static TheoryData<ExifTag> UndefinedTags => new()
{
{ ExifTag.FileSource },
{ ExifTag.SceneType }
{ (ExifTag)ExifTag.FileSource },
{ (ExifTag)ExifTag.SceneType }
};
public static TheoryData<ExifTag> UndefinedArrayTags => new()
{
{ ExifTag.JPEGTables },
{ ExifTag.OECF },
{ ExifTag.ExifVersion },
{ ExifTag.ComponentsConfiguration },
{ ExifTag.MakerNote },
{ ExifTag.FlashpixVersion },
{ ExifTag.SpatialFrequencyResponse },
{ ExifTag.SpatialFrequencyResponse2 },
{ ExifTag.Noise },
{ ExifTag.CFAPattern },
{ ExifTag.DeviceSettingDescription },
{ ExifTag.ImageSourceData },
{ (ExifTag)ExifTag.JPEGTables },
{ (ExifTag)ExifTag.OECF },
{ (ExifTag)ExifTag.ExifVersion },
{ (ExifTag)ExifTag.ComponentsConfiguration },
{ (ExifTag)ExifTag.MakerNote },
{ (ExifTag)ExifTag.FlashpixVersion },
{ (ExifTag)ExifTag.SpatialFrequencyResponse },
{ (ExifTag)ExifTag.SpatialFrequencyResponse2 },
{ (ExifTag)ExifTag.Noise },
{ (ExifTag)ExifTag.CFAPattern },
{ (ExifTag)ExifTag.DeviceSettingDescription },
{ (ExifTag)ExifTag.ImageSourceData },
};
public static TheoryData<ExifTag> EncodedStringTags => new()
{
{ ExifTag.UserComment },
{ ExifTag.GPSProcessingMethod },
{ ExifTag.GPSAreaInformation }
{ (ExifTag)ExifTag.UserComment },
{ (ExifTag)ExifTag.GPSProcessingMethod },
{ (ExifTag)ExifTag.GPSAreaInformation }
};
public static TheoryData<ExifTag> Ucs2StringTags => new()
{
{ ExifTag.XPTitle },
{ ExifTag.XPComment },
{ ExifTag.XPAuthor },
{ ExifTag.XPKeywords },
{ ExifTag.XPSubject },
{ (ExifTag)ExifTag.XPTitle },
{ (ExifTag)ExifTag.XPComment },
{ (ExifTag)ExifTag.XPAuthor },
{ (ExifTag)ExifTag.XPKeywords },
{ (ExifTag)ExifTag.XPSubject },
};
[Theory]

2
tests/ImageSharp.Tests/PixelFormats/L8Tests.cs

@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats;
public class L8Tests
{
public static readonly TheoryData<byte> LuminanceData
= new() { 0, 1, 2, 3, 5, 13, 31, 71, 73, 79, 83, 109, 127, 128, 131, 199, 250, 251, 254, 255 };
= new() { (byte)0, (byte)1, (byte)2, (byte)3, (byte)5, (byte)13, (byte)31, (byte)71, (byte)73, (byte)79, (byte)83, (byte)109, (byte)127, (byte)128, (byte)131, (byte)199, (byte)250, (byte)251, (byte)254, (byte)255 };
[Theory]
[InlineData(0)]

2
tests/ImageSharp.Tests/PixelFormats/La16Tests.cs

@ -12,7 +12,7 @@ namespace SixLabors.ImageSharp.Tests.PixelFormats;
public class La16Tests
{
public static readonly TheoryData<byte> LuminanceData
= new() { 0, 1, 2, 3, 5, 13, 31, 71, 73, 79, 83, 109, 127, 128, 131, 199, 250, 251, 254, 255 };
= new() { (byte)0, (byte)1, (byte)2, (byte)3, (byte)5, (byte)13, (byte)31, (byte)71, (byte)73, (byte)79, (byte)83, (byte)109, (byte)127, (byte)128, (byte)131, (byte)199, (byte)250, (byte)251, (byte)254, (byte)255 };
[Theory]
[InlineData(0, 0)]

1
tests/ImageSharp.Tests/PixelFormats/PixelOperations/Generated/PixelOperationsTests.Specialized.Generated.cs

@ -5,7 +5,6 @@
using SixLabors.ImageSharp.PixelFormats;
using Xunit;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations;

59
tests/ImageSharp.Tests/PixelFormats/PixelOperations/PixelOperationsTests.cs

@ -10,7 +10,6 @@ using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.Common;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.PixelFormats.PixelOperations;
@ -315,35 +314,35 @@ public abstract class PixelOperationsTests<TPixel> : MeasureFixture
public static readonly TheoryData<object> Generic_To_Data = new()
{
new TestPixel<A8>(),
new TestPixel<Abgr32>(),
new TestPixel<Argb32>(),
new TestPixel<Bgr24>(),
new TestPixel<Bgr565>(),
new TestPixel<Bgra32>(),
new TestPixel<Bgra4444>(),
new TestPixel<Bgra5551>(),
new TestPixel<Byte4>(),
new TestPixel<HalfSingle>(),
new TestPixel<HalfVector2>(),
new TestPixel<HalfVector4>(),
new TestPixel<L16>(),
new TestPixel<L8>(),
new TestPixel<La16>(),
new TestPixel<La32>(),
new TestPixel<NormalizedByte2>(),
new TestPixel<NormalizedByte4>(),
new TestPixel<NormalizedShort2>(),
new TestPixel<NormalizedShort4>(),
new TestPixel<Rg32>(),
new TestPixel<Rgb24>(),
new TestPixel<Rgb48>(),
new TestPixel<Rgba1010102>(),
new TestPixel<Rgba32>(),
new TestPixel<Rgba64>(),
new TestPixel<RgbaVector>(),
new TestPixel<Short2>(),
new TestPixel<Short4>(),
(object)new TestPixel<A8>(),
(object)new TestPixel<Abgr32>(),
(object)new TestPixel<Argb32>(),
(object)new TestPixel<Bgr24>(),
(object)new TestPixel<Bgr565>(),
(object)new TestPixel<Bgra32>(),
(object)new TestPixel<Bgra4444>(),
(object)new TestPixel<Bgra5551>(),
(object)new TestPixel<Byte4>(),
(object)new TestPixel<HalfSingle>(),
(object)new TestPixel<HalfVector2>(),
(object)new TestPixel<HalfVector4>(),
(object)new TestPixel<L16>(),
(object)new TestPixel<L8>(),
(object)new TestPixel<La16>(),
(object)new TestPixel<La32>(),
(object)new TestPixel<NormalizedByte2>(),
(object)new TestPixel<NormalizedByte4>(),
(object)new TestPixel<NormalizedShort2>(),
(object)new TestPixel<NormalizedShort4>(),
(object)new TestPixel<Rg32>(),
(object)new TestPixel<Rgb24>(),
(object)new TestPixel<Rgb48>(),
(object)new TestPixel<Rgba1010102>(),
(object)new TestPixel<Rgba32>(),
(object)new TestPixel<Rgba64>(),
(object)new TestPixel<RgbaVector>(),
(object)new TestPixel<Short2>(),
(object)new TestPixel<Short4>(),
};
[Theory]

2
tests/ImageSharp.Tests/Processing/Processors/Convolution/BokehBlurTest.cs

@ -8,7 +8,7 @@ using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Convolution;
using SixLabors.ImageSharp.Tests.TestUtilities;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Convolution;

4
tests/ImageSharp.Tests/Processing/Processors/Dithering/DitherTests.cs

@ -43,8 +43,8 @@ public class DitherTests
public static readonly TheoryData<IDither> DefaultInstanceDitherers
= new()
{
default(ErrorDither),
default(OrderedDither)
(IDither)default(ErrorDither),
(IDither)default(OrderedDither)
};
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.05f);

126
tests/ImageSharp.Tests/Processing/Processors/Quantization/QuantizerTests.cs

@ -74,79 +74,79 @@ public class QuantizerTests
= new()
{
// Known uses error diffusion by default.
KnownQuantizers.Hexadecatree,
KnownQuantizers.WebSafe,
KnownQuantizers.Werner,
KnownQuantizers.Wu,
new HexadecatreeQuantizer(NoDitherOptions),
new WebSafePaletteQuantizer(NoDitherOptions),
new WernerPaletteQuantizer(NoDitherOptions),
new WuQuantizer(NoDitherOptions),
new HexadecatreeQuantizer(OrderedDitherOptions),
new WebSafePaletteQuantizer(OrderedDitherOptions),
new WernerPaletteQuantizer(OrderedDitherOptions),
new WuQuantizer(OrderedDitherOptions)
(IQuantizer)KnownQuantizers.Hexadecatree,
(IQuantizer)KnownQuantizers.WebSafe,
(IQuantizer)KnownQuantizers.Werner,
(IQuantizer)KnownQuantizers.Wu,
(IQuantizer)new HexadecatreeQuantizer(NoDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(NoDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(NoDitherOptions),
(IQuantizer)new WuQuantizer(NoDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(OrderedDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(OrderedDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(OrderedDitherOptions),
(IQuantizer)new WuQuantizer(OrderedDitherOptions)
};
public static readonly TheoryData<IQuantizer> DitherScaleQuantizers
= new()
{
new HexadecatreeQuantizer(Diffuser0_ScaleDitherOptions),
new WebSafePaletteQuantizer(Diffuser0_ScaleDitherOptions),
new WernerPaletteQuantizer(Diffuser0_ScaleDitherOptions),
new WuQuantizer(Diffuser0_ScaleDitherOptions),
new HexadecatreeQuantizer(Diffuser0_25_ScaleDitherOptions),
new WebSafePaletteQuantizer(Diffuser0_25_ScaleDitherOptions),
new WernerPaletteQuantizer(Diffuser0_25_ScaleDitherOptions),
new WuQuantizer(Diffuser0_25_ScaleDitherOptions),
new HexadecatreeQuantizer(Diffuser0_5_ScaleDitherOptions),
new WebSafePaletteQuantizer(Diffuser0_5_ScaleDitherOptions),
new WernerPaletteQuantizer(Diffuser0_5_ScaleDitherOptions),
new WuQuantizer(Diffuser0_5_ScaleDitherOptions),
new HexadecatreeQuantizer(Diffuser0_75_ScaleDitherOptions),
new WebSafePaletteQuantizer(Diffuser0_75_ScaleDitherOptions),
new WernerPaletteQuantizer(Diffuser0_75_ScaleDitherOptions),
new WuQuantizer(Diffuser0_75_ScaleDitherOptions),
new HexadecatreeQuantizer(DiffuserDitherOptions),
new WebSafePaletteQuantizer(DiffuserDitherOptions),
new WernerPaletteQuantizer(DiffuserDitherOptions),
new WuQuantizer(DiffuserDitherOptions),
new HexadecatreeQuantizer(Ordered0_ScaleDitherOptions),
new WebSafePaletteQuantizer(Ordered0_ScaleDitherOptions),
new WernerPaletteQuantizer(Ordered0_ScaleDitherOptions),
new WuQuantizer(Ordered0_ScaleDitherOptions),
new HexadecatreeQuantizer(Ordered0_25_ScaleDitherOptions),
new WebSafePaletteQuantizer(Ordered0_25_ScaleDitherOptions),
new WernerPaletteQuantizer(Ordered0_25_ScaleDitherOptions),
new WuQuantizer(Ordered0_25_ScaleDitherOptions),
new HexadecatreeQuantizer(Ordered0_5_ScaleDitherOptions),
new WebSafePaletteQuantizer(Ordered0_5_ScaleDitherOptions),
new WernerPaletteQuantizer(Ordered0_5_ScaleDitherOptions),
new WuQuantizer(Ordered0_5_ScaleDitherOptions),
new HexadecatreeQuantizer(Ordered0_75_ScaleDitherOptions),
new WebSafePaletteQuantizer(Ordered0_75_ScaleDitherOptions),
new WernerPaletteQuantizer(Ordered0_75_ScaleDitherOptions),
new WuQuantizer(Ordered0_75_ScaleDitherOptions),
new HexadecatreeQuantizer(OrderedDitherOptions),
new WebSafePaletteQuantizer(OrderedDitherOptions),
new WernerPaletteQuantizer(OrderedDitherOptions),
new WuQuantizer(OrderedDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Diffuser0_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Diffuser0_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Diffuser0_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Diffuser0_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Diffuser0_25_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Diffuser0_25_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Diffuser0_25_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Diffuser0_25_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Diffuser0_5_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Diffuser0_5_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Diffuser0_5_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Diffuser0_5_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Diffuser0_75_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Diffuser0_75_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Diffuser0_75_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Diffuser0_75_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(DiffuserDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(DiffuserDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(DiffuserDitherOptions),
(IQuantizer)new WuQuantizer(DiffuserDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Ordered0_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Ordered0_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Ordered0_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Ordered0_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Ordered0_25_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Ordered0_25_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Ordered0_25_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Ordered0_25_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Ordered0_5_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Ordered0_5_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Ordered0_5_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Ordered0_5_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(Ordered0_75_ScaleDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(Ordered0_75_ScaleDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(Ordered0_75_ScaleDitherOptions),
(IQuantizer)new WuQuantizer(Ordered0_75_ScaleDitherOptions),
(IQuantizer)new HexadecatreeQuantizer(OrderedDitherOptions),
(IQuantizer)new WebSafePaletteQuantizer(OrderedDitherOptions),
(IQuantizer)new WernerPaletteQuantizer(OrderedDitherOptions),
(IQuantizer)new WuQuantizer(OrderedDitherOptions),
};
public static readonly TheoryData<IDither> DefaultInstanceDitherers
= new()
{
default(ErrorDither),
default(OrderedDither)
(IDither)default(ErrorDither),
(IDither)default(OrderedDither)
};
private static readonly ImageComparer ValidatorComparer = ImageComparer.TolerantPercentage(0.05F);

1
tests/ImageSharp.Tests/Processing/Processors/Transforms/AffineTransformTests.cs

@ -7,7 +7,6 @@ using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Transforms;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Processing.Transforms;

1
tests/ImageSharp.Tests/Processing/Processors/Transforms/ProjectiveTransformTests.cs

@ -9,7 +9,6 @@ using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Transforms;
using SixLabors.ImageSharp.Tests.TestUtilities;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms;

1
tests/ImageSharp.Tests/Processing/Processors/Transforms/ResizeKernelMapTests.cs

@ -4,7 +4,6 @@
using System.Text;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Processing.Processors.Transforms;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.Processing.Processors.Transforms;

2
tests/ImageSharp.Tests/Processing/Processors/Transforms/RotateTests.cs

@ -15,7 +15,7 @@ public class RotateTests
public static readonly TheoryData<float> RotateAngles
= new()
{
50, -50, 170, -170
50f, -50f, 170f, -170f
};
public static readonly TheoryData<RotateMode> RotateEnumValues

1
tests/ImageSharp.Tests/ProfilingBenchmarks/LoadResizeSaveProfilingBenchmarks.cs

@ -3,7 +3,6 @@
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Processing;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.ProfilingBenchmarks;

1
tests/ImageSharp.Tests/ProfilingBenchmarks/ResizeProfilingBenchmarks.cs

@ -3,7 +3,6 @@
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.ProfilingBenchmarks;

14
tests/ImageSharp.Tests/TestUtilities/Attributes/ImageDataAttributeBase.cs

@ -3,6 +3,7 @@
using System.Reflection;
using Xunit.Sdk;
using Xunit.v3;
namespace SixLabors.ImageSharp.Tests;
@ -42,11 +43,22 @@ public abstract class ImageDataAttributeBase : DataAttribute
/// </summary>
public Type MemberType { get; set; }
/// <inheritdoc/>
public override bool SupportsDiscoveryEnumeration() => true;
/// <inheritdoc/>
public override ValueTask<IReadOnlyCollection<ITheoryDataRow?>> GetData(MethodInfo testMethod, DisposalTracker disposalTracker)
{
IEnumerable<object[]> rows = this.GetDataRows(testMethod);
IReadOnlyCollection<ITheoryDataRow?> result = rows.Select(row => ConvertDataRow(row)).ToList();
return new ValueTask<IReadOnlyCollection<ITheoryDataRow?>>(result);
}
/// <summary>Returns the data to be used to test the theory.</summary>
/// <param name="testMethod">The method that is being tested</param>
/// <returns>One or more sets of theory data. Each invocation of the test method
/// is represented by a single object array.</returns>
public override IEnumerable<object[]> GetData(MethodInfo testMethod)
private IEnumerable<object[]> GetDataRows(MethodInfo testMethod)
{
IEnumerable<object[]> addedRows = Enumerable.Empty<object[]>().ToArray();
if (!string.IsNullOrWhiteSpace(this.MemberName))

44
tests/ImageSharp.Tests/TestUtilities/BasicSerializer.cs

@ -2,7 +2,7 @@
// Licensed under the Six Labors Split License.
using System.ComponentModel;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.TestUtilities;
@ -13,8 +13,11 @@ namespace SixLabors.ImageSharp.Tests.TestUtilities;
/// </summary>
internal class BasicSerializer : IXunitSerializationInfo
{
private readonly Dictionary<string, string> map = [];
// Stores (string representation, type) per key.
private readonly Dictionary<string, (string str, Type type)> map = [];
// Separator between key, type AQN and value in the dump format.
// ':' is safe because AssemblyQualifiedName and converter output don't contain it.
public const char Separator = ':';
private string DumpToString(Type type)
@ -22,14 +25,14 @@ internal class BasicSerializer : IXunitSerializationInfo
using MemoryStream ms = new();
using StreamWriter writer = new(ms);
writer.WriteLine(type.FullName);
foreach (KeyValuePair<string, string> kv in this.map)
foreach (KeyValuePair<string, (string str, Type t)> kv in this.map)
{
writer.WriteLine($"{kv.Key}{Separator}{kv.Value}");
// Format: key:TypeAssemblyQualifiedName:value
writer.WriteLine($"{kv.Key}{Separator}{kv.Value.t.AssemblyQualifiedName}{Separator}{kv.Value.str}");
}
writer.Flush();
byte[] data = ms.ToArray();
return Convert.ToBase64String(data);
return Convert.ToBase64String(ms.ToArray());
}
private Type LoadDump(string dump)
@ -41,8 +44,18 @@ internal class BasicSerializer : IXunitSerializationInfo
Type type = Type.GetType(reader.ReadLine());
for (string s = reader.ReadLine(); s != null; s = reader.ReadLine())
{
string[] kv = s.Split(Separator);
this.map[kv[0]] = kv[1];
// Format: key:TypeAQN:value (3 parts max to preserve ':' inside value)
string[] parts = s.Split(Separator, 3);
if (parts.Length == 3)
{
Type valueType = Type.GetType(parts[1]) ?? typeof(string);
this.map[parts[0]] = (parts[2], valueType);
}
else if (parts.Length == 2)
{
// Legacy two-part format: key:value (no type info)
this.map[parts[0]] = (parts[1], typeof(string));
}
}
return type;
@ -66,6 +79,7 @@ internal class BasicSerializer : IXunitSerializationInfo
return result;
}
/// <inheritdoc/>
public void AddValue(string key, object value, Type type = null)
{
Guard.NotNull(key, nameof(key));
@ -75,21 +89,19 @@ internal class BasicSerializer : IXunitSerializationInfo
}
type ??= value.GetType();
this.map[key] = TypeDescriptor.GetConverter(type).ConvertToInvariantString(value);
this.map[key] = (TypeDescriptor.GetConverter(type).ConvertToInvariantString(value), type);
}
public object GetValue(string key, Type type)
/// <inheritdoc/>
public object GetValue(string key)
{
Guard.NotNull(key, nameof(key));
if (!this.map.TryGetValue(key, out string str))
if (!this.map.TryGetValue(key, out (string str, Type type) entry))
{
return type.IsValueType ? Activator.CreateInstance(type) : null;
return null;
}
return TypeDescriptor.GetConverter(type).ConvertFromInvariantString(str);
return TypeDescriptor.GetConverter(entry.type).ConvertFromInvariantString(entry.str);
}
public T GetValue<T>(string key) => (T)this.GetValue(key, typeof(T));
}

2
tests/ImageSharp.Tests/TestUtilities/FeatureTesting/FeatureTestRunner.cs

@ -4,7 +4,7 @@
using System.Diagnostics;
using System.Globalization;
using Microsoft.DotNet.RemoteExecutor;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.TestUtilities;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/BasicTestPatternProvider.cs

@ -2,7 +2,7 @@
// Licensed under the Six Labors Split License.
using System.Numerics;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/BlankProvider.cs

@ -2,8 +2,8 @@
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Sdk;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/FileProvider.cs

@ -6,8 +6,8 @@ using System.Reflection;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Sdk;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/MemberMethodProvider.cs

@ -3,7 +3,7 @@
using System.Reflection;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/SolidProvider.cs

@ -3,7 +3,7 @@
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestImageProvider.cs

@ -7,8 +7,8 @@ using Castle.Core.Internal;
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Xunit.Sdk;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/ImageProviders/TestPatternProvider.cs

@ -4,7 +4,7 @@
using System.Numerics;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests;

1
tests/ImageSharp.Tests/TestUtilities/MeasureFixture.cs

@ -3,7 +3,6 @@
using System.Diagnostics;
using System.Runtime.CompilerServices;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests;

14
tests/ImageSharp.Tests/TestUtilities/SixLaborsXunitTestFramework.cs

@ -3,22 +3,16 @@
using BenchmarkDotNet.Environments;
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
using Xunit.Sdk;
using Xunit.v3;
[assembly: Xunit.TestFramework(SixLaborsXunitTestFramework.Type, SixLaborsXunitTestFramework.Assembly)]
[assembly: Xunit.TestFramework(typeof(SixLaborsXunitTestFramework))]
namespace SixLabors.ImageSharp.Tests.TestUtilities;
public class SixLaborsXunitTestFramework : XunitTestFramework
{
public const string Type = "SixLabors.ImageSharp.Tests.TestUtilities.SixLaborsXunitTestFramework";
public const string Assembly = "SixLabors.ImageSharp.Tests";
public SixLaborsXunitTestFramework(IMessageSink messageSink)
: base(messageSink)
public SixLaborsXunitTestFramework()
{
DiagnosticMessage message = new(HostEnvironmentInfo.GetInformation());
messageSink.OnMessage(message);
Console.WriteLine(HostEnvironmentInfo.GetInformation());
}
}

2
tests/ImageSharp.Tests/TestUtilities/TestPixel.cs

@ -3,7 +3,7 @@
using System.Numerics;
using SixLabors.ImageSharp.PixelFormats;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.TestUtilities;

3
tests/ImageSharp.Tests/TestUtilities/TestType.cs

@ -1,7 +1,8 @@
// Copyright (c) Six Labors.
// Licensed under the Six Labors Split License.
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.TestUtilities;

2
tests/ImageSharp.Tests/TestUtilities/TestVector4.cs

@ -2,7 +2,7 @@
// Licensed under the Six Labors Split License.
using System.Numerics;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.TestUtilities;

2
tests/ImageSharp.Tests/TestUtilities/Tests/BasicSerializerTests.cs

@ -2,7 +2,7 @@
// Licensed under the Six Labors Split License.
using SixLabors.ImageSharp.Tests.TestUtilities;
using Xunit.Abstractions;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests;

2
tests/ImageSharp.Tests/TestUtilities/Tests/FeatureTestRunnerTests.cs

@ -4,8 +4,8 @@
using System.Numerics;
using System.Runtime.Intrinsics.Arm;
using System.Runtime.Intrinsics.X86;
using Xunit.Abstractions;
using Aes = System.Runtime.Intrinsics.X86.Aes;
using Xunit.Sdk;
namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests;

1
tests/ImageSharp.Tests/TestUtilities/Tests/ImageComparerTests.cs

@ -5,7 +5,6 @@ using Moq;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests;

1
tests/ImageSharp.Tests/TestUtilities/Tests/MagickReferenceCodecTests.cs

@ -5,7 +5,6 @@ using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests;

1
tests/ImageSharp.Tests/TestUtilities/Tests/ReferenceDecoderBenchmarks.cs

@ -4,7 +4,6 @@
using SixLabors.ImageSharp.Formats;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests;

1
tests/ImageSharp.Tests/TestUtilities/Tests/SystemDrawingReferenceCodecTests.cs

@ -8,7 +8,6 @@ using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using SixLabors.ImageSharp.Tests.TestUtilities.ImageComparison;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests.TestUtilities.Tests;

3
tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs

@ -9,7 +9,6 @@ using SixLabors.ImageSharp.Formats.Gif;
using SixLabors.ImageSharp.Formats.Jpeg;
using SixLabors.ImageSharp.Formats.Webp;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests;
@ -121,7 +120,7 @@ public class TestEnvironmentTests
// https://github.com/SixLabors/ImageSharp/blob/381dff8640b721a34b1227c970fcf6ad6c5e3e72/ci-test.ps1#L30
public static bool IsNot32BitNetFramework = !TestEnvironment.IsFramework || TestEnvironment.Is64BitProcess;
[ConditionalFact(nameof(IsNot32BitNetFramework))]
[Fact(SkipUnless = nameof(IsNot32BitNetFramework))]
public void RemoteExecutor_FailingRemoteTestShouldFailLocalTest()
{
static void FailingCode()

9
tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs

@ -8,7 +8,6 @@ using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.Metadata;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Tests.TestUtilities.ReferenceCodecs;
using Xunit.Abstractions;
// ReSharper disable InconsistentNaming
namespace SixLabors.ImageSharp.Tests;
@ -17,14 +16,14 @@ public class TestImageProviderTests
{
public static readonly TheoryData<object> BasicData = new()
{
TestImageProvider<Rgba32>.Blank(10, 20),
TestImageProvider<HalfVector4>.Blank(10, 20),
(object)TestImageProvider<Rgba32>.Blank(10, 20),
(object)TestImageProvider<HalfVector4>.Blank(10, 20),
};
public static readonly TheoryData<object> FileData = new()
{
TestImageProvider<Rgba32>.File(TestImages.Bmp.Car),
TestImageProvider<HalfVector4>.File(TestImages.Bmp.F)
(object)TestImageProvider<Rgba32>.File(TestImages.Bmp.Car),
(object)TestImageProvider<HalfVector4>.File(TestImages.Bmp.F)
};
public static string[] AllBmpFiles = [TestImages.Bmp.F, TestImages.Bmp.Bit8];

1
tests/ImageSharp.Tests/TestUtilities/Tests/TestUtilityExtensionsTests.cs

@ -5,7 +5,6 @@ using System.Numerics;
using SixLabors.ImageSharp.Memory;
using SixLabors.ImageSharp.PixelFormats;
using SixLabors.ImageSharp.Processing;
using Xunit.Abstractions;
namespace SixLabors.ImageSharp.Tests;

6
tests/ImageSharp.Tests/ValidateDisposedMemoryAllocationsAttribute.cs

@ -2,7 +2,7 @@
// Licensed under the Six Labors Split License.
using System.Reflection;
using Xunit.Sdk;
using Xunit.v3;
namespace SixLabors.ImageSharp.Tests;
@ -19,10 +19,10 @@ public class ValidateDisposedMemoryAllocationsAttribute : BeforeAfterTestAttribu
public ValidateDisposedMemoryAllocationsAttribute(int expected)
=> this.expected = expected;
public override void Before(MethodInfo methodUnderTest)
public override void Before(MethodInfo methodUnderTest, IXunitTest test)
=> MemoryAllocatorValidator.MonitorAllocations();
public override void After(MethodInfo methodUnderTest)
public override void After(MethodInfo methodUnderTest, IXunitTest test)
{
MemoryAllocatorValidator.ValidateAllocations(this.expected);
MemoryAllocatorValidator.StopMonitoringAllocations();

Loading…
Cancel
Save