From ce0dd481313ef3baad6686cd820c903488d9c336 Mon Sep 17 00:00:00 2001 From: Anton Firszov Date: Wed, 27 Jun 2018 00:39:43 +0200 Subject: [PATCH] keep using SystemDrawingReferenceDecoder for Bmp-s --- .../TestUtilities/TestEnvironment.Formats.cs | 4 ++-- tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs | 3 ++- .../TestUtilities/Tests/TestEnvironmentTests.cs | 6 +++--- .../TestUtilities/Tests/TestImageProviderTests.cs | 7 ++++++- 4 files changed, 13 insertions(+), 7 deletions(-) diff --git a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs index 30067ec2dc..ccda71613d 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs @@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Tests new GifConfigurationModule() ); - // Magick codecs should work on all + // Magick codecs should work on all platforms cfg.ConfigureCodecs( ImageFormats.Png, MagickReferenceDecoder.Instance, @@ -66,7 +66,7 @@ namespace SixLabors.ImageSharp.Tests cfg.ConfigureCodecs( ImageFormats.Bmp, - MagickReferenceDecoder.Instance, + SystemDrawingReferenceDecoder.Instance, SystemDrawingReferenceEncoder.Bmp, new BmpImageFormatDetector()); diff --git a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs index f0b7329989..a5a3e332c7 100644 --- a/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs +++ b/tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs @@ -65,6 +65,7 @@ namespace SixLabors.ImageSharp.Tests $"Unable to find ImageSharp solution directory from {assemblyLocation} because of {ex.GetType().Name}!", ex); } + if (directory == null) { throw new Exception($"Unable to find ImageSharp solution directory from {assemblyLocation}!"); @@ -116,7 +117,7 @@ namespace SixLabors.ImageSharp.Tests /// internal static string CreateOutputDirectory(string path, params string[] pathParts) { - path = Path.Combine(TestEnvironment.ActualOutputDirectoryFullPath, path); + path = Path.Combine(ActualOutputDirectoryFullPath, path); if (pathParts != null && pathParts.Length > 0) { diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs index f6d3bdb7b9..2c824729c2 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs @@ -99,7 +99,7 @@ namespace SixLabors.ImageSharp.Tests } [Theory] - [InlineData("lol/foo.png", typeof(SystemDrawingReferenceDecoder))] + [InlineData("lol/foo.png", typeof(MagickReferenceDecoder))] [InlineData("lol/Rofl.bmp", typeof(SystemDrawingReferenceDecoder))] [InlineData("lol/Baz.JPG", typeof(JpegDecoder))] [InlineData("lol/Baz.gif", typeof(GifDecoder))] @@ -125,8 +125,8 @@ namespace SixLabors.ImageSharp.Tests } [Theory] - [InlineData("lol/foo.png", typeof(PngDecoder))] - [InlineData("lol/Rofl.bmp", typeof(BmpDecoder))] + [InlineData("lol/foo.png", typeof(MagickReferenceDecoder))] + [InlineData("lol/Rofl.bmp", typeof(SystemDrawingReferenceDecoder))] [InlineData("lol/Baz.JPG", typeof(JpegDecoder))] [InlineData("lol/Baz.gif", typeof(GifDecoder))] public void GetReferenceDecoder_ReturnsCorrectDecoders_Linux(string fileName, Type expectedDecoderType) diff --git a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs index 06c77235b2..efc75773ef 100644 --- a/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs +++ b/tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs @@ -241,7 +241,12 @@ namespace SixLabors.ImageSharp.Tests } - public static string[] AllBmpFiles => TestImages.Bmp.All; + public static string[] AllBmpFiles = + { + TestImages.Bmp.F, + TestImages.Bmp.CoreHeader, + TestImages.Bmp.Bit8 + }; [Theory] [WithFileCollection(nameof(AllBmpFiles), PixelTypes.Rgba32 | PixelTypes.Argb32)]