=?UTF-8?Q?J=C3=B3zef=20Kucia=20?=: d3dx9/tests: Add basic tests for ID3DXRenderToEnvMap.

Alexandre Julliard julliard at winehq.org
Mon Aug 13 13:21:19 CDT 2012


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

Author: Józef Kucia <joseph.kucia at gmail.com>
Date:   Tue Jul 31 15:26:40 2012 +0200

d3dx9/tests: Add basic tests for ID3DXRenderToEnvMap.

---

 dlls/d3dx9_36/tests/core.c |   43 +++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 43 insertions(+), 0 deletions(-)

diff --git a/dlls/d3dx9_36/tests/core.c b/dlls/d3dx9_36/tests/core.c
index eb1e769..92c114a 100644
--- a/dlls/d3dx9_36/tests/core.c
+++ b/dlls/d3dx9_36/tests/core.c
@@ -1084,6 +1084,48 @@ static void test_D3DXCreateRenderToEnvMap(IDirect3DDevice9 *device)
     if (SUCCEEDED(hr)) ID3DXRenderToEnvMap_Release(render);
 }
 
+static void test_ID3DXRenderToEnvMap(IDirect3DDevice9 *device)
+{
+    HRESULT hr;
+    ID3DXRenderToEnvMap *render;
+
+    hr = D3DXCreateRenderToEnvMap(device, 256, 0, D3DFMT_A8R8G8B8, FALSE, D3DFMT_UNKNOWN, &render);
+    if (SUCCEEDED(hr))
+    {
+        ULONG ref_count;
+        IDirect3DDevice9 *out_device;
+
+        hr = ID3DXRenderToEnvMap_GetDesc(render, NULL);
+        ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::GetDesc returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        hr = ID3DXRenderToEnvMap_GetDevice(render, NULL);
+        ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::GetDevice returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        ref_count = get_ref((IUnknown *)device);
+        hr = ID3DXRenderToEnvMap_GetDevice(render, &out_device);
+        ok(hr == D3D_OK, "ID3DXRenderToEnvMap::GetDevice returned %#x, expected %#x\n", hr, D3D_OK);
+        ok(out_device == device, "ID3DXRenderToEnvMap::GetDevice returned different device\n");
+        check_release((IUnknown *)device, ref_count);
+
+        hr = ID3DXRenderToEnvMap_End(render, D3DX_FILTER_NONE);
+        ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::End returned %#x, expected %#x\n", hr, D3D_OK);
+
+        hr = ID3DXRenderToEnvMap_BeginCube(render, NULL);
+        ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginCube returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        hr = ID3DXRenderToEnvMap_BeginHemisphere(render, NULL, NULL);
+        todo_wine ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginHemisphere returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        hr = ID3DXRenderToEnvMap_BeginParabolic(render, NULL, NULL);
+        todo_wine ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginParabolic returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        hr = ID3DXRenderToEnvMap_BeginSphere(render, NULL);
+        todo_wine ok(hr == D3DERR_INVALIDCALL, "ID3DXRenderToEnvMap::BeginSphere returned %#x, exected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        check_release((IUnknown *)render, 0);
+    } else skip("Failed to create ID3DXRenderToEnvMap\n");
+}
+
 START_TEST(core)
 {
     HWND wnd;
@@ -1121,6 +1163,7 @@ START_TEST(core)
     test_D3DXCreateRenderToSurface(device);
     test_ID3DXRenderToSurface(device);
     test_D3DXCreateRenderToEnvMap(device);
+    test_ID3DXRenderToEnvMap(device);
 
     check_release((IUnknown*)device, 0);
     check_release((IUnknown*)d3d, 0);




More information about the wine-cvs mailing list