d3dx9: Fix D3DXAssembleShader tests.

Matteo Bruni matteo.mystral at gmail.com
Wed Sep 8 12:17:54 CDT 2010


The test was saving spurious '\0's into the shader files, so it ended
up not doing what was intended.
-------------- next part --------------
From 326bcb78621d5c484ea0615416e06148d1d260bc Mon Sep 17 00:00:00 2001
From: Matteo Bruni <matteo.mystral at gmail.com>
Date: Fri, 3 Sep 2010 15:25:23 +0200
Subject: d3dx9: Fix D3DXAssembleShader tests.

---
 dlls/d3dx9_36/tests/asm.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/dlls/d3dx9_36/tests/asm.c b/dlls/d3dx9_36/tests/asm.c
index 19907aa..4d319ed 100644
--- a/dlls/d3dx9_36/tests/asm.c
+++ b/dlls/d3dx9_36/tests/asm.c
@@ -115,6 +115,7 @@ static void assembleshader_test(void) {
         "#include \"incl4.vsh\"\n"
     };
     const char testincl4_ok[] = {
+        "#define REGISTER r0\n"
         "vs.1.1\n"
     };
     const char testincl4_wrong[] = {
@@ -208,9 +209,9 @@ static void assembleshader_test(void) {
     }
     if(shader) ID3DXBuffer_Release(shader);
 
-    shader_vsh_res = create_file("shader.vsh", testshader, sizeof(testshader));
+    shader_vsh_res = create_file("shader.vsh", testshader, sizeof(testshader) - 1);
     if(SUCCEEDED(shader_vsh_res)) {
-        create_file("incl.vsh", testincl, sizeof(testincl));
+        create_file("incl.vsh", testincl, sizeof(testincl) - 1);
 
         /* D3DXAssembleShaderFromFile + #include test */
         shader = NULL;
@@ -238,11 +239,11 @@ static void assembleshader_test(void) {
         }
         if(shader) ID3DXBuffer_Release(shader);
 
-        create_file("shader3.vsh", testshader3, sizeof(testshader3));
-        create_file("incl4.vsh", testincl4_wrong, sizeof(testincl4_wrong));
+        create_file("shader3.vsh", testshader3, sizeof(testshader3) - 1);
+        create_file("incl4.vsh", testincl4_wrong, sizeof(testincl4_wrong) - 1);
         if(CreateDirectoryA("include", NULL)) {
-            create_file("include/incl3.vsh", testincl3, sizeof(testincl3));
-            create_file("include/incl4.vsh", testincl4_ok, sizeof(testincl4_ok));
+            create_file("include/incl3.vsh", testincl3, sizeof(testincl3) - 1);
+            create_file("include/incl4.vsh", testincl4_ok, sizeof(testincl4_ok) - 1);
 
             /* path search #include test */
             shader = NULL;
-- 
1.7.2.2


More information about the wine-patches mailing list