ddraw/tests: Skip the overlay tests in test_block_formats_creation() if overlays are not supported.

This commit is contained in:
Henri Verbeet 2014-03-11 18:41:46 +01:00 committed by Alexandre Julliard
parent cf5023bfff
commit 82780d6ba6
2 changed files with 20 additions and 2 deletions

View File

@ -4043,6 +4043,8 @@ static void test_block_formats_creation(void)
DWORD supported_fmts = 0, supported_overlay_fmts = 0;
DWORD num_fourcc_codes = 0, *fourcc_codes;
DDSURFACEDESC2 ddsd;
DDCAPS hal_caps;
static const struct
{
DWORD fourcc;
@ -4132,12 +4134,19 @@ static void test_block_formats_creation(void)
}
HeapFree(GetProcessHeap(), 0, fourcc_codes);
memset(&hal_caps, 0, sizeof(hal_caps));
hal_caps.dwSize = sizeof(hal_caps);
hr = IDirectDraw4_GetCaps(ddraw, &hal_caps, NULL);
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
for (i = 0; i < sizeof(formats) / sizeof(*formats); i++)
{
for (j = 0; j < sizeof(types) / sizeof(*types); j++)
{
BOOL support;
if (formats[i].overlay != types[j].overlay)
if (formats[i].overlay != types[j].overlay
|| (types[j].overlay && !(hal_caps.dwCaps & DDCAPS_OVERLAY)))
continue;
if (formats[i].overlay)

View File

@ -3850,6 +3850,8 @@ static void test_block_formats_creation(void)
DWORD supported_fmts = 0, supported_overlay_fmts = 0;
DWORD num_fourcc_codes = 0, *fourcc_codes;
DDSURFACEDESC2 ddsd;
DDCAPS hal_caps;
static const struct
{
DWORD fourcc;
@ -3939,12 +3941,19 @@ static void test_block_formats_creation(void)
}
HeapFree(GetProcessHeap(), 0, fourcc_codes);
memset(&hal_caps, 0, sizeof(hal_caps));
hal_caps.dwSize = sizeof(hal_caps);
hr = IDirectDraw7_GetCaps(ddraw, &hal_caps, NULL);
ok(SUCCEEDED(hr), "Failed to get caps, hr %#x.\n", hr);
for (i = 0; i < sizeof(formats) / sizeof(*formats); i++)
{
for (j = 0; j < sizeof(types) / sizeof(*types); j++)
{
BOOL support;
if (formats[i].overlay != types[j].overlay)
if (formats[i].overlay != types[j].overlay
|| (types[j].overlay && !(hal_caps.dwCaps & DDCAPS_OVERLAY)))
continue;
if (formats[i].overlay)