public void EnsureMemoryCleaned() { var x = new DisposableUnmanagedComMemory(sizeof(int)); Marshal.WriteInt32(x.Handler, 42); x.Dispose(); Assert.AreEqual(x.Handler, IntPtr.Zero); }
public void SuccessUsageOfComAllocator() { var x = new DisposableUnmanagedComMemory(sizeof(int)); Marshal.WriteInt32(x.Handler, 42); var result = Marshal.ReadInt32(x.Handler); x.Dispose(); Assert.AreEqual(result, 42); }