Module: wine Branch: master Commit: 4b39c46fa2faf922083dc95bc33624901ea42f06 URL: http://source.winehq.org/git/wine.git/?a=commit;h=4b39c46fa2faf922083dc95bc3...
Author: Stefan Dösinger stefan@codeweavers.com Date: Mon Oct 28 23:35:48 2013 +0100
ddraw/tests: Make caps checking in test_rt_caps() less strict.
R200 creates P8 3DDEVICE surfaces in video memory, and consequently returns a different error message when trying to create a device.
---
dlls/ddraw/tests/ddraw1.c | 13 ++++++++----- dlls/ddraw/tests/ddraw2.c | 13 ++++++++----- dlls/ddraw/tests/ddraw4.c | 9 ++++++--- dlls/ddraw/tests/ddraw7.c | 9 ++++++--- 4 files changed, 28 insertions(+), 16 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index de4947b..685b9cd 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -3162,7 +3162,7 @@ static void test_rt_caps(void) { &p8_fmt, DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE, - DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE, + ~0U /* AMD r200 */ , DDERR_NOPALETTEATTACHED, FALSE, }, @@ -3197,14 +3197,14 @@ static void test_rt_caps(void) { NULL, DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER, - DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM, + ~0U /* AMD Evergreen */, DDERR_INVALIDCAPS, FALSE, }, { NULL, DDSCAPS_ZBUFFER, - DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM, + ~0U /* AMD Evergreen */, DDERR_INVALIDCAPS, FALSE, }, @@ -3286,7 +3286,7 @@ static void test_rt_caps(void) 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(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, + 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);
@@ -3298,7 +3298,10 @@ static void test_rt_caps(void) hr = IDirectDrawSurface_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); hr = IDirectDrawSurface_QueryInterface(surface, &IID_IDirect3DHALDevice, (void **)&device); - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + else + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); } if (SUCCEEDED(hr)) { diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index ae498d4..6bb8ffa 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -3770,7 +3770,7 @@ static void test_rt_caps(void) { &p8_fmt, DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE, - DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE, + ~0U /* AMD r200 */, DDERR_NOPALETTEATTACHED, DDERR_INVALIDCAPS, DDERR_INVALIDCAPS, @@ -3815,7 +3815,7 @@ static void test_rt_caps(void) { NULL, DDSCAPS_3DDEVICE | DDSCAPS_ZBUFFER, - DDSCAPS_3DDEVICE | DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM, + ~0U /* AMD Evergreen */, DDERR_INVALIDCAPS, DDERR_INVALIDPIXELFORMAT, DDERR_INVALIDCAPS, @@ -3824,7 +3824,7 @@ static void test_rt_caps(void) { NULL, DDSCAPS_ZBUFFER, - DDSCAPS_VIDEOMEMORY | DDSCAPS_ZBUFFER | DDSCAPS_LOCALVIDMEM, + ~0U /* AMD Evergreen */, DDERR_INVALIDCAPS, DDERR_INVALIDCAPS, DDERR_INVALIDCAPS, @@ -3912,7 +3912,7 @@ static void test_rt_caps(void) 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(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, + 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);
@@ -3926,7 +3926,10 @@ static void test_rt_caps(void) hr = IDirectDrawSurface_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); hr = IDirect3D2_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device); - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + else + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); } IDirectDrawSurface_Release(surface);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index ac885b4..f880f8e 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -4353,7 +4353,7 @@ static void test_rt_caps(void) { &p8_fmt, DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE, - DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE, + ~0U /* AMD r200 */, DDERR_NOPALETTEATTACHED, DDERR_INVALIDCAPS, }, @@ -4470,7 +4470,7 @@ static void test_rt_caps(void) 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(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, + 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);
@@ -4484,7 +4484,10 @@ static void test_rt_caps(void) hr = IDirectDrawSurface4_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); hr = IDirect3D3_CreateDevice(d3d, &IID_IDirect3DHALDevice, surface, &device, NULL); - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + else + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); } IDirectDrawSurface4_Release(surface);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 27555fb..cf69cf9 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -4179,7 +4179,7 @@ static void test_rt_caps(void) { &p8_fmt, DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE, - DDSCAPS_OFFSCREENPLAIN | DDSCAPS_SYSTEMMEMORY | DDSCAPS_3DDEVICE, + ~0U /* AMD r200 */, DDERR_NOPALETTEATTACHED, DDERR_INVALIDCAPS, DDERR_INVALIDCAPS, @@ -4310,7 +4310,7 @@ static void test_rt_caps(void) 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(surface_desc.ddsCaps.dwCaps == test_data[i].caps_out, + 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);
@@ -4324,7 +4324,10 @@ static void test_rt_caps(void) hr = IDirectDrawSurface7_SetPalette(surface, palette); ok(SUCCEEDED(hr), "Test %u: Failed to set palette, hr %#x.\n", i, hr); hr = IDirect3D7_CreateDevice(d3d, devtype, surface, &device); - ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); + if (surface_desc.ddsCaps.dwCaps & DDSCAPS_VIDEOMEMORY) + ok(hr == DDERR_INVALIDPIXELFORMAT, "Test %u: Got unexpected hr %#x.\n", i, hr); + else + ok(hr == D3DERR_SURFACENOTINVIDMEM, "Test %u: Got unexpected hr %#x.\n", i, hr); } IDirectDrawSurface7_Release(surface);