From 7e33bc7a473578dfbf6c53b2f70b993ca20706e4 Mon Sep 17 00:00:00 2001 From: Henri Verbeet Date: Thu, 12 Jun 2014 11:52:27 +0200 Subject: [PATCH] ddraw/tests: 64-bit ddraw only has DWORD surface pitch alignment in some cases. --- dlls/ddraw/tests/ddraw1.c | 32 ++++++++++++-------- dlls/ddraw/tests/ddraw2.c | 32 ++++++++++++-------- dlls/ddraw/tests/ddraw4.c | 62 +++++++++++++++++++++------------------ dlls/ddraw/tests/ddraw7.c | 62 +++++++++++++++++++++------------------ 4 files changed, 106 insertions(+), 82 deletions(-) diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index c8f7d6512c0..df74488e112 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -4503,28 +4503,29 @@ static void test_create_surface_pitch(void) DWORD pitch_in; HRESULT hr; DWORD flags_out; - DWORD pitch_out; + DWORD pitch_out32; + DWORD pitch_out64; } test_data[] = { {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0 }, + 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0 }, + 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, - 0, 0 }, + 0, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; @@ -4566,9 +4567,14 @@ static void test_create_surface_pitch(void) ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - ok(U1(surface_desc).lPitch == test_data[i].pitch_out, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out); + if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); IDirectDrawSurface_Release(surface); } diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 23795d349ab..2ca704739d6 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -5579,28 +5579,29 @@ static void test_create_surface_pitch(void) DWORD pitch_in; HRESULT hr; DWORD flags_out; - DWORD pitch_out; + DWORD pitch_out32; + DWORD pitch_out64; } test_data[] = { {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x100}, {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0 }, + 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, + DDSD_PITCH, 0x100, 0x0fc}, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0 }, + 0, 0, 0 }, {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDPARAMS, - 0, 0 }, + 0, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; @@ -5642,9 +5643,14 @@ static void test_create_surface_pitch(void) ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - ok(U1(surface_desc).lPitch == test_data[i].pitch_out, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out); + if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); IDirectDrawSurface_Release(surface); } diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 464d95597d2..ec53ae667f2 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -6474,34 +6474,35 @@ static void test_create_surface_pitch(void) DWORD pitch_in; HRESULT hr; DWORD flags_out; - DWORD pitch_out; + DWORD pitch_out32; + DWORD pitch_out64; } test_data[] = { - {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, - 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, - DDSD_PITCH, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, - 0, 0 }, + {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, + DDSD_PITCH, 0x0fc, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, + 0, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; @@ -6543,9 +6544,14 @@ static void test_create_surface_pitch(void) ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - ok(U1(surface_desc).lPitch == test_data[i].pitch_out, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out); + if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); IDirectDrawSurface4_Release(surface); } diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 1c5bc1d64b9..c90d89b3dc6 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -6297,34 +6297,35 @@ static void test_create_surface_pitch(void) DWORD pitch_in; HRESULT hr; DWORD flags_out; - DWORD pitch_out; + DWORD pitch_out32; + DWORD pitch_out64; } test_data[] = { - {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, - 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, - 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, - DDSD_PITCH, 0x100}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, - 0, 0 }, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, - DDSD_PITCH, 0x0fc}, - {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, - 0, 0 }, + {DDSCAPS_VIDEOMEMORY, 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY, DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_VIDEOMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DDERR_INVALIDCAPS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, 0, 0, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x104, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_PITCH, 0x0f8, DD_OK, + DDSD_PITCH, 0x100, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE, 0, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x100, DD_OK, + DDSD_PITCH, 0x100, 0x100}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fe, DDERR_INVALIDPARAMS, + 0, 0, 0 }, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0fc, DD_OK, + DDSD_PITCH, 0x0fc, 0x0fc}, + {DDSCAPS_SYSTEMMEMORY, DDSD_LPSURFACE | DDSD_PITCH, 0x0f8, DDERR_INVALIDPARAMS, + 0, 0, 0 }, }; DWORD flags_mask = DDSD_PITCH | DDSD_LPSURFACE; @@ -6366,9 +6367,14 @@ static void test_create_surface_pitch(void) ok((surface_desc.dwFlags & flags_mask) == test_data[i].flags_out, "Test %u: Got unexpected flags %#x, expected %#x.\n", i, surface_desc.dwFlags & flags_mask, test_data[i].flags_out); - ok(U1(surface_desc).lPitch == test_data[i].pitch_out, - "Test %u: Got unexpected pitch %u, expected %u.\n", - i, U1(surface_desc).lPitch, test_data[i].pitch_out); + if (sizeof(void *) != sizeof(DWORD) && test_data[i].pitch_out32 != test_data[i].pitch_out64) + todo_wine ok(U1(surface_desc).lPitch == test_data[i].pitch_out64, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out64); + else + ok(U1(surface_desc).lPitch == test_data[i].pitch_out32, + "Test %u: Got unexpected pitch %u, expected %u.\n", + i, U1(surface_desc).lPitch, test_data[i].pitch_out32); IDirectDrawSurface7_Release(surface); }