From: Elizabeth Figura zfigura@codeweavers.com
Fixes: 9fc3862dd4a09a8a457c1c449380e1e122228221 --- dlls/ddraw/tests/ddraw1.c | 105 ++++++++++++++++++---------------- dlls/ddraw/tests/ddraw2.c | 111 +++++++++++++++++++----------------- dlls/ddraw/tests/ddraw4.c | 117 ++++++++++++++++++++------------------ dlls/ddraw/tests/ddraw7.c | 6 +- 4 files changed, 177 insertions(+), 162 deletions(-)
diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c index e3cc346b637..b864e58ab36 100644 --- a/dlls/ddraw/tests/ddraw1.c +++ b/dlls/ddraw/tests/ddraw1.c @@ -20,6 +20,7 @@
#define COBJMACROS
+#include <stdbool.h> #include <stdint.h> #include "wine/test.h" #include <limits.h> @@ -14341,6 +14342,7 @@ static void test_caps(void)
for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { + bool supported = (hal_caps.dwZBufferBitDepths & depth_caps[i].flag); IDirectDrawSurface *surface; DDSURFACEDESC desc = { @@ -14357,8 +14359,7 @@ static void test_caps(void) /* dwZBufferBitDepths sometimes reports false negatives, * but it has not been known to report false positives. */ hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); - ok(hr == S_OK || (!(hal_caps.dwZBufferBitDepths & depth_caps[i].flag) && hr == DDERR_INVALIDPIXELFORMAT), - "Got hr %#lx.\n", hr); + ok(hr == S_OK || (!supported && hr == DDERR_INVALIDPIXELFORMAT), "Got hr %#lx.\n", hr);
if (hr == S_OK) { @@ -14366,7 +14367,7 @@ static void test_caps(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); todo_wine_if (depth_caps[i].depth == 32) ok(desc.ddsCaps.dwCaps == (DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_ZBUFFER) - || (ddraw_is_warp(ddraw) && desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER)), + || (!supported && (desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER))), "Got caps %#lx.\n", desc.ddsCaps.dwCaps); IDirectDrawSurface_Release(surface); } @@ -14397,70 +14398,74 @@ static void test_caps(void) ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); - todo_wine ok(!(hel_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)) + || broken(hel_caps.ddsCaps.dwCaps == caps_hel), /* Windows 8+ */ "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
IDirectDraw_Release(ddraw); }
hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw, NULL); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK || (is_ddraw64 && hr == E_FAIL), "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + hr = IDirectDraw_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
- memset(&hal_caps, 0, sizeof(hal_caps)); - memset(&hel_caps, 0, sizeof(hel_caps)); - hal_caps.dwSize = sizeof(hal_caps); - hel_caps.dwSize = sizeof(hel_caps); - hr = IDirectDraw_GetCaps(ddraw, &hal_caps, &hel_caps); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, - "Got unexpected caps %#lx, expected %#lx.\n", - hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); - ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, - "Got unexpected caps %#lx, expected %#lx.\n", - hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#lx, expected %#lx.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#lx, expected %#lx.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
- todo_wine ok(!(hal_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), - "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); - todo_wine ok(hel_caps.ddsCaps.dwCaps == caps_hel, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(hel_caps.ddsCaps.dwCaps == caps_hel, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
- for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) - { - IDirectDrawSurface *surface; - DDSURFACEDESC desc = + for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { - .dwSize = sizeof(DDSURFACEDESC), - .dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT, - .ddsCaps.dwCaps = DDSCAPS_ZBUFFER, - .dwZBufferBitDepth = depth_caps[i].depth, - .dwWidth = 64, - .dwHeight = 64, - }; + IDirectDrawSurface *surface; + DDSURFACEDESC desc = + { + .dwSize = sizeof(DDSURFACEDESC), + .dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT, + .ddsCaps.dwCaps = DDSCAPS_ZBUFFER, + .dwZBufferBitDepth = depth_caps[i].depth, + .dwWidth = 64, + .dwHeight = 64, + };
- winetest_push_context("depth %u", depth_caps[i].depth); + winetest_push_context("depth %u", depth_caps[i].depth);
- hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); - if (depth_caps[i].depth == 16 || depth_caps[i].depth == 32) - ok(hr == S_OK, "Got hr %#lx.\n", hr); - else - todo_wine ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr); + hr = IDirectDraw_CreateSurface(ddraw, &desc, &surface, NULL); + if (depth_caps[i].depth == 16 || depth_caps[i].depth == 32) + ok(hr == S_OK, "Got hr %#lx.\n", hr); + else + todo_wine ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr);
- if (hr == S_OK) - { - hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine_if (depth_caps[i].depth != 32) - ok(desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER), - "Got caps %#lx.\n", desc.ddsCaps.dwCaps); - IDirectDrawSurface_Release(surface); + if (hr == S_OK) + { + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine_if (depth_caps[i].depth != 32) + ok(desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER), + "Got caps %#lx.\n", desc.ddsCaps.dwCaps); + IDirectDrawSurface_Release(surface); + } + + winetest_pop_context(); }
- winetest_pop_context(); + IDirectDraw_Release(ddraw); }
- IDirectDraw_Release(ddraw); - DestroyWindow(window); }
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c index 7745c0732d8..aaa9fd1cbdd 100644 --- a/dlls/ddraw/tests/ddraw2.c +++ b/dlls/ddraw/tests/ddraw2.c @@ -21,6 +21,7 @@ #include <math.h>
#define COBJMACROS +#include <stdbool.h> #include <stdint.h> #include "wine/test.h" #include <limits.h> @@ -15355,6 +15356,7 @@ static void test_caps(void)
for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { + bool supported = (hal_caps.dwZBufferBitDepths & depth_caps[i].flag); IDirectDrawSurface *surface; DDSURFACEDESC desc = { @@ -15371,8 +15373,7 @@ static void test_caps(void) /* dwZBufferBitDepths sometimes reports false negatives, * but it has not been known to report false positives. */ hr = IDirectDraw2_CreateSurface(ddraw, &desc, &surface, NULL); - ok(hr == S_OK || (!(hal_caps.dwZBufferBitDepths & depth_caps[i].flag) && hr == DDERR_INVALIDPIXELFORMAT), - "Got hr %#lx.\n", hr); + ok(hr == S_OK || (!supported && hr == DDERR_INVALIDPIXELFORMAT), "Got hr %#lx.\n", hr);
if (hr == S_OK) { @@ -15380,7 +15381,7 @@ static void test_caps(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); todo_wine_if (depth_caps[i].depth == 32) ok(desc.ddsCaps.dwCaps == (DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_ZBUFFER) - || (ddraw_is_warp(ddraw) && desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER)), + || (!supported && (desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER))), "Got caps %#lx.\n", desc.ddsCaps.dwCaps); IDirectDrawSurface_Release(surface); } @@ -15414,73 +15415,77 @@ static void test_caps(void) ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); - todo_wine ok(!(hel_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)) + || broken(hel_caps.ddsCaps.dwCaps == caps_hel), /* Windows 8+ */ "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
IDirectDraw2_Release(ddraw); }
hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw1, NULL); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - IDirectDraw_Release(ddraw1); - hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK || (is_ddraw64 && hr == E_FAIL), "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw2, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDraw_Release(ddraw1); + hr = IDirectDraw2_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
- memset(&hal_caps, 0, sizeof(hal_caps)); - memset(&hel_caps, 0, sizeof(hel_caps)); - hal_caps.dwSize = sizeof(hal_caps); - hel_caps.dwSize = sizeof(hel_caps); - hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, &hel_caps); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, - "Got unexpected caps %#lx, expected %#lx.\n", - hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); - ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, - "Got unexpected caps %#lx, expected %#lx.\n", - hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw2_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#lx, expected %#lx.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#lx, expected %#lx.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
- todo_wine ok(!(hal_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), - "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); - todo_wine ok(hel_caps.ddsCaps.dwCaps == caps_hel, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(hel_caps.ddsCaps.dwCaps == caps_hel, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
- for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) - { - IDirectDrawSurface *surface; - DDSURFACEDESC desc = + for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { - .dwSize = sizeof(DDSURFACEDESC), - .dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT, - .ddsCaps.dwCaps = DDSCAPS_ZBUFFER, - .dwZBufferBitDepth = depth_caps[i].depth, - .dwWidth = 64, - .dwHeight = 64, - }; + IDirectDrawSurface *surface; + DDSURFACEDESC desc = + { + .dwSize = sizeof(DDSURFACEDESC), + .dwFlags = DDSD_CAPS | DDSD_ZBUFFERBITDEPTH | DDSD_WIDTH | DDSD_HEIGHT, + .ddsCaps.dwCaps = DDSCAPS_ZBUFFER, + .dwZBufferBitDepth = depth_caps[i].depth, + .dwWidth = 64, + .dwHeight = 64, + };
- winetest_push_context("depth %u", depth_caps[i].depth); + winetest_push_context("depth %u", depth_caps[i].depth);
- hr = IDirectDraw2_CreateSurface(ddraw, &desc, &surface, NULL); - if (depth_caps[i].depth == 16 || depth_caps[i].depth == 32) - ok(hr == S_OK, "Got hr %#lx.\n", hr); - else - todo_wine ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr); + hr = IDirectDraw2_CreateSurface(ddraw, &desc, &surface, NULL); + if (depth_caps[i].depth == 16 || depth_caps[i].depth == 32) + ok(hr == S_OK, "Got hr %#lx.\n", hr); + else + todo_wine ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr);
- if (hr == S_OK) - { - hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine_if (depth_caps[i].depth != 32) - ok(desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER), - "Got caps %#lx.\n", desc.ddsCaps.dwCaps); - IDirectDrawSurface_Release(surface); + if (hr == S_OK) + { + hr = IDirectDrawSurface_GetSurfaceDesc(surface, &desc); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine_if (depth_caps[i].depth != 32) + ok(desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER), + "Got caps %#lx.\n", desc.ddsCaps.dwCaps); + IDirectDrawSurface_Release(surface); + } + + winetest_pop_context(); }
- winetest_pop_context(); + IDirectDraw2_Release(ddraw); }
- IDirectDraw2_Release(ddraw); - DestroyWindow(window); }
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c index b7be97c32bc..6946ca71245 100644 --- a/dlls/ddraw/tests/ddraw4.c +++ b/dlls/ddraw/tests/ddraw4.c @@ -20,6 +20,7 @@
#define COBJMACROS
+#include <stdbool.h> #include <stdint.h> #include "wine/test.h" #include <limits.h> @@ -18096,6 +18097,7 @@ static void test_caps(void)
for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { + bool supported = (hal_caps.dwZBufferBitDepths & depth_caps[i].flag); IDirectDrawSurface4 *surface; DDSURFACEDESC2 desc = { @@ -18115,8 +18117,7 @@ static void test_caps(void) /* dwZBufferBitDepths sometimes reports false negatives, * but it has not been known to report false positives. */ hr = IDirectDraw4_CreateSurface(ddraw, &desc, &surface, NULL); - ok(hr == S_OK || (!(hal_caps.dwZBufferBitDepths & depth_caps[i].flag) && hr == DDERR_INVALIDPIXELFORMAT), - "Got hr %#lx.\n", hr); + ok(hr == S_OK || (!supported && hr == DDERR_INVALIDPIXELFORMAT), "Got hr %#lx.\n", hr);
if (hr == S_OK) { @@ -18124,7 +18125,7 @@ static void test_caps(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); todo_wine_if (depth_caps[i].depth == 32) ok(desc.ddsCaps.dwCaps == (DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_ZBUFFER) - || (ddraw_is_warp(ddraw) && desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER)), + || (!supported && (desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER))), "Got caps %#lx.\n", desc.ddsCaps.dwCaps); IDirectDrawSurface4_Release(surface); } @@ -18158,76 +18159,80 @@ static void test_caps(void) ok(!(hal_caps.ddsCaps.dwCaps & caps_never), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); todo_wine_if(no3d) ok(!(~hal_caps.ddsCaps.dwCaps & caps_always), "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); - todo_wine ok(!(hel_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), + todo_wine ok(!(hel_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)) + || broken(hel_caps.ddsCaps.dwCaps == caps_hel), /* Windows 8+ */ "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
IDirectDraw4_Release(ddraw); }
hr = DirectDrawCreate((GUID *)DDCREATE_EMULATIONONLY, &ddraw1, NULL); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw4, (void **)&ddraw); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - IDirectDraw_Release(ddraw1); - hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hr == DD_OK || (is_ddraw64 && hr == E_FAIL), "Got unexpected hr %#lx.\n", hr); + if (SUCCEEDED(hr)) + { + hr = IDirectDraw_QueryInterface(ddraw1, &IID_IDirectDraw4, (void **)&ddraw); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + IDirectDraw_Release(ddraw1); + hr = IDirectDraw4_SetCooperativeLevel(ddraw, window, DDSCL_NORMAL); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr);
- memset(&hal_caps, 0, sizeof(hal_caps)); - memset(&hel_caps, 0, sizeof(hel_caps)); - hal_caps.dwSize = sizeof(hal_caps); - hel_caps.dwSize = sizeof(hel_caps); - hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, &hel_caps); - ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); - ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, - "Got unexpected caps %#lx, expected %#lx.\n", - hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); - ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, - "Got unexpected caps %#lx, expected %#lx.\n", - hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps); + memset(&hal_caps, 0, sizeof(hal_caps)); + memset(&hel_caps, 0, sizeof(hel_caps)); + hal_caps.dwSize = sizeof(hal_caps); + hel_caps.dwSize = sizeof(hel_caps); + hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, &hel_caps); + ok(hr == DD_OK, "Got unexpected hr %#lx.\n", hr); + ok(hal_caps.ddsOldCaps.dwCaps == hal_caps.ddsCaps.dwCaps, + "Got unexpected caps %#lx, expected %#lx.\n", + hal_caps.ddsOldCaps.dwCaps, hal_caps.ddsCaps.dwCaps); + ok(hel_caps.ddsOldCaps.dwCaps == hel_caps.ddsCaps.dwCaps, + "Got unexpected caps %#lx, expected %#lx.\n", + hel_caps.ddsOldCaps.dwCaps, hel_caps.ddsCaps.dwCaps);
- todo_wine ok(!(hal_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), - "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); - todo_wine ok(hel_caps.ddsCaps.dwCaps == caps_hel, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps); + todo_wine ok(!(hal_caps.ddsCaps.dwCaps & ~(DDSCAPS_STANDARDVGAMODE | DDSCAPS_MODEX)), + "Got unexpected caps %#lx.\n", hal_caps.ddsCaps.dwCaps); + todo_wine ok(hel_caps.ddsCaps.dwCaps == caps_hel, "Got unexpected caps %#lx.\n", hel_caps.ddsCaps.dwCaps);
- for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) - { - IDirectDrawSurface4 *surface; - DDSURFACEDESC2 desc = + for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { - .dwSize = sizeof(DDSURFACEDESC2), - .dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT, - .ddsCaps.dwCaps = DDSCAPS_ZBUFFER, - .ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT), - .ddpfPixelFormat.dwFlags = DDPF_ZBUFFER, - .ddpfPixelFormat.dwZBufferBitDepth = depth_caps[i].depth, - .ddpfPixelFormat.dwZBitMask = depth_caps[i].mask, - .dwWidth = 64, - .dwHeight = 64, - }; + IDirectDrawSurface4 *surface; + DDSURFACEDESC2 desc = + { + .dwSize = sizeof(DDSURFACEDESC2), + .dwFlags = DDSD_CAPS | DDSD_PIXELFORMAT | DDSD_WIDTH | DDSD_HEIGHT, + .ddsCaps.dwCaps = DDSCAPS_ZBUFFER, + .ddpfPixelFormat.dwSize = sizeof(DDPIXELFORMAT), + .ddpfPixelFormat.dwFlags = DDPF_ZBUFFER, + .ddpfPixelFormat.dwZBufferBitDepth = depth_caps[i].depth, + .ddpfPixelFormat.dwZBitMask = depth_caps[i].mask, + .dwWidth = 64, + .dwHeight = 64, + };
- winetest_push_context("depth %u", depth_caps[i].depth); + winetest_push_context("depth %u", depth_caps[i].depth);
- hr = IDirectDraw4_CreateSurface(ddraw, &desc, &surface, NULL); - if (depth_caps[i].depth == 16 || depth_caps[i].depth == 32) - ok(hr == S_OK, "Got hr %#lx.\n", hr); - else - todo_wine ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr); + hr = IDirectDraw4_CreateSurface(ddraw, &desc, &surface, NULL); + if (depth_caps[i].depth == 16 || depth_caps[i].depth == 32) + ok(hr == S_OK, "Got hr %#lx.\n", hr); + else + todo_wine ok(hr == DDERR_INVALIDPIXELFORMAT, "Got hr %#lx.\n", hr);
- if (hr == S_OK) - { - hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &desc); - ok(hr == S_OK, "Got hr %#lx.\n", hr); - todo_wine_if (depth_caps[i].depth != 32) - ok(desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER), - "Got caps %#lx.\n", desc.ddsCaps.dwCaps); - IDirectDrawSurface4_Release(surface); + if (hr == S_OK) + { + hr = IDirectDrawSurface4_GetSurfaceDesc(surface, &desc); + ok(hr == S_OK, "Got hr %#lx.\n", hr); + todo_wine_if (depth_caps[i].depth != 32) + ok(desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER), + "Got caps %#lx.\n", desc.ddsCaps.dwCaps); + IDirectDrawSurface4_Release(surface); + } + + winetest_pop_context(); }
- winetest_pop_context(); + IDirectDraw4_Release(ddraw); }
- IDirectDraw4_Release(ddraw); - DestroyWindow(window); }
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c index 42b47fef8e7..84da71aaf4c 100644 --- a/dlls/ddraw/tests/ddraw7.c +++ b/dlls/ddraw/tests/ddraw7.c @@ -18240,6 +18240,7 @@ static void test_caps(void)
for (unsigned int i = 0; i < ARRAY_SIZE(depth_caps); ++i) { + bool supported = (hal_caps.dwZBufferBitDepths & depth_caps[i].flag); IDirectDrawSurface7 *surface; DDSURFACEDESC2 desc = { @@ -18259,8 +18260,7 @@ static void test_caps(void) /* dwZBufferBitDepths sometimes reports false negatives, * but it has not been known to report false positives. */ hr = IDirectDraw7_CreateSurface(ddraw, &desc, &surface, NULL); - ok(hr == S_OK || (!(hal_caps.dwZBufferBitDepths & depth_caps[i].flag) && hr == DDERR_INVALIDPIXELFORMAT), - "Got hr %#lx.\n", hr); + ok(hr == S_OK || (!supported && hr == DDERR_INVALIDPIXELFORMAT), "Got hr %#lx.\n", hr);
if (hr == S_OK) { @@ -18268,7 +18268,7 @@ static void test_caps(void) ok(hr == S_OK, "Got hr %#lx.\n", hr); todo_wine_if (depth_caps[i].depth == 32) ok(desc.ddsCaps.dwCaps == (DDSCAPS_VIDEOMEMORY | DDSCAPS_LOCALVIDMEM | DDSCAPS_ZBUFFER) - || (ddraw_is_warp(ddraw) && desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER)), + || (!supported && desc.ddsCaps.dwCaps == (DDSCAPS_SYSTEMMEMORY | DDSCAPS_ZBUFFER)), "Got caps %#lx.\n", desc.ddsCaps.dwCaps); IDirectDrawSurface7_Release(surface); }