Skip to content
This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
/ corefx Public archive

Commit

Permalink
Resolve CI failures (use MemoryMarshal and add using directive)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahsonkhan committed Mar 2, 2018
1 parent 6042ae7 commit 21371d4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/System.IO.Pipelines/tests/TestMemoryPool.cs
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System.Buffers;
using System.Diagnostics;
using System.Runtime.InteropServices;
using System.Threading;

namespace System.IO.Pipelines
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

using System.Buffers;
using System.Collections.Generic;
using System.Runtime.InteropServices;
using Xunit;

namespace System.Net.Sockets.Tests
Expand Down Expand Up @@ -48,7 +49,7 @@ public void SetBufferArrayIntInt_AvailableFromMemoryBuffer()
byte[] array = new byte[42];

saea.SetBuffer(array, 0, array.Length);
Assert.True(saea.MemoryBuffer.TryGetArray(out ArraySegment<byte> result));
Assert.True(MemoryMarshal.TryGetArray(saea.MemoryBuffer, out ArraySegment<byte> result));
Assert.Same(array, result.Array);
Assert.Same(saea.Buffer, array);
Assert.Equal(0, result.Offset);
Expand All @@ -59,7 +60,7 @@ public void SetBufferArrayIntInt_AvailableFromMemoryBuffer()
Assert.Equal(1, saea.Offset);
Assert.Equal(2, saea.Count);

Assert.True(saea.MemoryBuffer.TryGetArray(out result));
Assert.True(MemoryMarshal.TryGetArray(saea.MemoryBuffer, out result));
Assert.Same(array, result.Array);
Assert.Equal(0, result.Offset);
Assert.Equal(array.Length, result.Count);
Expand Down

0 comments on commit 21371d4

Please sign in to comment.