[PATCH 4/6] d3dx9: Test number of vertices for D3DXCreateSphere.
Misha Koshelev
misha680 at gmail.com
Fri Jun 25 21:19:42 CDT 2010
---
dlls/d3dx9_36/tests/mesh.c | 19 +++++++++++++++++++
1 files changed, 19 insertions(+), 0 deletions(-)
diff --git a/dlls/d3dx9_36/tests/mesh.c b/dlls/d3dx9_36/tests/mesh.c
index 78f8851..b780387 100644
--- a/dlls/d3dx9_36/tests/mesh.c
+++ b/dlls/d3dx9_36/tests/mesh.c
@@ -484,6 +484,9 @@ static void D3DXCreateSphereTest(void)
IDirect3DDevice9* device;
D3DPRESENT_PARAMETERS d3dpp;
ID3DXMesh* sphere = NULL;
+ DWORD number_of_vertices;
+ IDirect3DVertexBuffer9* vertex_buffer = NULL;
+ BYTE* vertex_data = NULL;
hr = D3DXCreateSphere(NULL, 0.0f, 0, 0, NULL, NULL);
todo_wine ok( hr == D3DERR_INVALIDCALL, "Got result %x, expected %x (D3D_INVALIDCALL)\n",hr,D3DERR_INVALIDCALL);
@@ -527,7 +530,23 @@ static void D3DXCreateSphereTest(void)
todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
if (sphere)
+ {
+ number_of_vertices = sphere->lpVtbl->GetNumVertices(sphere);
+ todo_wine ok( number_of_vertices == 4, "Got result %u, expected 4\n",number_of_vertices);
+
+ hr = sphere->lpVtbl->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, (LPVOID *)&vertex_data, D3DLOCK_DISCARD);
+ todo_wine ok( hr == D3D_OK, "Got result %x, expected 0 (D3D_OK)\n",hr);
+
+ IDirect3DVertexBuffer9_Unlock(vertex_buffer);
+ }
+
sphere->lpVtbl->Release(sphere);
+ }
IDirect3DDevice9_Release(device);
IDirect3D9_Release(d3d);
--
1.7.1
More information about the wine-patches
mailing list