From: Mohamad Al-Jaf mohamadaljaf@gmail.com
--- dlls/dxcore/tests/dxcore.c | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+)
diff --git a/dlls/dxcore/tests/dxcore.c b/dlls/dxcore/tests/dxcore.c index c50bf1aa999..00c441732f0 100644 --- a/dlls/dxcore/tests/dxcore.c +++ b/dlls/dxcore/tests/dxcore.c @@ -46,6 +46,8 @@ static void test_DXCoreCreateAdapterFactory(void) IDXCoreAdapterFactory *adapter_factory = (void *)0xdeadbeef; IDXCoreAdapterList *adapter_list2 = (void *)0xdeadbeef; IDXCoreAdapterList *adapter_list = (void *)0xdeadbeef; + IDXCoreAdapter *adapter2 = (void *)0xdeadbeef; + IDXCoreAdapter *adapter = (void *)0xdeadbeef; uint32_t adapter_count = 0; HRESULT hr; LONG ref; @@ -100,6 +102,39 @@ static void test_DXCoreCreateAdapterFactory(void) adapter_count = IDXCoreAdapterList_GetAdapterCount( adapter_list ); ok( adapter_count != 0, "IDXCoreAdapterList_GetAdapterCount returned 0.\n" );
+ hr = IDXCoreAdapterList_GetAdapter( adapter_list, 0xdeadbeef, &IID_IDXCoreAdapter, NULL ); + todo_wine + ok( hr == E_POINTER, "got hr %#lx.\n", hr ); + hr = IDXCoreAdapterList_GetAdapter( adapter_list, adapter_count, &IID_IDXCoreAdapter, (void **)&adapter ); + todo_wine + ok( hr == E_INVALIDARG, "got hr %#lx.\n", hr ); + todo_wine + ok( adapter == NULL, "got adapter %p.\n", adapter ); + hr = IDXCoreAdapterList_GetAdapter( adapter_list, 0, &IID_IDXCoreAdapterList, (void **)&adapter ); + todo_wine + ok( hr == E_NOINTERFACE, "got hr %#lx.\n", hr ); + + hr = IDXCoreAdapterList_GetAdapter( adapter_list, 0, &IID_IDXCoreAdapter, (void **)&adapter ); + todo_wine + ok( hr == S_OK, "got hr %#lx.\n", hr ); + if (SUCCEEDED(hr)) + { + hr = IDXCoreAdapterList_GetAdapter( adapter_list, 0, &IID_IDXCoreAdapter, (void **)&adapter2 ); + todo_wine + ok( hr == S_OK, "got hr %#lx.\n", hr ); + ok( adapter == adapter2, "got adapter %p, adapter2 %p.\n", adapter, adapter2 ); + ref = IDXCoreAdapter_Release( adapter2 ); + todo_wine + ok( ref == 3, "got ref %ld.\n", ref ); + + check_interface( adapter, &IID_IAgileObject, FALSE ); + check_interface( adapter, &IID_IDXCoreAdapterList, FALSE ); + check_interface( adapter, &IID_IDXCoreAdapterFactory, FALSE ); + + ref = IDXCoreAdapter_Release( adapter ); + todo_wine + ok( ref == 2, "got ref %ld.\n", ref ); + } ref = IDXCoreAdapterList_Release( adapter_list ); ok( ref == 0, "got ref %ld.\n", ref ); ref = IDXCoreAdapterFactory_Release( adapter_factory );