Browse Source

keep using SystemDrawingReferenceDecoder for Bmp-s

af/merge-core
Anton Firszov 8 years ago
parent
commit
ce0dd48131
  1. 4
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs
  2. 3
      tests/ImageSharp.Tests/TestUtilities/TestEnvironment.cs
  3. 6
      tests/ImageSharp.Tests/TestUtilities/Tests/TestEnvironmentTests.cs
  4. 7
      tests/ImageSharp.Tests/TestUtilities/Tests/TestImageProviderTests.cs

4
tests/ImageSharp.Tests/TestUtilities/TestEnvironment.Formats.cs

@ -57,7 +57,7 @@ namespace SixLabors.ImageSharp.Tests
new GifConfigurationModule() new GifConfigurationModule()
); );
// Magick codecs should work on all // Magick codecs should work on all platforms
cfg.ConfigureCodecs( cfg.ConfigureCodecs(
ImageFormats.Png, ImageFormats.Png,
MagickReferenceDecoder.Instance, MagickReferenceDecoder.Instance,
@ -66,7 +66,7 @@ namespace SixLabors.ImageSharp.Tests
cfg.ConfigureCodecs( cfg.ConfigureCodecs(
ImageFormats.Bmp, ImageFormats.Bmp,
MagickReferenceDecoder.Instance, SystemDrawingReferenceDecoder.Instance,
SystemDrawingReferenceEncoder.Bmp, SystemDrawingReferenceEncoder.Bmp,
new BmpImageFormatDetector()); new BmpImageFormatDetector());

3
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}!", $"Unable to find ImageSharp solution directory from {assemblyLocation} because of {ex.GetType().Name}!",
ex); ex);
} }
if (directory == null) if (directory == null)
{ {
throw new Exception($"Unable to find ImageSharp solution directory from {assemblyLocation}!"); throw new Exception($"Unable to find ImageSharp solution directory from {assemblyLocation}!");
@ -116,7 +117,7 @@ namespace SixLabors.ImageSharp.Tests
/// </returns> /// </returns>
internal static string CreateOutputDirectory(string path, params string[] pathParts) 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) if (pathParts != null && pathParts.Length > 0)
{ {

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

@ -99,7 +99,7 @@ namespace SixLabors.ImageSharp.Tests
} }
[Theory] [Theory]
[InlineData("lol/foo.png", typeof(SystemDrawingReferenceDecoder))] [InlineData("lol/foo.png", typeof(MagickReferenceDecoder))]
[InlineData("lol/Rofl.bmp", typeof(SystemDrawingReferenceDecoder))] [InlineData("lol/Rofl.bmp", typeof(SystemDrawingReferenceDecoder))]
[InlineData("lol/Baz.JPG", typeof(JpegDecoder))] [InlineData("lol/Baz.JPG", typeof(JpegDecoder))]
[InlineData("lol/Baz.gif", typeof(GifDecoder))] [InlineData("lol/Baz.gif", typeof(GifDecoder))]
@ -125,8 +125,8 @@ namespace SixLabors.ImageSharp.Tests
} }
[Theory] [Theory]
[InlineData("lol/foo.png", typeof(PngDecoder))] [InlineData("lol/foo.png", typeof(MagickReferenceDecoder))]
[InlineData("lol/Rofl.bmp", typeof(BmpDecoder))] [InlineData("lol/Rofl.bmp", typeof(SystemDrawingReferenceDecoder))]
[InlineData("lol/Baz.JPG", typeof(JpegDecoder))] [InlineData("lol/Baz.JPG", typeof(JpegDecoder))]
[InlineData("lol/Baz.gif", typeof(GifDecoder))] [InlineData("lol/Baz.gif", typeof(GifDecoder))]
public void GetReferenceDecoder_ReturnsCorrectDecoders_Linux(string fileName, Type expectedDecoderType) public void GetReferenceDecoder_ReturnsCorrectDecoders_Linux(string fileName, Type expectedDecoderType)

7
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] [Theory]
[WithFileCollection(nameof(AllBmpFiles), PixelTypes.Rgba32 | PixelTypes.Argb32)] [WithFileCollection(nameof(AllBmpFiles), PixelTypes.Rgba32 | PixelTypes.Argb32)]

Loading…
Cancel
Save