[PATCH 5/7] ddraw/tests: Move other SetRenderState() tests to test_set_render_state().

Józef Kucia jkucia at codeweavers.com
Wed Jan 27 17:17:50 CST 2016


Signed-off-by: Józef Kucia <jkucia at codeweavers.com>
---
 dlls/ddraw/tests/d3d.c    | 30 ------------------------------
 dlls/ddraw/tests/ddraw7.c | 18 +++++++++++++++++-
 2 files changed, 17 insertions(+), 31 deletions(-)

diff --git a/dlls/ddraw/tests/d3d.c b/dlls/ddraw/tests/d3d.c
index ec4197a..4a518bb 100644
--- a/dlls/ddraw/tests/d3d.c
+++ b/dlls/ddraw/tests/d3d.c
@@ -411,18 +411,6 @@ static void LightTest(void)
     }
 }
 
-static void StateTest( void )
-{
-    HRESULT rc;
-
-    /* The msdn says its undocumented, does it return an error too? */
-    rc = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_ZVISIBLE, TRUE);
-    ok(rc == D3D_OK, "IDirect3DDevice7_SetRenderState(D3DRENDERSTATE_ZVISIBLE, TRUE) returned %08x\n", rc);
-    rc = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_ZVISIBLE, FALSE);
-    ok(rc == D3D_OK, "IDirect3DDevice7_SetRenderState(D3DRENDERSTATE_ZVISIBLE, FALSE) returned %08x\n", rc);
-}
-
-
 static void SceneTest(void)
 {
     HRESULT                      hr;
@@ -1720,22 +1708,6 @@ out:
     IDirect3DVertexBuffer7_Release(lpVBufSrc);
 }
 
-static void D3D7_OldRenderStateTest(void)
-{
-    HRESULT hr;
-    DWORD val;
-
-    /* Test reaction to some deprecated states in D3D7. */
-    hr = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREHANDLE, 0);
-    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %#x.\n", hr);
-    hr = IDirect3DDevice7_GetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREHANDLE, &val);
-    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %#x.\n", hr);
-    hr = IDirect3DDevice7_SetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE);
-    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %#x.\n", hr);
-    hr = IDirect3DDevice7_GetRenderState(lpD3DDevice, D3DRENDERSTATE_TEXTUREMAPBLEND, &val);
-    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %#x.\n", hr);
-}
-
 #define IS_VALUE_NEAR(a, b)    ( ((a) == (b)) || ((a) == (b) - 1) || ((a) == (b) + 1) )
 #define MIN(a, b)    ((a) < (b) ? (a) : (b))
 
@@ -3947,7 +3919,6 @@ START_TEST(d3d)
         skip("Skipping d3d7 tests\n");
     } else {
         LightTest();
-        StateTest();
         SceneTest();
         LimitTest();
         D3D7EnumTest();
@@ -3956,7 +3927,6 @@ START_TEST(d3d)
         ComputeSphereVisibility();
         CapsTest();
         VertexBufferDescTest();
-        D3D7_OldRenderStateTest();
         DeviceLoadTest();
         SetRenderTargetTest();
         VertexBufferLockRest();
diff --git a/dlls/ddraw/tests/ddraw7.c b/dlls/ddraw/tests/ddraw7.c
index 73b88ec..7a0ab20 100644
--- a/dlls/ddraw/tests/ddraw7.c
+++ b/dlls/ddraw/tests/ddraw7.c
@@ -10764,9 +10764,9 @@ done:
 static void test_set_render_state(void)
 {
     IDirect3DDevice7 *device;
+    DWORD state, value;
     ULONG refcount;
     HWND window;
-    DWORD state;
     HRESULT hr;
 
     window = CreateWindowA("static", "ddraw_test", WS_OVERLAPPEDWINDOW,
@@ -10778,6 +10778,22 @@ static void test_set_render_state(void)
         return;
     }
 
+    /* The msdn says its undocumented, does it return an error too? */
+    hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZVISIBLE, TRUE);
+    ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState(D3DRENDERSTATE_ZVISIBLE, TRUE) returned %#x.\n", hr);
+    hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_ZVISIBLE, FALSE);
+    ok(hr == D3D_OK, "IDirect3DDevice7_SetRenderState(D3DRENDERSTATE_ZVISIBLE, FALSE) returned %#x.\n", hr);
+
+    /* Test reaction to some deprecated states in D3D7. */
+    hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, 0);
+    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %#x.\n", hr);
+    hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_TEXTUREHANDLE, &value);
+    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %#x.\n", hr);
+    hr = IDirect3DDevice7_SetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, D3DTBLEND_MODULATE);
+    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_SetRenderState returned %#x.\n", hr);
+    hr = IDirect3DDevice7_GetRenderState(device, D3DRENDERSTATE_TEXTUREMAPBLEND, &value);
+    ok(hr == DDERR_INVALIDPARAMS, "IDirect3DDevice7_GetRenderState returned %#x.\n", hr);
+
     for (state = D3DRENDERSTATE_CLIPPLANEENABLE + 1; state <= D3DRENDERSTATE_CLIPPLANEENABLE + 300; ++state)
     {
         hr = IDirect3DDevice7_SetRenderState(device, state, 0);
-- 
2.4.10




More information about the wine-patches mailing list