mirror of
git://source.winehq.org/git/wine.git
synced 2024-09-06 05:50:37 +00:00
dxgi/tests: Also test for ID3D10Device1 and ID3D11Device in test_device_interfaces().
This commit is contained in:
parent
e806b5bab9
commit
2be432b4df
|
@ -21,54 +21,6 @@
|
|||
#include "d3d10.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
static ID3D10Device *create_device(void)
|
||||
{
|
||||
ID3D10Device *device;
|
||||
|
||||
if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_HARDWARE, NULL, 0, D3D10_SDK_VERSION, &device)))
|
||||
return device;
|
||||
if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_WARP, NULL, 0, D3D10_SDK_VERSION, &device)))
|
||||
return device;
|
||||
if (SUCCEEDED(D3D10CreateDevice(NULL, D3D10_DRIVER_TYPE_REFERENCE, NULL, 0, D3D10_SDK_VERSION, &device)))
|
||||
return device;
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
static void test_device_interfaces(void)
|
||||
{
|
||||
ID3D10Device *device;
|
||||
ULONG refcount;
|
||||
IUnknown *obj;
|
||||
HRESULT hr;
|
||||
|
||||
device = create_device();
|
||||
if (!device)
|
||||
{
|
||||
skip("Failed to create device, skipping tests\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IUnknown, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement IUnknown (%#x)\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement ID3D10Device (%#x)\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject (%#x)\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice (%#x)\n", hr);
|
||||
|
||||
refcount = ID3D10Device_Release(device);
|
||||
ok(!refcount, "Device has %u references left\n", refcount);
|
||||
}
|
||||
|
||||
static void test_stateblock_mask(void)
|
||||
{
|
||||
static const struct
|
||||
|
@ -229,6 +181,5 @@ static void test_stateblock_mask(void)
|
|||
|
||||
START_TEST(device)
|
||||
{
|
||||
test_device_interfaces();
|
||||
test_stateblock_mask();
|
||||
}
|
||||
|
|
|
@ -35,39 +35,6 @@ static ID3D10Device *create_device(void)
|
|||
return NULL;
|
||||
}
|
||||
|
||||
static void test_device_interfaces(void)
|
||||
{
|
||||
ID3D10Device *device;
|
||||
ULONG refcount;
|
||||
IUnknown *obj;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(device = create_device()))
|
||||
{
|
||||
skip("Failed to create device, skipping tests.\n");
|
||||
return;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IUnknown, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement IUnknown\n");
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIObject, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIObject\n");
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement IDXGIDevice\n");
|
||||
|
||||
if (SUCCEEDED(hr = ID3D10Device_QueryInterface(device, &IID_ID3D10Device, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "ID3D10Device does not implement ID3D10Device\n");
|
||||
|
||||
refcount = ID3D10Device_Release(device);
|
||||
ok(!refcount, "Device has %u references left\n", refcount);
|
||||
}
|
||||
|
||||
static void test_create_texture2d(void)
|
||||
{
|
||||
D3D10_TEXTURE2D_DESC desc;
|
||||
|
@ -761,7 +728,6 @@ static void test_create_predicate(void)
|
|||
|
||||
START_TEST(device)
|
||||
{
|
||||
test_device_interfaces();
|
||||
test_create_texture2d();
|
||||
test_create_texture3d();
|
||||
test_create_depthstencil_view();
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
|
||||
#define COBJMACROS
|
||||
#include "initguid.h"
|
||||
#include "d3d10.h"
|
||||
#include "d3d11.h"
|
||||
#include "wine/test.h"
|
||||
|
||||
static HRESULT (WINAPI *pCreateDXGIFactory1)(REFIID iid, void **factory);
|
||||
|
@ -49,8 +49,8 @@ success:
|
|||
static void test_device_interfaces(void)
|
||||
{
|
||||
IDXGIDevice *device;
|
||||
IUnknown *iface;
|
||||
ULONG refcount;
|
||||
IUnknown *obj;
|
||||
HRESULT hr;
|
||||
|
||||
if (!(device = create_device()))
|
||||
|
@ -59,21 +59,31 @@ static void test_device_interfaces(void)
|
|||
return;
|
||||
}
|
||||
|
||||
if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "IDXGIDevice does not implement IUnknown\n");
|
||||
hr = IDXGIDevice_QueryInterface(device, &IID_IUnknown, (void **)&iface);
|
||||
ok(SUCCEEDED(hr), "Failed to query IUnknown interface, hr %#x.\n", hr);
|
||||
IUnknown_Release(iface);
|
||||
|
||||
if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIObject, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "IDXGIDevice does not implement IDXGIObject\n");
|
||||
hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIObject, (void **)&iface);
|
||||
ok(SUCCEEDED(hr), "Failed to query IDXGIObject interface, hr %#x.\n", hr);
|
||||
IUnknown_Release(iface);
|
||||
|
||||
if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "IDXGIDevice does not implement IDXGIDevice\n");
|
||||
hr = IDXGIDevice_QueryInterface(device, &IID_IDXGIDevice, (void **)&iface);
|
||||
ok(SUCCEEDED(hr), "Failed to query IDXGIDevice interface, hr %#x.\n", hr);
|
||||
IUnknown_Release(iface);
|
||||
|
||||
if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device, (void **)&obj)))
|
||||
IUnknown_Release(obj);
|
||||
ok(SUCCEEDED(hr), "IDXGIDevice does not implement ID3D10Device\n");
|
||||
hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device, (void **)&iface);
|
||||
ok(SUCCEEDED(hr), "Failed to query ID3D10Device interface, hr %#x.\n", hr);
|
||||
IUnknown_Release(iface);
|
||||
|
||||
if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D10Device1, (void **)&iface)))
|
||||
IUnknown_Release(iface);
|
||||
todo_wine ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
|
||||
"Failed to query ID3D10Device1 interface, hr %#x.\n", hr);
|
||||
|
||||
if (SUCCEEDED(hr = IDXGIDevice_QueryInterface(device, &IID_ID3D11Device, (void **)&iface)))
|
||||
IUnknown_Release(iface);
|
||||
todo_wine ok(SUCCEEDED(hr) || broken(hr == E_NOINTERFACE) /* Not available on all Windows versions. */,
|
||||
"Failed to query ID3D11Device interface, hr %#x.\n", hr);
|
||||
|
||||
refcount = IDXGIDevice_Release(device);
|
||||
ok(!refcount, "Device has %u references left.\n", refcount);
|
||||
|
|
Loading…
Reference in a new issue