Add unit test for InteropServices APIs with disposed device
このコミットが含まれているのは:
1 親
1ab3931391
コミット
e045fc2dce
1ファイル変更
+16
-1
@@ -1,4 +1,5 @@
|
||||
using ComputeSharp.Interop;
|
||||
using System;
|
||||
using ComputeSharp.Interop;
|
||||
using ComputeSharp.Tests.Attributes;
|
||||
using ComputeSharp.Tests.Extensions;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
@@ -58,6 +59,20 @@ public class DeviceDisposalTests
|
||||
Assert.AreEqual(refCount, 1u);
|
||||
}
|
||||
|
||||
[CombinatorialTestMethod]
|
||||
[AllDevices]
|
||||
[ExpectedException(typeof(ObjectDisposedException))]
|
||||
public unsafe void DeviceDisposal_InteropServicesThrowsObjectDisposedException(Device device)
|
||||
{
|
||||
using ComPtr<ID3D12Device> d3D12Device = default;
|
||||
|
||||
GraphicsDevice graphicsDevice = device.Get();
|
||||
|
||||
graphicsDevice.Dispose();
|
||||
|
||||
InteropServices.GetID3D12Device(graphicsDevice, Windows.__uuidof<ID3D12Device>(), (void**)d3D12Device.GetAddressOf());
|
||||
}
|
||||
|
||||
[CombinatorialTestMethod]
|
||||
[AllDevices]
|
||||
public unsafe void DeviceDisposal_DisposedResources_ReferenceCounting(Device device)
|
||||
|
||||
新しいイシューから参照
ユーザーをブロックする