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 58424ee8b56..f41e3e21d69 100644 --- a/dlls/dxcore/tests/dxcore.c +++ b/dlls/dxcore/tests/dxcore.c @@ -44,6 +44,8 @@ static void test_DXCoreCreateAdapterFactory(void) { IDXCoreAdapterFactory *adapter_factory2 = (void *)0xdeadbeef; IDXCoreAdapterFactory *adapter_factory = (void *)0xdeadbeef; + IDXCoreAdapterList *adapter_list2 = (void *)0xdeadbeef; + IDXCoreAdapterList *adapter_list = (void *)0xdeadbeef; HRESULT hr; LONG ref;
@@ -72,6 +74,41 @@ static void test_DXCoreCreateAdapterFactory(void) check_interface( adapter_factory, &IID_IDXCoreAdapter, FALSE ); check_interface( adapter_factory, &IID_IDXCoreAdapterList, FALSE );
+ hr = IDXCoreAdapterFactory_CreateAdapterList( adapter_factory, 0, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterList, (void **)&adapter_list ); + todo_wine + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + todo_wine + ok( adapter_list == NULL, "got adapter_list %p.\n", adapter_list ); + hr = IDXCoreAdapterFactory_CreateAdapterList( adapter_factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterFactory, (void **)&adapter_list ); + todo_wine + ok( hr == E_NOINTERFACE, "got hr %#lx.\n", hr ); + hr = IDXCoreAdapterFactory_CreateAdapterList( adapter_factory, 1, NULL, &IID_IDXCoreAdapterFactory, (void **)&adapter_list ); + todo_wine + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + hr = IDXCoreAdapterFactory_CreateAdapterList( adapter_factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterFactory, NULL ); + todo_wine + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + + hr = IDXCoreAdapterFactory_CreateAdapterList( adapter_factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterList, (void **)&adapter_list ); + todo_wine + ok( hr == S_OK, "got hr %#lx.\n", hr ); + hr = IDXCoreAdapterFactory_CreateAdapterList( adapter_factory, 1, &DXCORE_ADAPTER_ATTRIBUTE_D3D12_GRAPHICS, &IID_IDXCoreAdapterList, (void **)&adapter_list2 ); + todo_wine + ok( hr == S_OK, "got hr %#lx.\n", hr ); + todo_wine + ok( adapter_list != adapter_list2, "got same adapter_list %p, adapter_list2 %p.\n", adapter_list, adapter_list ); + if (SUCCEEDED(hr)) + { + ref = IDXCoreAdapterList_Release( adapter_list2 ); + ok( ref == 0, "got ref %ld.\n", ref ); + + check_interface( adapter_list, &IID_IAgileObject, FALSE ); + check_interface( adapter_list, &IID_IDXCoreAdapter, FALSE ); + check_interface( adapter_list, &IID_IDXCoreAdapterFactory, FALSE ); + + ref = IDXCoreAdapterList_Release( adapter_list ); + ok( ref == 0, "got ref %ld.\n", ref ); + } ref = IDXCoreAdapterFactory_Release( adapter_factory ); ok( ref == 0, "got ref %ld.\n", ref ); }