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/Retain.cs')
-rw-r--r--src/System.Memory/tests/ReadOnlyMemory/Retain.cs30
1 files changed, 15 insertions, 15 deletions
diff --git a/src/System.Memory/tests/ReadOnlyMemory/Retain.cs b/src/System.Memory/tests/ReadOnlyMemory/Retain.cs
index 6f31b00cd0..d438c78d77 100644
--- a/src/System.Memory/tests/ReadOnlyMemory/Retain.cs
+++ b/src/System.Memory/tests/ReadOnlyMemory/Retain.cs
@@ -54,6 +54,21 @@ namespace System.MemoryTests
handle.Dispose();
}
+ [Theory]
+ [InlineData(true)]
+ [InlineData(false)]
+ public static void DefaultMemoryRetain(bool pin)
+ {
+ ReadOnlyMemory<int> memory = default;
+ MemoryHandle handle = memory.Retain(pin: pin);
+ Assert.False(handle.HasPointer);
+ unsafe
+ {
+ Assert.True(handle.Pointer == null);
+ }
+ handle.Dispose();
+ }
+
[Fact]
public static void MemoryRetainWithPinningAndSlice()
{
@@ -146,20 +161,5 @@ namespace System.MemoryTests
}
handle.Dispose();
}
-
- [Theory]
- [InlineData(true)]
- [InlineData(false)]
- public static void DefaultMemoryRetain(bool pin)
- {
- ReadOnlyMemory<int> memory = default;
- MemoryHandle handle = memory.Retain(pin: pin);
- Assert.False(handle.HasPointer);
- unsafe
- {
- Assert.True(handle.Pointer == null);
- }
- handle.Dispose();
- }
}
}