Henri Verbeet : ddraw/tests: Handle the Windows 8 testbot in test_primary_palette().

Alexandre Julliard julliard at winehq.org
Wed Apr 30 13:32:51 CDT 2014


Module: wine
Branch: master
Commit: 174dbaf0f338a4174577ef38c88cb3ab931f92a0
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=174dbaf0f338a4174577ef38c88cb3ab931f92a0

Author: Henri Verbeet <hverbeet at codeweavers.com>
Date:   Tue Apr 29 22:02:45 2014 +0200

ddraw/tests: Handle the Windows 8 testbot in test_primary_palette().

---

 dlls/ddraw/tests/ddraw1.c |   17 +++++++++++++++++
 dlls/ddraw/tests/ddraw2.c |   17 +++++++++++++++++
 dlls/ddraw/tests/ddraw4.c |   17 +++++++++++++++++
 dlls/ddraw/tests/ddraw7.c |   17 +++++++++++++++++
 4 files changed, 68 insertions(+)

diff --git a/dlls/ddraw/tests/ddraw1.c b/dlls/ddraw/tests/ddraw1.c
index b62d351..a48cf55 100644
--- a/dlls/ddraw/tests/ddraw1.c
+++ b/dlls/ddraw/tests/ddraw1.c
@@ -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);
diff --git a/dlls/ddraw/tests/ddraw2.c b/dlls/ddraw/tests/ddraw2.c
index ce3be71..cd038c5 100644
--- a/dlls/ddraw/tests/ddraw2.c
+++ b/dlls/ddraw/tests/ddraw2.c
@@ -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);
diff --git a/dlls/ddraw/tests/ddraw4.c b/dlls/ddraw/tests/ddraw4.c
index 68f32ee..8becc1f 100644
--- a/dlls/ddraw/tests/ddraw4.c
+++ b/dlls/ddraw/tests/ddraw4.c
@@ -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);
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index bed5cb8..375403c 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -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);




More information about the wine-cvs mailing list