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()
);
// 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());

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}!",
ex);
}
if (directory == null)
{
throw new Exception($"Unable to find ImageSharp solution directory from {assemblyLocation}!");
@ -116,7 +117,7 @@ namespace SixLabors.ImageSharp.Tests
/// </returns>
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)
{

6
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)

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

Loading…
Cancel
Save