ddraw createVertex tests

Yong Chi yong28chi at yahoo.com
Fri Aug 11 12:53:08 CDT 2006


This adds 2 new tests to find out what return codes
are from DX7 for size=0 and Video Out of Memory.

Someone please run this test and reply for return
value for video out of memory return code please.

Thx

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
-------------- next part --------------
Index: dlls/ddraw/tests/d3d.c
===================================================================
RCS file: /home/wine/wine/dlls/ddraw/tests/d3d.c,v
retrieving revision 1.12
diff -u -r1.12 d3d.c
--- dlls/ddraw/tests/d3d.c	26 Jun 2006 12:15:21 -0000	1.12
+++ dlls/ddraw/tests/d3d.c	11 Aug 2006 17:44:16 -0000
@@ -475,6 +475,41 @@
     IDirect3DVertexBuffer7_Release(lpVBufDest2);
 }
 
+void ParamTest(void)
+{
+IDirect3DVertexBuffer7 *lpVBuf;
+    D3DVERTEXBUFFERDESC desc;
+    HRESULT rc;
+
+    /* this should be not ok to request 0 numVertices */
+    memset(&desc, 0, sizeof(desc));
+    desc.dwSize = sizeof(desc);
+    desc.dwCaps = 0;
+    desc.dwFVF = D3DFVF_XYZ;
+    desc.dwNumVertices = 0;
+    rc = IDirect3D7_CreateVertexBuffer(lpD3D, &desc, &lpVBuf, 0);
+    ok(rc==E_INVALIDARG, "CreateVertexBuffer returned: %lx\n", rc);
+    if (lpVBuf) IDirect3DVertexBuffer7_Release(lpVBuf);
+}
+
+void VidMemTest(void)
+{
+    IDirect3DVertexBuffer7 *lpVBuf;
+    D3DVERTEXBUFFERDESC desc;
+    HRESULT rc;
+
+    /* find out the return code when video is out of memory */
+    memset(&desc, 0, sizeof(desc));
+    desc.dwSize = sizeof(desc);
+    desc.dwCaps = 0;
+    desc.dwFVF = D3DFVF_XYZ;
+    /* set the numVert required to ask for 512MB as nobody should have that much yet */
+    desc.dwNumVertices = (512*1024*1024)/(sizeof(float)*3*3);
+    rc = IDirect3D7_CreateVertexBuffer(lpD3D, &desc, &lpVBuf, 0);
+    ok(rc==E_INVALIDARG, "CreateVertexBuffer returned: %lx\n", rc);
+    if (lpVBuf) IDirect3DVertexBuffer7_Release(lpVBuf);
+}
+
 START_TEST(d3d)
 {
     init_function_pointers();
@@ -489,5 +524,7 @@
     }
     LightTest();
     ProcessVerticesTest();
+    ParamTest();
+    VidMemTest();
     ReleaseDirect3D();
 }


More information about the wine-patches mailing list