Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/ddraw/tests/ddraw1.c | 47 +++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw2.c | 47 +++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw4.c | 47 +++++++++++++++++++++++++++++++++++++++ dlls/ddraw/tests/ddraw7.c | 47 +++++++++++++++++++++++++++++++++++++++ 4 files changed, 188 insertions(+)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index 59d07b7d76fc..9e562de5c44d 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -4991,6 +4991,53 @@ static void test_surface_attachment(void) IDirectDrawSurface_Release(surface2); IDirectDrawSurface_Release(surface1);
+ /* Test depth surfaces of different sizes. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; + U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16; + U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff; + surface_desc.dwWidth = 32; + surface_desc.dwHeight = 32; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface2, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface3, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + hr = IDirectDraw_CreateSurface(ddraw, &surface_desc, &surface4, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface3); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface3); + ok(hr == D3D_OK, "Failed to attach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface_DeleteAttachedSurface(surface1, 0, surface3); + ok(hr == D3D_OK, "Failed to detach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface_Release(surface4); + IDirectDrawSurface_Release(surface3); + IDirectDrawSurface_Release(surface2); + IDirectDrawSurface_Release(surface1); + /* Test DeleteAttachedSurface() and automatic detachment of attached surfaces on release. */ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 8b9b249a3a4e..e4a866e23619 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -6015,6 +6015,53 @@ static void test_surface_attachment(void) IDirectDrawSurface_Release(surface2); IDirectDrawSurface_Release(surface1);
+ /* Test depth surfaces of different sizes. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + surface_desc.ddpfPixelFormat.dwSize = sizeof(surface_desc.ddpfPixelFormat); + surface_desc.ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; + U1(surface_desc.ddpfPixelFormat).dwZBufferBitDepth = 16; + U3(surface_desc.ddpfPixelFormat).dwZBitMask = 0x0000ffff; + surface_desc.dwWidth = 32; + surface_desc.dwHeight = 32; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface2, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface3, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + hr = IDirectDraw2_CreateSurface(ddraw, &surface_desc, &surface4, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IDirectDrawSurface2_DeleteAttachedSurface(surface1, 0, surface3); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface3); + ok(hr == D3D_OK, "Failed to attach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface2_DeleteAttachedSurface(surface1, 0, surface3); + ok(hr == D3D_OK, "Failed to detach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface2_Release(surface4); + IDirectDrawSurface2_Release(surface3); + IDirectDrawSurface2_Release(surface2); + IDirectDrawSurface2_Release(surface1); + /* Test DeleteAttachedSurface() and automatic detachment of attached surfaces on release. */ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index 1c4841891e40..92ca9f6eb4b1 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -7327,6 +7327,53 @@ static void test_surface_attachment(void) IDirectDrawSurface4_Release(surface2); IDirectDrawSurface4_Release(surface1);
+ /* Test depth surfaces of different sizes. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; + U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth = 16; + U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask = 0x0000ffff; + surface_desc.dwWidth = 32; + surface_desc.dwHeight = 32; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface2, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface3, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + hr = IDirectDraw4_CreateSurface(ddraw, &surface_desc, &surface4, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IDirectDrawSurface4_DeleteAttachedSurface(surface1, 0, surface3); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface3); + ok(hr == D3D_OK, "Failed to attach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface4_DeleteAttachedSurface(surface1, 0, surface3); + ok(hr == D3D_OK, "Failed to detach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface4_Release(surface4); + IDirectDrawSurface4_Release(surface3); + IDirectDrawSurface4_Release(surface2); + IDirectDrawSurface4_Release(surface1); + /* Test DeleteAttachedSurface() and automatic detachment of attached surfaces on release. */ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc); diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 9ab8644191f5..ccb22d538823 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -7157,6 +7157,53 @@ static void test_surface_attachment(void) IDirectDrawSurface7_Release(surface2); IDirectDrawSurface7_Release(surface1);
+ /* Test depth surfaces of different sizes. */ + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_OFFSCREENPLAIN | DDSCAPS_3DDEVICE; + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface1, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + memset(&surface_desc, 0, sizeof(surface_desc)); + surface_desc.dwSize = sizeof(surface_desc); + surface_desc.dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT; + surface_desc.ddsCaps.dwCaps = DDSCAPS_ZBUFFER; + U4(surface_desc).ddpfPixelFormat.dwSize = sizeof(U4(surface_desc).ddpfPixelFormat); + U4(surface_desc).ddpfPixelFormat.dwFlags = DDPF_ZBUFFER; + U1(U4(surface_desc).ddpfPixelFormat).dwZBufferBitDepth = 16; + U3(U4(surface_desc).ddpfPixelFormat).dwZBitMask = 0x0000ffff; + surface_desc.dwWidth = 32; + surface_desc.dwHeight = 32; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface2, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 64; + surface_desc.dwHeight = 64; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface3, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + surface_desc.dwWidth = 128; + surface_desc.dwHeight = 128; + hr = IDirectDraw7_CreateSurface(ddraw, &surface_desc, &surface4, NULL); + ok(hr == D3D_OK, "Failed to create surface, hr %#x.\n", hr); + + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface2); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + if (SUCCEEDED(hr)) + IDirectDrawSurface7_DeleteAttachedSurface(surface1, 0, surface3); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface3); + ok(hr == D3D_OK, "Failed to attach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface7_DeleteAttachedSurface(surface1, 0, surface3); + ok(hr == D3D_OK, "Failed to detach depth buffer, hr %#x.\n", hr); + hr = IDirectDrawSurface_AddAttachedSurface(surface1, surface4); + todo_wine ok(hr == DDERR_CANNOTATTACHSURFACE, "Got unexpected hr %#x.\n", hr); + + IDirectDrawSurface7_Release(surface4); + IDirectDrawSurface7_Release(surface3); + IDirectDrawSurface7_Release(surface2); + IDirectDrawSurface7_Release(surface1); + /* Test DeleteAttachedSurface() and automatic detachment of attached surfaces on release. */ memset(&surface_desc, 0, sizeof(surface_desc)); surface_desc.dwSize = sizeof(surface_desc);
Hi,
While running your changed tests on Windows, 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=46163
Your paranoid android.
=== wvistau64 (32 bit report) ===
ddraw: ddraw1.c:2695: Test failed: Expected message 0x46, but didn't receive it. ddraw1.c:2698: Test failed: Expected (0,0)-(640,480), got (0,0)-(1024,768). ddraw1.c:2702: Test failed: Got unexpect screen size 1024x768.
=== wvistau64_he (32 bit report) ===
ddraw: ddraw4.c:3045: Test failed: Expected message 0x46, but didn't receive it. ddraw4.c:3047: Test failed: Expected screen size 1024x768, got 0x0. ddraw4.c:3053: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3083: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3090: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3116: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3139: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3161: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3187: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3207: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3243: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3253: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3279: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3302: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3324: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3350: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3370: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746). ddraw4.c:3407: Test failed: Expected (0,0)-(1024,768), got (-8,-8)-(1032,746).
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)