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/ReadOnlyMemory/Strings.cs')
-rw-r--r--src/System.Memory/tests/ReadOnlyMemory/Strings.cs11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/System.Memory/tests/ReadOnlyMemory/Strings.cs b/src/System.Memory/tests/ReadOnlyMemory/Strings.cs
index ba7e86b8f2..6a775ad87a 100644
--- a/src/System.Memory/tests/ReadOnlyMemory/Strings.cs
+++ b/src/System.Memory/tests/ReadOnlyMemory/Strings.cs
@@ -94,17 +94,12 @@ namespace System.MemoryTests
}
[Fact]
- public static unsafe void AsReadOnlyMemory_Retain_ExpectedPointerValue()
+ public static unsafe void AsReadOnlyMemory_Pin_ExpectedPointerValue()
{
string input = "0123456789";
ReadOnlyMemory<char> m = input.AsMemory();
- 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)
@@ -137,7 +132,7 @@ namespace System.MemoryTests
Assert.Equal(length, m.Length);
- using (MemoryHandle h = m.Retain(pin: true))
+ using (MemoryHandle h = m.Pin())
{
fixed (char* pText = text)
{