[PATCH 5/7] d3dx9: Test number of vertices for D3DXCreateSphere.

Misha Koshelev misha680 at gmail.com
Wed Jun 23 22:18:52 CDT 2010


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

diff --git a/dlls/d3dx9_36/tests/shape.c b/dlls/d3dx9_36/tests/shape.c
index 77c66c1..d45ba4e 100644
--- a/dlls/d3dx9_36/tests/shape.c
+++ b/dlls/d3dx9_36/tests/shape.c
@@ -23,6 +23,9 @@ static void test_create_sphere(IDirect3DDevice9* device)
 {
     HRESULT hr;
     LPD3DXMESH sphere = NULL;
+    DWORD number_of_vertices;
+    LPDIRECT3DVERTEXBUFFER9 vertex_buffer = NULL;
+    BYTE *vertex_data = NULL;
 
     hr = D3DXCreateSphere(NULL, 0.0, 0, 0, NULL, NULL);
     todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
@@ -43,7 +46,23 @@ static void test_create_sphere(IDirect3DDevice9* device)
     todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
 
     if (sphere)
+    {
+        number_of_vertices = ID3DXMesh_GetNumVertices(sphere);
+        todo_wine ok( number_of_vertices == 4, "Got result %x, expected 4\n",hr);
+
+        hr = ID3DXMesh_GetVertexBuffer(sphere, &vertex_buffer);
+        todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
+
+        if (vertex_buffer)
+        {
+            hr = IDirect3DVertexBuffer9_Lock(vertex_buffer, 0, 0, &vertex_data, D3DLOCK_DISCARD);
+            todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
+
+            IDirect3DVertexBuffer9_Unlock(vertex_buffer);
+        }
+
         ID3DXMesh_Release(sphere);
+    }
 }
 
 START_TEST(shape)
-- 
1.7.1







More information about the wine-patches mailing list