Matteo Bruni : d3dx9/tests: Add a test for an include path containing '/'.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Aug 25 15:58:17 CDT 2014


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

Author: Matteo Bruni <mbruni at codeweavers.com>
Date:   Mon Aug 25 20:36:52 2014 +0200

d3dx9/tests: Add a test for an include path containing '/'.

---

 dlls/d3dx9_36/tests/asm.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/dlls/d3dx9_36/tests/asm.c b/dlls/d3dx9_36/tests/asm.c
index 5bda4d0..3ee501e 100644
--- a/dlls/d3dx9_36/tests/asm.c
+++ b/dlls/d3dx9_36/tests/asm.c
@@ -86,6 +86,13 @@ static HRESULT WINAPI testD3DXInclude_open(ID3DXInclude *iface, D3DXINCLUDE_TYPE
         /* Also check for the correct parent_data content */
         ok(parent_data != NULL && !strncmp(include2, parent_data, strlen(include2)), "wrong parent_data value\n");
     }
+    else if (!strcmp(filename, "include/incl3.vsh"))
+    {
+        buffer = HeapAlloc(GetProcessHeap(), 0, sizeof(include));
+        memcpy(buffer, include, sizeof(include));
+        *bytes = sizeof(include);
+        ok(!parent_data, "wrong parent_data value\n");
+    }
     else
     {
         ok(0, "Unexpected #include for file %s.\n", filename);
@@ -221,6 +228,20 @@ static void assembleshader_test(void)
     }
     if(shader) ID3DXBuffer_Release(shader);
 
+    /* #include with a path. */
+    shader = NULL;
+    messages = NULL;
+    hr = D3DXAssembleShader(testshader3, strlen(testshader3), NULL, &include.ID3DXInclude_iface,
+            D3DXSHADER_SKIPVALIDATION, &shader, &messages);
+    ok(hr == D3D_OK, "D3DXAssembleShader test failed with error 0x%x - %d\n", hr, hr & 0x0000ffff);
+    if (messages)
+    {
+        trace("Path search D3DXAssembleShader messages:\n%s", (char *)ID3DXBuffer_GetBufferPointer(messages));
+        ID3DXBuffer_Release(messages);
+    }
+    if (shader)
+        ID3DXBuffer_Release(shader);
+
     shader_vsh_res = create_file("shader.vsh", testshader, sizeof(testshader) - 1);
     if(SUCCEEDED(shader_vsh_res)) {
         create_file("incl.vsh", testincl, sizeof(testincl) - 1);




More information about the wine-cvs mailing list