From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/dxcore/tests/dxcore.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
diff --git a/dlls/dxcore/tests/dxcore.c b/dlls/dxcore/tests/dxcore.c index 95396b0ad37..56ba85e2832 100644 --- a/dlls/dxcore/tests/dxcore.c +++ b/dlls/dxcore/tests/dxcore.c @@ -44,6 +44,8 @@ static void test_DXCoreCreateAdapterFactory(void) { IDXCoreAdapterFactory *factory2 = (void *)0xdeadbeef; IDXCoreAdapterFactory *factory = (void *)0xdeadbeef; + IDXCoreAdapterList *list2 = (void *)0xdeadbeef; + IDXCoreAdapterList *list = (void *)0xdeadbeef; LONG refcount; HRESULT hr;
@@ -73,6 +75,41 @@ static void test_DXCoreCreateAdapterFactory(void) check_interface(factory, &IID_IDXCoreAdapter, FALSE); check_interface(factory, &IID_IDXCoreAdapterList, FALSE);
+ hr = IDXCoreAdapterFactory_CreateAdapterList(factory, 0, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterList, (void **)&list); + todo_wine + ok(hr == E_INVALIDARG, "got hr %#lx.\n", hr); + todo_wine + ok(list == NULL, "got list %p.\n", list); + hr = IDXCoreAdapterFactory_CreateAdapterList(factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterFactory, (void **)&list); + todo_wine + ok(hr == E_NOINTERFACE, "got hr %#lx.\n", hr); + hr = IDXCoreAdapterFactory_CreateAdapterList(factory, 1, NULL, &IID_IDXCoreAdapterFactory, (void **)&list); + todo_wine + ok(hr == E_INVALIDARG, "got hr %#lx.\n", hr); + hr = IDXCoreAdapterFactory_CreateAdapterList(factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterFactory, NULL); + todo_wine + ok(hr == E_POINTER, "got hr %#lx.\n", hr); + + hr = IDXCoreAdapterFactory_CreateAdapterList(factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterList, (void **)&list); + todo_wine + ok(hr == S_OK, "got hr %#lx.\n", hr); + hr = IDXCoreAdapterFactory_CreateAdapterList(factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterList, (void **)&list2); + todo_wine + ok(hr == S_OK, "got hr %#lx.\n", hr); + todo_wine + ok(list != list2, "got same list %p, list2 %p.\n", list, list); + if (SUCCEEDED(hr)) + { + refcount = IDXCoreAdapterList_Release(list2); + ok(refcount == 0, "got refcount %ld.\n", refcount); + + check_interface(list, &IID_IAgileObject, FALSE); + check_interface(list, &IID_IDXCoreAdapter, FALSE); + check_interface(list, &IID_IDXCoreAdapterFactory, FALSE); + + refcount = IDXCoreAdapterList_Release(list); + ok(refcount == 0, "got refcount %ld.\n", refcount); + } refcount = IDXCoreAdapterFactory_Release(factory); ok(refcount == 0, "got refcount %ld.\n", refcount); }