Michael Stefaniuc : d3dx9/tests: Use wide-char string literals.

Alexandre Julliard julliard at winehq.org
Thu Oct 1 15:50:30 CDT 2020


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

Author: Michael Stefaniuc <mstefani at winehq.org>
Date:   Wed Sep 30 23:14:53 2020 +0200

d3dx9/tests: Use wide-char string literals.

Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dx9_36/tests/asm.c    | 6 ++----
 dlls/d3dx9_36/tests/effect.c | 8 +++-----
 2 files changed, 5 insertions(+), 9 deletions(-)

diff --git a/dlls/d3dx9_36/tests/asm.c b/dlls/d3dx9_36/tests/asm.c
index 4087bd89b0..9b4e82f218 100644
--- a/dlls/d3dx9_36/tests/asm.c
+++ b/dlls/d3dx9_36/tests/asm.c
@@ -195,7 +195,6 @@ static void assembleshader_test(void)
     };
     struct D3DXIncludeImpl include;
     char shader_vsh_path[MAX_PATH], shader3_vsh_path[MAX_PATH];
-    static const WCHAR shader_filename_w[] = {'s','h','a','d','e','r','.','v','s','h',0};
 
     /* pDefines test */
     shader = NULL;
@@ -356,7 +355,7 @@ static void assembleshader_test(void)
 
         shader = NULL;
         messages = NULL;
-        hr = D3DXAssembleShaderFromFileW(shader_filename_w, NULL, &include.ID3DXInclude_iface,
+        hr = D3DXAssembleShaderFromFileW(L"shader.vsh", NULL, &include.ID3DXInclude_iface,
                 D3DXSHADER_SKIPVALIDATION, &shader, &messages);
         ok(hr == D3D_OK, "D3DXAssembleShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
                 hr, hr & 0x0000ffff);
@@ -445,7 +444,6 @@ static void d3dxpreprocess_test(void)
     ID3DXBuffer *shader, *messages;
     char shader_vsh_path[MAX_PATH], shader3_vsh_path[MAX_PATH];
     static struct D3DXIncludeImpl include = {{&D3DXInclude_Vtbl}};
-    static const WCHAR shader_filename_w[] = {'s','h','a','d','e','r','.','v','s','h',0};
 
     if (create_file("shader.vsh", testshader, sizeof(testshader) - 1, shader_vsh_path))
     {
@@ -520,7 +518,7 @@ static void d3dxpreprocess_test(void)
 
         shader = NULL;
         messages = NULL;
-        hr = D3DXPreprocessShaderFromFileW(shader_filename_w, NULL, &include.ID3DXInclude_iface,
+        hr = D3DXPreprocessShaderFromFileW(L"shader.vsh", NULL, &include.ID3DXInclude_iface,
                 &shader, &messages);
         ok(hr == D3D_OK, "D3DXPreprocessShaderFromFile + pInclude main shader test failed with error 0x%x - %d\n",
                 hr, hr & 0x0000ffff);
diff --git a/dlls/d3dx9_36/tests/effect.c b/dlls/d3dx9_36/tests/effect.c
index c72049d553..ae6f65d52d 100644
--- a/dlls/d3dx9_36/tests/effect.c
+++ b/dlls/d3dx9_36/tests/effect.c
@@ -7740,8 +7740,6 @@ static void test_create_effect_from_file(void)
         "        VertexShader = compile vs_2_0 vs_main();\n"
         "    }\n"
         "}\n";
-    static const WCHAR effect1_filename_w[] = {'e','f','f','e','c','t','1','.','f','x',0};
-    static const WCHAR effect2_filename_w[] = {'e','f','f','e','c','t','2','.','f','x',0};
     WCHAR effect_path_w[MAX_PATH], filename_w[MAX_PATH];
     char effect_path[MAX_PATH], filename[MAX_PATH];
     D3DPRESENT_PARAMETERS present_parameters = {0};
@@ -7798,7 +7796,7 @@ static void test_create_effect_from_file(void)
     create_file("include1.h", include1_wrong, sizeof(include1_wrong) - 1, NULL);
 
     lstrcpyW(filename_w, effect_path_w);
-    lstrcatW(filename_w, effect1_filename_w);
+    lstrcatW(filename_w, L"effect1.fx");
     effect = NULL;
     messages = NULL;
     hr = D3DXCreateEffectFromFileExW(device, filename_w, NULL, NULL, NULL,
@@ -7813,7 +7811,7 @@ static void test_create_effect_from_file(void)
         effect->lpVtbl->Release(effect);
 
     lstrcpyW(filename_w, effect_path_w);
-    lstrcatW(filename_w, effect2_filename_w);
+    lstrcatW(filename_w, L"effect2.fx");
     effect = NULL;
     messages = NULL;
     /* This is apparently broken on native, it ends up using the wrong include. */
@@ -7835,7 +7833,7 @@ static void test_create_effect_from_file(void)
     delete_file("include2.h");
     delete_directory("include");
 
-    lstrcpyW(filename_w, effect2_filename_w);
+    lstrcpyW(filename_w, L"effect2.fx");
     effect = NULL;
     messages = NULL;
     include.ID3DXInclude_iface.lpVtbl = &d3dxinclude_vtbl;




More information about the wine-cvs mailing list