public void MustBeSameSized_Span_LengthIsLess_ThrowsException() { var exception = Assert.Throws <ArgumentException>(() => { DebugGuard.MustBeSameSized(new Span <int>(new int[2]), new Span <int>(new int[3]), "myParamName"); }); Assert.Equal("myParamName", exception.ParamName); Assert.Contains($"Span-s must be the same size.", exception.Message); }
public static void Decode(Span <byte> scanline, Span <byte> previousScanline, int bytesPerPixel) { DebugGuard.MustBeSameSized(scanline, previousScanline, nameof(scanline)); ref byte scanBaseRef = ref MemoryMarshal.GetReference(scanline);
public static void Decode(Span <byte> scanline, Span <byte> previousScanline, int bytesPerPixel) { DebugGuard.MustBeSameSized(scanline, previousScanline, nameof(scanline)); ref byte scanBaseRef = ref scanline.DangerousGetPinnableReference();
public void MustBeSameSized_Span_LengthIsEqual_DoesNotThrowException() { DebugGuard.MustBeSameSized(new Span <int>(new int[2]), new Span <int>(new int[2]), "myParamName"); }
public static void EncodePaethFilter(ReadOnlySpan <byte> scanline, Span <byte> previousScanline, Span <byte> result, int bytesPerPixel, out int sum) { DebugGuard.MustBeSameSized <byte>(scanline, previousScanline, nameof(scanline)); DebugGuard.MustBeSizedAtLeast(result, scanline, nameof(result)); ref byte scanBaseRef = ref MemoryMarshal.GetReference(scanline);