Tony Wasserka : d3dx9: Add tests for D3DXLoadSurfaceFromSurface.

Alexandre Julliard julliard at winehq.org
Fri Jun 26 09:47:16 CDT 2009


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

Author: Tony Wasserka <tony.wasserka at freenet.de>
Date:   Thu Jun 25 20:14:43 2009 +0200

d3dx9: Add tests for D3DXLoadSurfaceFromSurface.

---

 dlls/d3dx9_36/tests/texture.c |   19 ++++++++++++++++++-
 1 files changed, 18 insertions(+), 1 deletions(-)

diff --git a/dlls/d3dx9_36/tests/texture.c b/dlls/d3dx9_36/tests/texture.c
index 3fc43e6..c2f47f2 100644
--- a/dlls/d3dx9_36/tests/texture.c
+++ b/dlls/d3dx9_36/tests/texture.c
@@ -209,7 +209,7 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
 {
     HRESULT hr;
     BOOL testdummy_ok, testbitmap_ok;
-    IDirect3DSurface9 *surf;
+    IDirect3DSurface9 *surf, *newsurf;
     RECT rect;
 
     hr = create_file("testdummy.bmp", noimage, sizeof(noimage));  /* invalid image */
@@ -319,6 +319,23 @@ static void test_D3DXLoadSurface(IDirect3DDevice9 *device)
     ok(hr == E_FAIL, "D3DXLoadSurfaceFromMemory returned %#x, expected %#x\n", hr, E_FAIL);
 
 
+    /* D3DXLoadSurfaceFromSurface */
+    hr = IDirect3DDevice9_CreateOffscreenPlainSurface(device, 256, 256, D3DFMT_A8R8G8B8, D3DPOOL_DEFAULT, &newsurf, NULL);
+    if(SUCCEEDED(hr)) {
+        todo_wine {
+            hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, surf, NULL, NULL, D3DX_DEFAULT, 0);
+            ok(hr == D3D_OK, "D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n", hr, D3D_OK);
+        }
+
+        hr = D3DXLoadSurfaceFromSurface(NULL, NULL, NULL, surf, NULL, NULL, D3DX_DEFAULT, 0);
+        ok(hr == D3DERR_INVALIDCALL, "D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+
+        hr = D3DXLoadSurfaceFromSurface(newsurf, NULL, NULL, NULL, NULL, NULL, D3DX_DEFAULT, 0);
+        ok(hr == D3DERR_INVALIDCALL, "D3DXLoadSurfaceFromSurface returned %#x, expected %#x\n", hr, D3DERR_INVALIDCALL);
+    } else skip("Failed to create a second surface\n");
+    check_release((IUnknown*)newsurf, 0);
+
+
     /* cleanup */
     check_release((IUnknown*)surf, 0);
 




More information about the wine-cvs mailing list