コード例 #1
0
ファイル: SafeHandleTests.cs プロジェクト: z77ma/runtime
 public void ByRefSameValue_UsesSameHandleInstance()
 {
     using NativeExportsNE.NativeExportsSafeHandle handleToDispose = NativeExportsNE.AllocateHandle();
     NativeExportsNE.NativeExportsSafeHandle handle = handleToDispose;
     NativeExportsNE.ModifyHandle(ref handle, newHandle: false);
     Assert.Same(handleToDispose, handle);
 }
コード例 #2
0
ファイル: SafeHandleTests.cs プロジェクト: z77ma/runtime
 public void ByRefDifferentValue_UsesNewHandleInstance()
 {
     using NativeExportsNE.NativeExportsSafeHandle handleToDispose = NativeExportsNE.AllocateHandle();
     NativeExportsNE.NativeExportsSafeHandle handle = handleToDispose;
     NativeExportsNE.ModifyHandle(ref handle, newHandle: true);
     Assert.NotSame(handleToDispose, handle);
     handle.Dispose();
 }