ddraw/tests: Handle the Windows 8 testbot in test_primary_palette().
This commit is contained in:
parent
efc1d791a3
commit
174dbaf0f3
|
@ -3987,6 +3987,22 @@ static void test_primary_palette(void)
|
|||
|
||||
hr = IDirectDrawSurface_SetPalette(primary, palette);
|
||||
ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr);
|
||||
|
||||
/* The Windows 8 testbot attaches the palette to the backbuffer as well,
|
||||
* and is generally somewhat broken with respect to 8 bpp / palette
|
||||
* handling. */
|
||||
if (SUCCEEDED(IDirectDrawSurface_GetPalette(backbuffer, &tmp)))
|
||||
{
|
||||
win_skip("Broken palette handling detected, skipping tests.\n");
|
||||
IDirectDrawPalette_Release(tmp);
|
||||
IDirectDrawPalette_Release(palette);
|
||||
/* The Windows 8 testbot keeps extra references to the primary and
|
||||
* backbuffer while in 8 bpp mode. */
|
||||
hr = IDirectDraw_RestoreDisplayMode(ddraw);
|
||||
ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr);
|
||||
goto done;
|
||||
}
|
||||
|
||||
refcount = get_refcount((IUnknown *)palette);
|
||||
ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
|
||||
|
||||
|
@ -4027,6 +4043,7 @@ static void test_primary_palette(void)
|
|||
hr = IDirectDrawSurface_GetPalette(primary, &tmp);
|
||||
ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
done:
|
||||
refcount = IDirectDrawSurface_Release(backbuffer);
|
||||
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||
refcount = IDirectDrawSurface_Release(primary);
|
||||
|
|
|
@ -5092,6 +5092,22 @@ static void test_primary_palette(void)
|
|||
|
||||
hr = IDirectDrawSurface_SetPalette(primary, palette);
|
||||
ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr);
|
||||
|
||||
/* The Windows 8 testbot attaches the palette to the backbuffer as well,
|
||||
* and is generally somewhat broken with respect to 8 bpp / palette
|
||||
* handling. */
|
||||
if (SUCCEEDED(IDirectDrawSurface_GetPalette(backbuffer, &tmp)))
|
||||
{
|
||||
win_skip("Broken palette handling detected, skipping tests.\n");
|
||||
IDirectDrawPalette_Release(tmp);
|
||||
IDirectDrawPalette_Release(palette);
|
||||
/* The Windows 8 testbot keeps extra references to the primary and
|
||||
* backbuffer while in 8 bpp mode. */
|
||||
hr = IDirectDraw2_RestoreDisplayMode(ddraw);
|
||||
ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr);
|
||||
goto done;
|
||||
}
|
||||
|
||||
refcount = get_refcount((IUnknown *)palette);
|
||||
ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
|
||||
|
||||
|
@ -5132,6 +5148,7 @@ static void test_primary_palette(void)
|
|||
hr = IDirectDrawSurface_GetPalette(primary, &tmp);
|
||||
ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
done:
|
||||
refcount = IDirectDrawSurface_Release(backbuffer);
|
||||
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||
refcount = IDirectDrawSurface_Release(primary);
|
||||
|
|
|
@ -5752,6 +5752,22 @@ static void test_primary_palette(void)
|
|||
|
||||
hr = IDirectDrawSurface4_SetPalette(primary, palette);
|
||||
ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr);
|
||||
|
||||
/* The Windows 8 testbot attaches the palette to the backbuffer as well,
|
||||
* and is generally somewhat broken with respect to 8 bpp / palette
|
||||
* handling. */
|
||||
if (SUCCEEDED(IDirectDrawSurface4_GetPalette(backbuffer, &tmp)))
|
||||
{
|
||||
win_skip("Broken palette handling detected, skipping tests.\n");
|
||||
IDirectDrawPalette_Release(tmp);
|
||||
IDirectDrawPalette_Release(palette);
|
||||
/* The Windows 8 testbot keeps extra references to the primary and
|
||||
* backbuffer while in 8 bpp mode. */
|
||||
hr = IDirectDraw4_RestoreDisplayMode(ddraw);
|
||||
ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr);
|
||||
goto done;
|
||||
}
|
||||
|
||||
refcount = get_refcount((IUnknown *)palette);
|
||||
ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
|
||||
|
||||
|
@ -5792,6 +5808,7 @@ static void test_primary_palette(void)
|
|||
hr = IDirectDrawSurface4_GetPalette(primary, &tmp);
|
||||
ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
done:
|
||||
refcount = IDirectDrawSurface4_Release(backbuffer);
|
||||
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||
refcount = IDirectDrawSurface4_Release(primary);
|
||||
|
|
|
@ -5631,6 +5631,22 @@ static void test_primary_palette(void)
|
|||
|
||||
hr = IDirectDrawSurface7_SetPalette(primary, palette);
|
||||
ok(SUCCEEDED(hr), "Failed to set palette, hr %#x.\n", hr);
|
||||
|
||||
/* The Windows 8 testbot attaches the palette to the backbuffer as well,
|
||||
* and is generally somewhat broken with respect to 8 bpp / palette
|
||||
* handling. */
|
||||
if (SUCCEEDED(IDirectDrawSurface7_GetPalette(backbuffer, &tmp)))
|
||||
{
|
||||
win_skip("Broken palette handling detected, skipping tests.\n");
|
||||
IDirectDrawPalette_Release(tmp);
|
||||
IDirectDrawPalette_Release(palette);
|
||||
/* The Windows 8 testbot keeps extra references to the primary and
|
||||
* backbuffer while in 8 bpp mode. */
|
||||
hr = IDirectDraw7_RestoreDisplayMode(ddraw);
|
||||
ok(SUCCEEDED(hr), "Failed to restore display mode, hr %#x.\n", hr);
|
||||
goto done;
|
||||
}
|
||||
|
||||
refcount = get_refcount((IUnknown *)palette);
|
||||
ok(refcount == 2, "Got unexpected refcount %u.\n", refcount);
|
||||
|
||||
|
@ -5671,6 +5687,7 @@ static void test_primary_palette(void)
|
|||
hr = IDirectDrawSurface7_GetPalette(primary, &tmp);
|
||||
ok(hr == DDERR_NOPALETTEATTACHED, "Got unexpected hr %#x.\n", hr);
|
||||
|
||||
done:
|
||||
refcount = IDirectDrawSurface7_Release(backbuffer);
|
||||
ok(refcount == 1, "Got unexpected refcount %u.\n", refcount);
|
||||
refcount = IDirectDrawSurface7_Release(primary);
|
||||
|
|
Loading…
Reference in New Issue