aboutsummaryrefslogtreecommitdiff
path: root/lib/Utils/tests
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Utils/tests')
-rw-r--r--lib/Utils/tests/IO/VnMemoryStreamTests.cs4
-rw-r--r--lib/Utils/tests/Memory/NativeHeapTests.cs7
2 files changed, 5 insertions, 6 deletions
diff --git a/lib/Utils/tests/IO/VnMemoryStreamTests.cs b/lib/Utils/tests/IO/VnMemoryStreamTests.cs
index 3eb95ce..9742197 100644
--- a/lib/Utils/tests/IO/VnMemoryStreamTests.cs
+++ b/lib/Utils/tests/IO/VnMemoryStreamTests.cs
@@ -23,7 +23,7 @@ namespace VNLib.Utils.IO.Tests
}
//Test heap
- IUnmangedHeap privateHeap = MemoryUtil.InitializeNewHeapForProcess();
+ using IUnmangedHeap privateHeap = MemoryUtil.InitializeNewHeapForProcess();
using (VnMemoryStream vms = new(privateHeap, 1024, false))
{
@@ -38,7 +38,7 @@ namespace VNLib.Utils.IO.Tests
//Create from mem handle
MemoryHandle<byte> handle = privateHeap.Alloc<byte>(byte.MaxValue);
- using (VnMemoryStream vms = VnMemoryStream.ConsumeHandle(handle, handle.GetIntLength(), false))
+ using (VnMemoryStream vms = VnMemoryStream.FromHandle(handle, true, handle.GetIntLength(), false))
{
Assert.IsTrue(vms.Length == byte.MaxValue);
Assert.IsTrue(vms.Position == 0);
diff --git a/lib/Utils/tests/Memory/NativeHeapTests.cs b/lib/Utils/tests/Memory/NativeHeapTests.cs
index dde12cd..291faa5 100644
--- a/lib/Utils/tests/Memory/NativeHeapTests.cs
+++ b/lib/Utils/tests/Memory/NativeHeapTests.cs
@@ -10,10 +10,10 @@ namespace VNLib.Utils.Memory.Tests
const string RpMallocLibPath = "../../../../../Utils.Memory/vnlib_rpmalloc/build/Debug/vnlib_rpmalloc.dll";
[TestMethod()]
- public void LoadHeapTest()
+ public void LoadInTreeRpmallocTest()
{
- //Try to load the global heap
- using NativeHeap heap = NativeHeap.LoadHeap(RpMallocLibPath, System.Runtime.InteropServices.DllImportSearchPath.SafeDirectories, HeapCreation.None, 0);
+ //Try to load the shared heap
+ using NativeHeap heap = NativeHeap.LoadHeap(RpMallocLibPath, System.Runtime.InteropServices.DllImportSearchPath.SafeDirectories, HeapCreation.Shared, 0);
Assert.IsFalse(heap.IsInvalid);
@@ -26,7 +26,6 @@ namespace VNLib.Utils.Memory.Tests
//confirm the pointer it zeroed
Assert.IsTrue(block == IntPtr.Zero);
-
}
}
} \ No newline at end of file