[05/11] ddraw/tests: Add win_skip when certain interfaces are not available.

Octavian Voicu octavian.voicu at gmail.com
Mon Nov 7 16:27:08 CST 2011


--
This happens mostly on VMware. As before, these failures are not triggered
because of earlier skips.
---
 dlls/ddraw/tests/visual.c |   28 ++++++++++++++++++++++++----
 1 files changed, 24 insertions(+), 4 deletions(-)

diff --git a/dlls/ddraw/tests/visual.c b/dlls/ddraw/tests/visual.c
index a2efd72..1f241b3 100644
--- a/dlls/ddraw/tests/visual.c
+++ b/dlls/ddraw/tests/visual.c
@@ -107,7 +107,10 @@ static BOOL createObjects(void)
     }
 
     hr = IDirectDraw7_QueryInterface(DirectDraw, &IID_IDirect3D7, (void**) &Direct3D);
-    if (hr == E_NOINTERFACE) goto err;
+    if (hr == E_NOINTERFACE) {
+        win_skip("IID_IDirect3D7 not available, skipping tests.\n");
+        goto err;
+    }
     ok(hr==DD_OK, "QueryInterface returned: %08x\n", hr);
 
     /* DirectDraw Flipping behavior doesn't seem that well-defined. The reference rasterizer behaves differently
@@ -1144,7 +1147,6 @@ static BOOL D3D1_createObjects(void)
 
     /* An IDirect3DDevice cannot be queryInterfaced from an IDirect3DDevice7 on windows */
     hr = DirectDrawCreate(NULL, &DirectDraw1, NULL);
-
     ok(hr==DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreate returned: %x\n", hr);
     if (FAILED(hr)) {
         return FALSE;
@@ -1172,6 +1174,10 @@ static BOOL D3D1_createObjects(void)
     }
 
     hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirect3D, (void**) &Direct3D1);
+    if (hr == E_NOINTERFACE) {
+        win_skip("IID_IDirect3D not available, skipping tests.\n");
+        return FALSE;
+    }
     ok(hr==DD_OK, "QueryInterface returned: %x\n", hr);
     if (FAILED(hr)) {
         return FALSE;
@@ -1192,6 +1198,10 @@ static BOOL D3D1_createObjects(void)
         trace("Creating a HAL device failed, trying Ref\n");
         hr = IDirectDrawSurface_QueryInterface(Surface1, &IID_IDirect3DRefDevice, (void **) &Direct3DDevice1);
     }
+    if (hr == E_NOINTERFACE) {
+        win_skip("IID_IDirect3DHALDevice/IID_IDirect3DRefDevice not available, skipping tests.\n");
+        return FALSE;
+    }
     ok(hr==D3D_OK, "Creating 3D device returned: %x\n", hr);
     if(FAILED(hr)) {
         return FALSE;
@@ -2262,6 +2272,10 @@ static void D3D3_ViewportClearTest(void)
     if (FAILED(hr)) goto out;
 
     hr = IDirectDraw_QueryInterface(DirectDraw1, &IID_IDirectDraw4, (void**)&DirectDraw4);
+    if (hr == E_NOINTERFACE) {
+        win_skip("IID_IDirectDraw4 not available, skipping tests.\n");
+        goto out;
+    }
     ok(hr==DD_OK, "QueryInterface returned: %08x\n", hr);
     if(FAILED(hr)) goto out;
 
@@ -2275,6 +2289,10 @@ static void D3D3_ViewportClearTest(void)
     if(FAILED(hr)) goto out;
 
     hr = IDirectDraw4_QueryInterface(DirectDraw4, &IID_IDirect3D3, (void**)&Direct3D3);
+    if (hr == E_NOINTERFACE) {
+        win_skip("IID_IDirect3D3 not available, skipping tests.\n");
+        goto out;
+    }
     ok(hr==DD_OK, "IDirectDraw4_QueryInterface returned: %08x\n", hr);
     if(FAILED(hr)) goto out;
 
@@ -2283,6 +2301,10 @@ static void D3D3_ViewportClearTest(void)
         trace("Creating a HAL device failed, trying Ref\n");
         hr = IDirect3D3_CreateDevice(Direct3D3, &IID_IDirect3DRefDevice, Primary4, &Direct3DDevice3, NULL);
     }
+    if (hr == E_NOINTERFACE) {
+        win_skip("IID_IDirect3DHALDevice/IID_IDirect3DRefDevice not available, skipping tests.\n");
+        goto out;
+    }
     ok(hr==D3D_OK, "Creating 3D device returned: %x\n", hr);
     if(FAILED(hr)) goto out;
 
@@ -2509,9 +2531,7 @@ static void p8_primary_test(void)
     DDCOLORKEY clrKey;
     unsigned differences;
 
-    /* An IDirect3DDevice cannot be queryInterfaced from an IDirect3DDevice7 on windows */
     hr = DirectDrawCreate(NULL, &DirectDraw1, NULL);
-
     ok(hr==DD_OK || hr==DDERR_NODIRECTDRAWSUPPORT, "DirectDrawCreate returned: %x\n", hr);
     if (FAILED(hr)) {
         goto out;
-- 
1.7.4.1




More information about the wine-patches mailing list