Signed-off-by: Jeff Smith whydoubt@gmail.com --- This series lays some ground-work for testing non-HAL devices, such as RGB, Ramp, and MMX.
dlls/ddraw/tests/ddraw7.c | 28 ++++++++++++++-------------- 1 file changed, 14 insertions(+), 14 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 5c0c5bb7c3..9d3734579e 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -344,10 +344,10 @@ static IDirectDraw7 *create_ddraw(void)
static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7 *desc, void *ctx) { - BOOL *hal_ok = ctx; - if (IsEqualGUID(&desc->deviceGUID, &IID_IDirect3DTnLHalDevice)) + struct { REFCLSID riid; BOOL present; } *device_data = ctx; + if (IsEqualGUID(&desc->deviceGUID, device_data->riid)) { - *hal_ok = TRUE; + device_data->present = TRUE; return DDENUMRET_CANCEL; } return DDENUMRET_OK; @@ -362,7 +362,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) IDirectDraw7 *ddraw; IDirect3D7 *d3d7; HRESULT hr; - BOOL hal_ok = FALSE; + struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; const GUID *devtype = &IID_IDirect3DHALDevice;
if (!(ddraw = create_ddraw())) @@ -402,9 +402,9 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) return NULL; }
- hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &hal_ok); + hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (hal_ok) devtype = &IID_IDirect3DTnLHalDevice; + if (device_data.present) devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt)); hr = IDirect3D7_EnumZBufferFormats(d3d7, devtype, enum_z_fmt, &z_fmt); @@ -5655,7 +5655,7 @@ static void test_rt_caps(void) PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirectDraw7 *ddraw; - BOOL hal_ok = FALSE; + struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; DDPIXELFORMAT z_fmt; IDirect3D7 *d3d; unsigned int i; @@ -5853,10 +5853,10 @@ static void test_rt_caps(void) goto done; }
- hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok); + hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (hal_ok) - devtype = &IID_IDirect3DTnLHalDevice; + if (device_data.present) + devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt)); hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt); @@ -6138,7 +6138,7 @@ static void test_surface_lock(void) DDSURFACEDESC2 ddsd; ULONG refcount; DDPIXELFORMAT z_fmt; - BOOL hal_ok = FALSE; + struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; const GUID *devtype = &IID_IDirect3DHALDevice; D3DDEVICEDESC7 device_desc; BOOL cubemap_supported; @@ -6259,10 +6259,10 @@ static void test_surface_lock(void) goto done; }
- hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &hal_ok); + hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (hal_ok) - devtype = &IID_IDirect3DTnLHalDevice; + if (device_data.present) + devtype = device_data.riid;
memset(&z_fmt, 0, sizeof(z_fmt)); hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt);
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/ddraw/tests/ddraw1.c | 9 +++++++-- dlls/ddraw/tests/ddraw2.c | 9 +++++++-- dlls/ddraw/tests/ddraw4.c | 9 +++++++-- dlls/ddraw/tests/ddraw7.c | 25 +++++++++++++++++++------ 4 files changed, 40 insertions(+), 12 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 5bfca43008..3495939d07 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -513,7 +513,7 @@ static IDirectDraw *create_ddraw(void) return ddraw; }
-static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coop_level) +static IDirect3DDevice *create_device_riid(IDirectDraw *ddraw, HWND window, DWORD coop_level, REFCLSID riid) { /* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask * for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports @@ -573,7 +573,7 @@ static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coo if (FAILED(hr)) continue;
- if (SUCCEEDED(IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device))) + if (SUCCEEDED(IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device))) break;
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds); @@ -583,6 +583,11 @@ static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coo return device; }
+static IDirect3DDevice *create_device(IDirectDraw *ddraw, HWND window, DWORD coop_level) +{ + return create_device_riid(ddraw, window, coop_level, &IID_IDirect3DHALDevice); +} + static IDirect3DViewport *create_viewport(IDirect3DDevice *device, UINT x, UINT y, UINT w, UINT h) { IDirect3DViewport *viewport; diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index b472b3d588..d18bf7da01 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -342,7 +342,7 @@ static IDirectDraw2 *create_ddraw(void) return ddraw2; }
-static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level) +static IDirect3DDevice2 *create_device_riid(IDirectDraw2 *ddraw, HWND window, DWORD coop_level, REFCLSID riid) { /* Prefer 16 bit depth buffers because Nvidia gives us an unpadded D24 buffer if we ask * for 24 bit and handles such buffers incorrectly in DDBLT_DEPTHFILL. AMD only supports @@ -410,7 +410,7 @@ static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD c if (FAILED(hr)) continue;
- if (SUCCEEDED(IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device))) + if (SUCCEEDED(IDirect3D2_CreateDevice(d3d, riid, surface, &device))) break;
IDirectDrawSurface_DeleteAttachedSurface(surface, 0, ds); @@ -421,6 +421,11 @@ static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD c return device; }
+static IDirect3DDevice2 *create_device(IDirectDraw2 *ddraw, HWND window, DWORD coop_level) +{ + return create_device_riid(ddraw, window, coop_level, &IID_IDirect3DHALDevice); +} + static IDirect3DViewport2 *create_viewport(IDirect3DDevice2 *device, UINT x, UINT y, UINT w, UINT h) { IDirect3DViewport2 *viewport; diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 1e6cf4c446..825fc6ef3c 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -330,7 +330,7 @@ static IDirectDraw4 *create_ddraw(void) return ddraw4; }
-static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level) +static IDirect3DDevice3 *create_device_riid(HWND window, DWORD coop_level, REFCLSID riid) { IDirectDrawSurface4 *surface, *ds; IDirect3DDevice3 *device = NULL; @@ -412,7 +412,7 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level) return NULL; }
- hr = IDirect3D3_CreateDevice(d3d3, &IID_IDirect3DHALDevice, surface, &device, NULL); + hr = IDirect3D3_CreateDevice(d3d3, riid, surface, &device, NULL); IDirect3D3_Release(d3d3); IDirectDrawSurface4_Release(surface); if (FAILED(hr)) @@ -421,6 +421,11 @@ static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level) return device; }
+static IDirect3DDevice3 *create_device(HWND window, DWORD coop_level) +{ + return create_device_riid(window, coop_level, &IID_IDirect3DHALDevice); +} + static IDirect3DViewport3 *create_viewport(IDirect3DDevice3 *device, UINT x, UINT y, UINT w, UINT h) { IDirect3DViewport3 *viewport; diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 9d3734579e..1bfe6d2e08 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -353,7 +353,7 @@ static HRESULT WINAPI enum_devtype_cb(char *desc_str, char *name, D3DDEVICEDESC7 return DDENUMRET_OK; }
-static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) +static IDirect3DDevice7 *create_device_riid(HWND window, DWORD coop_level, REFCLSID riid) { IDirectDrawSurface7 *surface, *ds; IDirect3DDevice7 *device = NULL; @@ -362,8 +362,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) IDirectDraw7 *ddraw; IDirect3D7 *d3d7; HRESULT hr; - struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; - const GUID *devtype = &IID_IDirect3DHALDevice; + struct { REFCLSID riid; BOOL present; } device_data = { riid };
if (!(ddraw = create_ddraw())) return NULL; @@ -404,10 +403,15 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level)
hr = IDirect3D7_EnumDevices(d3d7, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (device_data.present) devtype = device_data.riid; + if (!device_data.present) + { + IDirect3D7_Release(d3d7); + IDirectDrawSurface7_Release(surface); + return NULL; + }
memset(&z_fmt, 0, sizeof(z_fmt)); - hr = IDirect3D7_EnumZBufferFormats(d3d7, devtype, enum_z_fmt, &z_fmt); + hr = IDirect3D7_EnumZBufferFormats(d3d7, riid, enum_z_fmt, &z_fmt); if (FAILED(hr) || !z_fmt.dwSize) { IDirect3D7_Release(d3d7); @@ -441,7 +445,7 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) return NULL; }
- hr = IDirect3D7_CreateDevice(d3d7, devtype, surface, &device); + hr = IDirect3D7_CreateDevice(d3d7, riid, surface, &device); IDirect3D7_Release(d3d7); IDirectDrawSurface7_Release(surface); if (FAILED(hr)) @@ -450,6 +454,15 @@ static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) return device; }
+static IDirect3DDevice7 *create_device(HWND window, DWORD coop_level) +{ + IDirect3DDevice7 *device; + device = create_device_riid(window, coop_level, &IID_IDirect3DTnLHalDevice); + if (!device) + device = create_device_riid(window, coop_level, &IID_IDirect3DHALDevice); + return device; +} + struct message { UINT message;
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/ddraw/tests/ddraw1.c | 28 ++++++++++++----------- dlls/ddraw/tests/ddraw2.c | 47 +++++++++++++++++++++------------------ dlls/ddraw/tests/ddraw4.c | 43 ++++++++++++++++++----------------- dlls/ddraw/tests/ddraw7.c | 43 ++++++++++++++++++----------------- 4 files changed, 86 insertions(+), 75 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 3495939d07..86aa68d218 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -3886,6 +3886,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(void) { + const char *device_name = "HAL"; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirect3DDevice *device; @@ -4059,7 +4060,7 @@ static void test_rt_caps(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) { - skip("Failed to create a 3D device, skipping test.\n"); + skip("Failed to create a (%s) 3D device, skipping test.\n", device_name); IDirectDraw_Release(ddraw); DestroyWindow(window); return; @@ -4096,40 +4097,41 @@ static void test_rt_caps(void) surface_desc.dwHeight = 480; hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr) || broken(test_data[i].create_may_fail), - "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr); if (FAILED(hr)) continue;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr); ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, - "Test %u: Got unexpected caps %#x, expected %#x.\n", - i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out); + "Test %s %u: Got unexpected caps %#x, expected %#x.\n", + device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device); - ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].create_device_hr); + ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].create_device_hr); if (hr == DDERR_NOPALETTEATTACHED) { hr = IDirectDrawSurface_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) - ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); } if (SUCCEEDED(hr)) { refcount = IDirect3DDevice_Release(device); - ok(refcount == 1, "Test %u: Got unexpected refcount %u.\n", i, refcount); + ok(refcount == 1, "Test %s %u: Got unexpected refcount %u.\n", device_name, i, refcount); }
refcount = IDirectDrawSurface_Release(surface); - ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n", + device_name, i, refcount); }
IDirectDrawPalette_Release(palette); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index d18bf7da01..71f1413b14 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -4308,6 +4308,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(void) { + const char *device_name = "HAL"; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirect3DDevice2 *device; @@ -4524,7 +4525,7 @@ static void test_rt_caps(void) ok(!!ddraw, "Failed to create a ddraw object.\n"); if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) { - skip("Failed to create a 3D device, skipping test.\n"); + skip("Failed to create a (%s) 3D device, skipping test.\n", device_name); IDirectDraw2_Release(ddraw); DestroyWindow(window); return; @@ -4567,33 +4568,33 @@ static void test_rt_caps(void) surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr) || broken(test_data[i].create_may_fail), - "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr); if (FAILED(hr)) continue;
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr); ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, - "Test %u: Got unexpected caps %#x, expected %#x.\n", - i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out); + "Test %s %u: Got unexpected caps %#x, expected %#x.\n", + device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); - ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].create_device_hr); + ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].create_device_hr); if (FAILED(hr)) { if (hr == DDERR_NOPALETTEATTACHED) { hr = IDirectDrawSurface_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) - ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); } IDirectDrawSurface_Release(surface);
@@ -4604,10 +4605,10 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); - ok(SUCCEEDED(hr), "Test %u: Failed to create device, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr); }
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -4627,13 +4628,13 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &rt, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice2_SetRenderTarget(device, rt, 0); ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr), - "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].set_rt_hr); + "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].set_rt_hr); if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT) expected_rt = rt; else @@ -4644,19 +4645,21 @@ static void test_rt_caps(void) if (hr == DDERR_INVALIDPIXELFORMAT) { refcount = IDirectDrawSurface_AddRef(rt); - ok(refcount == 2, "Test %u: Got unexpected refcount %u.\n", i, refcount); + ok(refcount == 2, "Test %s %u: Got unexpected refcount %u.\n", device_name, i, refcount); }
hr = IDirect3DDevice2_GetRenderTarget(device, &tmp); - ok(SUCCEEDED(hr), "Test %u: Failed to get render target, hr %#x.\n", i, hr); - ok(tmp == expected_rt, "Test %u: Got unexpected rt %p.\n", i, tmp); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get render target, hr %#x.\n", device_name, i, hr); + ok(tmp == expected_rt, "Test %s %u: Got unexpected rt %p.\n", device_name, i, tmp);
IDirectDrawSurface_Release(tmp); IDirectDrawSurface_Release(rt); refcount = IDirect3DDevice2_Release(device); - ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The device was not properly freed, refcount %u.\n", + device_name, i, refcount); refcount = IDirectDrawSurface_Release(surface); - ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n", + device_name, i, refcount); }
IDirectDrawPalette_Release(palette); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 825fc6ef3c..e3299ee643 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -5925,6 +5925,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(void) { + const char *device_name = "HAL"; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirectDraw4 *ddraw; @@ -6156,31 +6157,31 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr);
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr); ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, - "Test %u: Got unexpected caps %#x, expected %#x.\n", - i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out); + "Test %s %u: Got unexpected caps %#x, expected %#x.\n", + device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); - ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].create_device_hr); + ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].create_device_hr); if (FAILED(hr)) { if (hr == DDERR_NOPALETTEATTACHED) { hr = IDirectDrawSurface4_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) - ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); } IDirectDrawSurface4_Release(surface);
@@ -6191,10 +6192,10 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create device, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr); }
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -6209,28 +6210,30 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &rt, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice3_SetRenderTarget(device, rt, 0); ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr), - "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].set_rt_hr); + "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].set_rt_hr); if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT) expected_rt = rt; else expected_rt = surface;
hr = IDirect3DDevice3_GetRenderTarget(device, &tmp); - ok(SUCCEEDED(hr), "Test %u: Failed to get render target, hr %#x.\n", i, hr); - ok(tmp == expected_rt, "Test %u: Got unexpected rt %p.\n", i, tmp); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get render target, hr %#x.\n", device_name, i, hr); + ok(tmp == expected_rt, "Test %s %u: Got unexpected rt %p.\n", device_name, i, tmp);
IDirectDrawSurface4_Release(tmp); IDirectDrawSurface4_Release(rt); refcount = IDirect3DDevice3_Release(device); - ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The device was not properly freed, refcount %u.\n", + device_name, i, refcount); refcount = IDirectDrawSurface4_Release(surface); - ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n", + device_name, i, refcount); }
IDirectDrawPalette_Release(palette); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 1bfe6d2e08..2fcc54283f 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -5664,6 +5664,7 @@ static void test_unsupported_formats(void)
static void test_rt_caps(void) { + const char *device_name = "HAL"; const GUID *devtype = &IID_IDirect3DHALDevice; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; @@ -5902,31 +5903,31 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr);
memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); hr = IDirectDrawSurface7_GetSurfaceDesc(surface, &surface_desc); - ok(SUCCEEDED(hr), "Test %u: Failed to get surface desc, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get surface desc, hr %#x.\n", device_name, i, hr); ok(test_data[i].caps_out == ~0U || surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, - "Test %u: Got unexpected caps %#x, expected %#x.\n", - i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out); + "Test %s %u: Got unexpected caps %#x, expected %#x.\n", + device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); - ok(hr == test_data[i].create_device_hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].create_device_hr); + ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].create_device_hr); if (FAILED(hr)) { if (hr == DDERR_NOPALETTEATTACHED) { hr = IDirectDrawSurface7_SetPalette(surface, palette); - ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) - ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); } IDirectDrawSurface7_Release(surface);
@@ -5937,10 +5938,10 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); - ok(SUCCEEDED(hr), "Test %u: Failed to create device, hr %#x.\n", i, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr); }
memset(&surface_desc, 0, sizeof(surface_desc)); @@ -5955,28 +5956,30 @@ static void test_rt_caps(void) surface_desc.dwWidth = 640; surface_desc.dwHeight = 480; hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &rt, NULL); - ok(SUCCEEDED(hr), "Test %u: Failed to create surface with caps %#x, hr %#x.\n", - i, test_data[i].caps_in, hr); + ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface with caps %#x, hr %#x.\n", + device_name, i, test_data[i].caps_in, hr);
hr = IDirect3DDevice7_SetRenderTarget(device, rt, 0); ok(hr == test_data[i].set_rt_hr || broken(hr == test_data[i].alternative_set_rt_hr), - "Test %u: Got unexpected hr %#x, expected %#x.\n", - i, hr, test_data[i].set_rt_hr); + "Test %s %u: Got unexpected hr %#x, expected %#x.\n", + device_name, i, hr, test_data[i].set_rt_hr); if (SUCCEEDED(hr) || hr == DDERR_INVALIDPIXELFORMAT) expected_rt = rt; else expected_rt = surface;
hr = IDirect3DDevice7_GetRenderTarget(device, &tmp); - ok(SUCCEEDED(hr), "Test %u: Failed to get render target, hr %#x.\n", i, hr); - ok(tmp == expected_rt, "Test %u: Got unexpected rt %p.\n", i, tmp); + ok(SUCCEEDED(hr), "Test %s %u: Failed to get render target, hr %#x.\n", device_name, i, hr); + ok(tmp == expected_rt, "Test %s %u: Got unexpected rt %p.\n", device_name, i, tmp);
IDirectDrawSurface7_Release(tmp); IDirectDrawSurface7_Release(rt); refcount = IDirect3DDevice7_Release(device); - ok(refcount == 0, "Test %u: The device was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The device was not properly freed, refcount %u.\n", + device_name, i, refcount); refcount = IDirectDrawSurface7_Release(surface); - ok(refcount == 0, "Test %u: The surface was not properly freed, refcount %u.\n", i, refcount); + ok(refcount == 0, "Test %s %u: The surface was not properly freed, refcount %u.\n", + device_name, i, refcount); }
IDirectDrawPalette_Release(palette);
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=67600
Your paranoid android.
=== w1064v1809 (32 bit report) ===
ddraw: ddraw1.c:1909: Test failed: Got unexpected color 0x000000ff.
Signed-off-by: Jeff Smith whydoubt@gmail.com --- dlls/ddraw/tests/ddraw1.c | 14 +++++++++----- dlls/ddraw/tests/ddraw2.c | 16 ++++++++++------ dlls/ddraw/tests/ddraw4.c | 16 ++++++++++------ dlls/ddraw/tests/ddraw7.c | 28 ++++++++++++++++++---------- 4 files changed, 47 insertions(+), 27 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 86aa68d218..1b38c4a05f 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -3884,9 +3884,8 @@ static void test_unsupported_formats(void) DestroyWindow(window); }
-static void test_rt_caps(void) +static void test_rt_caps_riid(REFCLSID riid, const char *device_name) { - const char *device_name = "HAL"; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirect3DDevice *device; @@ -4058,7 +4057,7 @@ static void test_rt_caps(void) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) + if (!(device = create_device_riid(ddraw, window, DDSCL_NORMAL, riid))) { skip("Failed to create a (%s) 3D device, skipping test.\n", device_name); IDirectDraw_Release(ddraw); @@ -4110,14 +4109,14 @@ static void test_rt_caps(void) "Test %s %u: Got unexpected caps %#x, expected %#x.\n", device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device); + hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device); ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", device_name, i, hr, test_data[i].create_device_hr); if (hr == DDERR_NOPALETTEATTACHED) { hr = IDirectDrawSurface_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); - hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device); + hr = IDirectDrawSurface_QueryInterface(surface, riid, (void **)&device); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else @@ -4140,6 +4139,11 @@ static void test_rt_caps(void) DestroyWindow(window); }
+static void test_rt_caps(void) +{ + test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL"); +} + static void test_primary_caps(void) { const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY; diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 71f1413b14..a8c14fbcad 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -4306,9 +4306,8 @@ static void test_unsupported_formats(void) DestroyWindow(window); }
-static void test_rt_caps(void) +static void test_rt_caps_riid(REFCLSID riid, const char *device_name) { - const char *device_name = "HAL"; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirect3DDevice2 *device; @@ -4523,7 +4522,7 @@ static void test_rt_caps(void) window = create_window(); ddraw = create_ddraw(); ok(!!ddraw, "Failed to create a ddraw object.\n"); - if (!(device = create_device(ddraw, window, DDSCL_NORMAL))) + if (!(device = create_device_riid(ddraw, window, DDSCL_NORMAL, riid))) { skip("Failed to create a (%s) 3D device, skipping test.\n", device_name); IDirectDraw2_Release(ddraw); @@ -4581,7 +4580,7 @@ static void test_rt_caps(void) "Test %s %u: Got unexpected caps %#x, expected %#x.\n", device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); + hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device); ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", device_name, i, hr, test_data[i].create_device_hr); if (FAILED(hr)) @@ -4590,7 +4589,7 @@ static void test_rt_caps(void) { hr = IDirectDrawSurface_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); - hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); + hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else @@ -4607,7 +4606,7 @@ static void test_rt_caps(void) hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); + hr = IDirect3D2_CreateDevice(d3d, riid, surface, &device); ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr); }
@@ -4671,6 +4670,11 @@ done: DestroyWindow(window); }
+static void test_rt_caps(void) +{ + test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL"); +} + static void test_primary_caps(void) { const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY; diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index e3299ee643..392ce1093c 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -5923,9 +5923,8 @@ static void test_unsupported_formats(void) DestroyWindow(window); }
-static void test_rt_caps(void) +static void test_rt_caps_riid(REFCLSID riid, const char *device_name) { - const char *device_name = "HAL"; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirectDraw4 *ddraw; @@ -6127,7 +6126,7 @@ static void test_rt_caps(void) }
memset(&z_fmt, 0, sizeof(z_fmt)); - hr = IDirect3D3_EnumZBufferFormats(d3d, &IID_IDirect3DHALDevice, enum_z_fmt, &z_fmt); + hr = IDirect3D3_EnumZBufferFormats(d3d, riid, enum_z_fmt, &z_fmt); if (FAILED(hr) || !z_fmt.dwSize) { skip("No depth buffer formats available, skipping test.\n"); @@ -6168,7 +6167,7 @@ static void test_rt_caps(void) "Test %s %u: Got unexpected caps %#x, expected %#x.\n", device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); + hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL); ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", device_name, i, hr, test_data[i].create_device_hr); if (FAILED(hr)) @@ -6177,7 +6176,7 @@ static void test_rt_caps(void) { hr = IDirectDrawSurface4_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); - hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); + hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else @@ -6194,7 +6193,7 @@ static void test_rt_caps(void) hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); + hr = IDirect3D3_CreateDevice(d3d, riid, surface, &device, NULL); ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr); }
@@ -6245,6 +6244,11 @@ done: DestroyWindow(window); }
+static void test_rt_caps(void) +{ + test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL"); +} + static void test_primary_caps(void) { const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY; diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 2fcc54283f..ca14be85cb 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -5662,14 +5662,12 @@ static void test_unsupported_formats(void) DestroyWindow(window); }
-static void test_rt_caps(void) +static void test_rt_caps_riid(REFCLSID riid, const char *device_name) { - const char *device_name = "HAL"; - const GUID *devtype = &IID_IDirect3DHALDevice; PALETTEENTRY palette_entries[256]; IDirectDrawPalette *palette; IDirectDraw7 *ddraw; - struct { REFCLSID riid; BOOL present; } device_data = { &IID_IDirect3DTnLHalDevice }; + struct { REFCLSID riid; BOOL present; } device_data = { riid }; DDPIXELFORMAT z_fmt; IDirect3D7 *d3d; unsigned int i; @@ -5869,11 +5867,15 @@ static void test_rt_caps(void)
hr = IDirect3D7_EnumDevices(d3d, enum_devtype_cb, &device_data); ok(SUCCEEDED(hr), "Failed to enumerate devices, hr %#x.\n", hr); - if (device_data.present) - devtype = device_data.riid; + if (!device_data.present) + { + skip("Failed to enumerate %s device, skipping test.\n", device_name); + IDirect3D7_Release(d3d); + goto done; + }
memset(&z_fmt, 0, sizeof(z_fmt)); - hr = IDirect3D7_EnumZBufferFormats(d3d, devtype, enum_z_fmt, &z_fmt); + hr = IDirect3D7_EnumZBufferFormats(d3d, riid, enum_z_fmt, &z_fmt); if (FAILED(hr) || !z_fmt.dwSize) { skip("No depth buffer formats available, skipping test.\n"); @@ -5914,7 +5916,7 @@ static void test_rt_caps(void) "Test %s %u: Got unexpected caps %#x, expected %#x.\n", device_name, i, surface_desc.ddsCaps.dwCaps, test_data[i].caps_out);
- hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); + hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device); ok(hr == test_data[i].create_device_hr, "Test %s %u: Got unexpected hr %#x, expected %#x.\n", device_name, i, hr, test_data[i].create_device_hr); if (FAILED(hr)) @@ -5923,7 +5925,7 @@ static void test_rt_caps(void) { hr = IDirectDrawSurface7_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %s %u: Failed to set palette, hr %#x.\n", device_name, i, hr); - hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); + hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device); if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %s %u: Got unexpected hr %#x.\n", device_name, i, hr); else @@ -5940,7 +5942,7 @@ static void test_rt_caps(void) hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); ok(SUCCEEDED(hr), "Test %s %u: Failed to create surface, hr %#x.\n", device_name, i, hr);
- hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); + hr = IDirect3D7_CreateDevice(d3d, riid, surface, &device); ok(SUCCEEDED(hr), "Test %s %u: Failed to create device, hr %#x.\n", device_name, i, hr); }
@@ -5991,6 +5993,12 @@ done: DestroyWindow(window); }
+static void test_rt_caps(void) +{ + test_rt_caps_riid(&IID_IDirect3DTnLHalDevice, "TnLHal"); + test_rt_caps_riid(&IID_IDirect3DHALDevice, "HAL"); +} + static void test_primary_caps(void) { const DWORD placement = DDSCAPS_LOCALVIDMEM | DDSCAPS_VIDEOMEMORY | DDSCAPS_SYSTEMMEMORY;
Hi,
While running your changed tests, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=67601
Your paranoid android.
=== w864 (32 bit report) ===
ddraw: ddraw1.c:11165: Test failed: Got unexpected color 0x00ffffff.
=== w1064v1809_2scr (32 bit report) ===
ddraw: ddraw1.c:1909: Test failed: Got unexpected color 0x000000ff.