ddraw/tests: 64-bit ddraw doesn't support textures.

Signed-off-by: Henri Verbeet <hverbeet@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
Henri Verbeet 2015-12-01 11:25:43 +01:00 committed by Alexandre Julliard
parent 7e01f865ab
commit 2dca999e33
1 changed files with 26 additions and 11 deletions

View File

@ -24,6 +24,7 @@
#include "d3d.h" #include "d3d.h"
static HRESULT (WINAPI *pDirectDrawCreateEx)(GUID *guid, void **ddraw, REFIID iid, IUnknown *outer_unknown); static HRESULT (WINAPI *pDirectDrawCreateEx)(GUID *guid, void **ddraw, REFIID iid, IUnknown *outer_unknown);
static BOOL is_ddraw64 = sizeof(DWORD) != sizeof(DWORD *);
static DEVMODEW registry_mode; static DEVMODEW registry_mode;
struct vec2 struct vec2
@ -4669,7 +4670,10 @@ static void test_texturemanage(void)
ddsd.dwHeight = 4; ddsd.dwHeight = 4;
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(hr == tests[i].hr, "Got unexpected, hr %#x, case %u.\n", hr, i); if (tests[i].hr == DD_OK && is_ddraw64 && (tests[i].caps_in & DDSCAPS_TEXTURE))
todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#x.\n", i, hr);
else
ok(hr == tests[i].hr, "Test %u: Got unexpected hr %#x, expected %#x.\n", i, hr, tests[i].hr);
if (FAILED(hr)) if (FAILED(hr))
continue; continue;
@ -6379,13 +6383,12 @@ static void test_set_surface_desc(void)
} }
hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL); hr = IDirectDraw7_CreateSurface(ddraw, &ddsd, &surface, NULL);
ok(SUCCEEDED(hr) || hr == DDERR_NODIRECTDRAWHW, "Failed to create surface, hr %#x.\n", hr); if (is_ddraw64 && (invalid_caps_tests[i].caps & DDSCAPS_TEXTURE))
todo_wine ok(hr == E_NOINTERFACE, "Test %u: Got unexpected hr %#x.\n", i, hr);
else
ok(hr == DD_OK || hr == DDERR_NODIRECTDRAWHW, "Test %u: Got unexpected hr %#x.\n", i, hr);
if (FAILED(hr)) if (FAILED(hr))
{ continue;
skip("Cannot create a %s surface, skipping vidmem SetSurfaceDesc test.\n",
invalid_caps_tests[i].name);
goto done;
}
reset_ddsd(&ddsd); reset_ddsd(&ddsd);
ddsd.dwFlags = DDSD_LPSURFACE; ddsd.dwFlags = DDSD_LPSURFACE;
@ -6410,7 +6413,6 @@ static void test_set_surface_desc(void)
IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(surface);
} }
done:
ref = IDirectDraw7_Release(ddraw); ref = IDirectDraw7_Release(ddraw);
ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref); ok(ref == 0, "Ddraw object not properly released, refcount %u.\n", ref);
DestroyWindow(window); DestroyWindow(window);
@ -7058,7 +7060,8 @@ static void test_private_data(void)
hal_caps.dwSize = sizeof(hal_caps); hal_caps.dwSize = sizeof(hal_caps);
hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL);
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) == (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) == (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)
&& !is_ddraw64)
{ {
reset_ddsd(&surface_desc); reset_ddsd(&surface_desc);
surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_MIPMAPCOUNT; surface_desc.dwFlags = DDSD_CAPS | DDSD_HEIGHT | DDSD_WIDTH | DDSD_MIPMAPCOUNT;
@ -7378,7 +7381,8 @@ static void test_mipmap_lock(void)
hal_caps.dwSize = sizeof(hal_caps); hal_caps.dwSize = sizeof(hal_caps);
hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL);
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)
|| is_ddraw64)
{ {
skip("Mipmapped textures not supported, skipping mipmap lock test.\n"); skip("Mipmapped textures not supported, skipping mipmap lock test.\n");
IDirectDraw7_Release(ddraw); IDirectDraw7_Release(ddraw);
@ -7442,7 +7446,8 @@ static void test_palette_complex(void)
hal_caps.dwSize = sizeof(hal_caps); hal_caps.dwSize = sizeof(hal_caps);
hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL); hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL);
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr); ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) if ((hal_caps.ddsCaps.dwCaps & (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)) != (DDSCAPS_TEXTURE | DDSCAPS_MIPMAP)
|| is_ddraw64)
{ {
skip("Mipmapped textures not supported, skipping mipmap palette test.\n"); skip("Mipmapped textures not supported, skipping mipmap palette test.\n");
IDirectDraw7_Release(ddraw); IDirectDraw7_Release(ddraw);
@ -8381,6 +8386,13 @@ static void test_resource_priority(void)
surface_desc.ddsCaps.dwCaps = test_data[i].caps; surface_desc.ddsCaps.dwCaps = test_data[i].caps;
surface_desc.ddsCaps.dwCaps2 = test_data[i].caps2; surface_desc.ddsCaps.dwCaps2 = test_data[i].caps2;
hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL); hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface, NULL);
if (is_ddraw64 && (test_data[i].caps & DDSCAPS_TEXTURE))
{
todo_wine ok(hr == E_NOINTERFACE, "Got unexpected hr %#x, type %s.\n", hr, test_data[i].name);
if (SUCCEEDED(hr))
IDirectDrawSurface7_Release(surface);
continue;
}
ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, test_data[i].name); ok(SUCCEEDED(hr), "Failed to create surface, hr %#x, type %s.\n", hr, test_data[i].name);
/* Priority == NULL segfaults. */ /* Priority == NULL segfaults. */
@ -8411,6 +8423,9 @@ static void test_resource_priority(void)
IDirectDrawSurface7_Release(surface); IDirectDrawSurface7_Release(surface);
} }
if (is_ddraw64)
goto done;
memset(&surface_desc, 0, sizeof(surface_desc)); memset(&surface_desc, 0, sizeof(surface_desc));
surface_desc.dwSize = sizeof(surface_desc); surface_desc.dwSize = sizeof(surface_desc);
surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT; surface_desc.dwFlags = DDSD_WIDTH | DDSD_HEIGHT | DDSD_CAPS | DDSD_MIPMAPCOUNT;