Add unit test for InteropServices APIs with disposed device

このコミットが含まれているのは:
Sergio Pedri committed 2022-07-31 23:26:12 +02:00
1 親 1ab3931391
コミット e045fc2dce
1ファイル変更
+16 -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)