Browse Source

Fix build in unrelated test code

pull/2633/head
Ynse Hoornenborg 1 year ago
parent
commit
e828434219
  1. 4
      tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs
  2. 2
      tests/ImageSharp.Tests/Image/ImageFrameTests.cs
  3. 2
      tests/ImageSharp.Tests/Image/ImageTests.cs

4
tests/ImageSharp.Tests/Formats/WebP/WebpCommonUtilsTests.cs

@ -106,7 +106,7 @@ public class WebpCommonUtilsTests
174, 183, 189, 255, 174, 183, 189, 255,
148, 158, 158, 255, 148, 158, 158, 255,
}; };
Span<Bgra32> row = MemoryMarshal.Cast<byte, Bgra32>(rowBytes); Span<Bgra32> row = MemoryMarshal.Cast<byte, Bgra32>((Span<byte>)rowBytes);
bool noneOpaque; bool noneOpaque;
for (int length = 8; length < row.Length; length += 8) for (int length = 8; length < row.Length; length += 8)
@ -188,7 +188,7 @@ public class WebpCommonUtilsTests
174, 183, 189, 255, 174, 183, 189, 255,
148, 158, 158, 255, 148, 158, 158, 255,
}; };
Span<Bgra32> row = MemoryMarshal.Cast<byte, Bgra32>(rowBytes); Span<Bgra32> row = MemoryMarshal.Cast<byte, Bgra32>((Span<byte>)rowBytes);
bool noneOpaque; bool noneOpaque;
for (int length = 8; length < row.Length; length += 8) for (int length = 8; length < row.Length; length += 8)

2
tests/ImageSharp.Tests/Image/ImageFrameTests.cs

@ -112,7 +112,7 @@ public class ImageFrameTests
} }
byte[] expected = TestUtils.FillImageWithRandomBytes(image); byte[] expected = TestUtils.FillImageWithRandomBytes(image);
byte[] actual = new byte[expected.Length]; Span<byte> actual = new byte[expected.Length];
if (byteSpan) if (byteSpan)
{ {
image.Frames.RootFrame.CopyPixelDataTo(actual); image.Frames.RootFrame.CopyPixelDataTo(actual);

2
tests/ImageSharp.Tests/Image/ImageTests.cs

@ -190,7 +190,7 @@ public partial class ImageTests
} }
byte[] expected = TestUtils.FillImageWithRandomBytes(image); byte[] expected = TestUtils.FillImageWithRandomBytes(image);
byte[] actual = new byte[expected.Length]; Span<byte> actual = new byte[expected.Length];
if (byteSpan) if (byteSpan)
{ {
image.CopyPixelDataTo(actual); image.CopyPixelDataTo(actual);

Loading…
Cancel
Save