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.
This commit is contained in:
Stefan Dösinger 2013-10-28 23:35:48 +01:00 committed by Alexandre Julliard
parent 3fafd37905
commit 4b39c46fa2
4 changed files with 28 additions and 16 deletions

View File

@ -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))
{

View File

@ -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);

View File

@ -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);

View File

@ -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);