// // Copyright (c) James Jackson-South and contributors. // Licensed under the Apache License, Version 2.0. // // ReSharper disable InconsistentNaming namespace ImageSharp.Tests { using System; using Xunit; public class JpegDecoderTests : TestBase { public static string[] BaselineTestJpegs = { TestImages.Jpeg.Baseline.Calliphora, TestImages.Jpeg.Baseline.Cmyk, TestImages.Jpeg.Baseline.Jpeg400, TestImages.Jpeg.Baseline.Jpeg444, TestImages.Jpeg.Baseline.Testimgorig }; public static string[] ProgressiveTestJpegs = TestImages.Jpeg.Progressive.All; [Theory] [WithFileCollection(nameof(BaselineTestJpegs), PixelTypes.Color | PixelTypes.StandardImageClass | PixelTypes.Argb)] public void OpenBaselineJpeg_SaveBmp(TestImageProvider provider) where TColor : struct, IPackedPixel, IEquatable { Image image = provider.GetImage(); provider.Utility.SaveTestOutputFile(image, "bmp"); } [Theory] [WithFileCollection(nameof(ProgressiveTestJpegs), PixelTypes.Color | PixelTypes.StandardImageClass | PixelTypes.Argb)] public void OpenProgressiveJpeg_SaveBmp(TestImageProvider provider) where TColor : struct, IPackedPixel, IEquatable { Image image = provider.GetImage(); provider.Utility.SaveTestOutputFile(image, "bmp"); } unsafe struct Buzisag { public int Value; public delegate void BlockAction(Buzisag* b); public static void Foo(Buzisag* buzisag) { Bar(buzisag, b => b->Value++); } public static void Bar(Buzisag* buzisag, BlockAction action) { action(buzisag); } } [Fact] public unsafe void Kabbe() { Buzisag b = default(Buzisag); Buzisag.Foo(&b); Assert.Equal(1, b.Value); } } }