Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/corefx.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'src/System.Memory/tests/Memory/Strings.cs')
-rw-r--r--src/System.Memory/tests/Memory/Strings.cs9
1 files changed, 2 insertions, 7 deletions
diff --git a/src/System.Memory/tests/Memory/Strings.cs b/src/System.Memory/tests/Memory/Strings.cs
index 6e4e0bfe05..b711179cd1 100644
--- a/src/System.Memory/tests/Memory/Strings.cs
+++ b/src/System.Memory/tests/Memory/Strings.cs
@@ -57,18 +57,13 @@ namespace System.MemoryTests
}
[Fact]
- public static unsafe void Memory_Retain_ExpectedPointerValue()
+ public static unsafe void Memory_Pin_ExpectedPointerValue()
{
string input = "0123456789";
ReadOnlyMemory<char> readonlyMemory = input.AsMemory();
Memory<char> m = MemoryMarshal.AsMemory(readonlyMemory);
- using (MemoryHandle h = m.Retain(pin: false))
- {
- Assert.Equal(IntPtr.Zero, (IntPtr)h.Pointer);
- }
-
- using (MemoryHandle h = m.Retain(pin: true))
+ using (MemoryHandle h = m.Pin())
{
GC.Collect();
fixed (char* ptr = input)