From f0f0c088abdf974f4c2e0a09425b5481ae2791d1 Mon Sep 17 00:00:00 2001 From: Dmitry Pentin Date: Fri, 14 May 2021 05:27:25 +0300 Subject: [PATCH] Fixed couple of invalid tests for ImageFrameCollection --- .../Image/ImageFrameCollectionTests.NonGeneric.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs index 7ff6b9b085..15838f6902 100644 --- a/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs +++ b/tests/ImageSharp.Tests/Image/ImageFrameCollectionTests.NonGeneric.cs @@ -279,13 +279,14 @@ namespace SixLabors.ImageSharp.Tests { var image = new Image(Configuration.Default, 10, 10); var frameCollection = image.Frames; + var rgba32Array = new Rgba32[0]; image.Dispose(); // this should invalidate underlying collection as well Assert.Throws(() => { var res = frameCollection.AddFrame((ImageFrame)null); }); - Assert.Throws(() => { var res = frameCollection.AddFrame((Rgba32[])null); }); + Assert.Throws(() => { var res = frameCollection.AddFrame(rgba32Array); }); Assert.Throws(() => { var res = frameCollection.AddFrame((ImageFrame)null); }); - Assert.Throws(() => { var res = frameCollection.AddFrame(stackalloc Rgba32[0]); }); + Assert.Throws(() => { var res = frameCollection.AddFrame(rgba32Array.AsSpan()); }); Assert.Throws(() => { var res = frameCollection.CloneFrame(default); }); Assert.Throws(() => { var res = frameCollection.Contains(default); }); Assert.Throws(() => { var res = frameCollection.CreateFrame(); });