Commit 0868bed1 authored by Zhiyi Zhang's avatar Zhiyi Zhang Committed by Alexandre Julliard

ddraw/tests: Add more capability tests for enumerated devices.

Add tests for D3DDEVCAPS_HWTRANSFORMANDLIGHT and D3DDEVCAPS_DRAWPRIMITIVES2EX. Signed-off-by: 's avatarZhiyi Zhang <zzhang@codeweavers.com>
parent 3c899df3
......@@ -15173,6 +15173,19 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags);
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid))
{
......@@ -15181,6 +15194,17 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT,
"HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid))
{
......@@ -15201,6 +15225,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid))
{
......@@ -15228,6 +15261,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid))
{
......@@ -15254,6 +15296,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else
{
......
......@@ -16119,6 +16119,19 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags);
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid))
{
......@@ -16127,6 +16140,17 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT,
"HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid))
{
......@@ -16147,6 +16171,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid))
{
......@@ -16174,6 +16207,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid))
{
......@@ -16200,6 +16242,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else
{
......
......@@ -19188,6 +19188,19 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "RGB Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "RGB Device hel caps has hardware flags %#lx\n", hel->dwFlags);
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DHALDevice, guid))
{
......@@ -19196,6 +19209,17 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags != 0, "HAL Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "HAL Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok(hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT,
"HAL Device hal device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"HAL Device hal device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
todo_wine
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DRefDevice, guid))
{
......@@ -19216,6 +19240,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
ok(hel->dpcTriCaps.dwTextureCaps & D3DPTEXTURECAPS_PERSPECTIVE,
"REF Device hel tri caps does not have D3DPTEXTURECAPS_PERSPECTIVE set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"REF Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"REF Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DRampDevice, guid))
{
......@@ -19243,6 +19276,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "Ramp Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "Ramp Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"Ramp Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if(IsEqualGUID(&IID_IDirect3DMMXDevice, guid))
{
......@@ -19269,6 +19311,15 @@ static HRESULT WINAPI test_enum_devices_caps_callback(GUID *guid, char *device_d
ok(hal->dwFlags == 0, "MMX Device hal caps has hardware flags %#lx\n", hal->dwFlags);
ok(hel->dwFlags != 0, "MMX Device hel caps has hardware flags %#lx\n", hel->dwFlags);
ok((hal->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device hal device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"MMX Device hel device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok((hal->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device hal device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
ok((hel->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"MMX Device hel device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else
{
......
......@@ -19390,6 +19390,70 @@ static void test_filling_convention(void)
DestroyWindow(window);
}
static HRESULT WINAPI test_enum_devices_caps_callback(char *device_desc, char *device_name,
D3DDEVICEDESC7 *device_desc7, void *ctx)
{
if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DTnLHalDevice))
{
ok(device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT,
"TnLHal Device device caps does not have D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"TnLHal Device device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DHALDevice))
{
todo_wine
ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"HAL Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
ok(device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX,
"HAL Device device caps does not have D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else if (IsEqualGUID(&device_desc7->deviceGUID, &IID_IDirect3DRGBDevice))
{
todo_wine
ok((device_desc7->dwDevCaps & D3DDEVCAPS_HWTRANSFORMANDLIGHT) == 0,
"RGB Device device caps has D3DDEVCAPS_HWTRANSFORMANDLIGHT set\n");
todo_wine
ok((device_desc7->dwDevCaps & D3DDEVCAPS_DRAWPRIMITIVES2EX) == 0,
"RGB Device device caps has D3DDEVCAPS_DRAWPRIMITIVES2EX set\n");
}
else
{
ok(FALSE, "Unexpected device enumerated: \"%s\" \"%s\"\n", device_desc, device_name);
}
return DDENUMRET_OK;
}
static void test_enum_devices(void)
{
IDirectDraw7 *ddraw;
IDirect3D7 *d3d;
ULONG refcount;
HRESULT hr;
ddraw = create_ddraw();
ok(!!ddraw, "Failed to create a ddraw object.\n");
hr = IDirectDraw7_QueryInterface(ddraw, &IID_IDirect3D7, (void **)&d3d);
if (FAILED(hr))
{
skip("D3D interface is not available, skipping test.\n");
IDirectDraw7_Release(ddraw);
return;
}
hr = IDirect3D7_EnumDevices(d3d, NULL, NULL);
ok(hr == DDERR_INVALIDPARAMS, "Got hr %#lx.\n", hr);
hr = IDirect3D7_EnumDevices(d3d, test_enum_devices_caps_callback, NULL);
ok(hr == D3D_OK, "Got hr %#lx.\n", hr);
IDirect3D7_Release(d3d);
refcount = IDirectDraw7_Release(ddraw);
ok(!refcount, "Device has %lu references left.\n", refcount);
}
static void run_for_each_device_type(void (*test_func)(const GUID *))
{
test_func(hw_device_guid);
......@@ -19568,4 +19632,5 @@ START_TEST(ddraw7)
test_get_display_mode();
run_for_each_device_type(test_texture_wrong_caps);
test_filling_convention();
test_enum_devices();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment