Zebediah Figura : d3dcompiler/tests: Test including an absolute path.

Alexandre Julliard julliard at winehq.org
Fri Sep 3 16:25:28 CDT 2021


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

Author: Zebediah Figura <zfigura at codeweavers.com>
Date:   Wed Sep  1 12:12:48 2021 -0500

d3dcompiler/tests: Test including an absolute path.

Signed-off-by: Zebediah Figura <zfigura at codeweavers.com>
Signed-off-by: Matteo Bruni <mbruni at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/d3dcompiler_43/tests/hlsl_d3d9.c | 24 ++++++++++++++++++++++--
 1 file changed, 22 insertions(+), 2 deletions(-)

diff --git a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
index a950fa83d89..ad27084dce0 100644
--- a/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
+++ b/dlls/d3dcompiler_43/tests/hlsl_d3d9.c
@@ -1523,7 +1523,7 @@ struct test_d3dinclude
 static void test_d3dcompile(void)
 {
     struct test_d3dinclude include = {{&test_d3dinclude_vtbl}};
-    WCHAR filename[MAX_PATH], directory[MAX_PATH];
+    WCHAR filename[MAX_PATH], directory[MAX_PATH], include_filename[MAX_PATH];
     ID3D10Blob *blob = NULL, *errors = NULL;
     CHAR filename_a[MAX_PATH];
     HRESULT hr;
@@ -1542,12 +1542,20 @@ static void test_d3dcompile(void)
     static const char include2[] =
         "#include \"include1.h\"\n"
         "float4 light_color = LIGHT;\n";
+    static const char ps_absolute_template[] =
+        "#include \"%ls\"\n"
+        "\n"
+        "float4 main() : COLOR\n"
+        "{\n"
+        "    return light_color;\n"
+        "}";
+    char ps_absolute_buffer[sizeof(ps_absolute_template) + MAX_PATH];
 
     create_file(L"source.ps", ps_code, strlen(ps_code), filename);
     create_directory(L"include");
     create_file(L"include\\include1.h", include1_wrong, strlen(include1_wrong), NULL);
     create_file(L"include1.h", include1, strlen(include1), NULL);
-    create_file(L"include\\include2.h", include2, strlen(include2), NULL);
+    create_file(L"include\\include2.h", include2, strlen(include2), include_filename);
 
     len = WideCharToMultiByte(CP_ACP, 0, filename, -1, NULL, 0, NULL, NULL);
     WideCharToMultiByte(CP_ACP, 0, filename, -1, filename_a, len, NULL, NULL);
@@ -1650,6 +1658,18 @@ static void test_d3dcompile(void)
         blob = NULL;
     }
 
+    sprintf(ps_absolute_buffer, ps_absolute_template, include_filename);
+    hr = ppD3DCompile(ps_absolute_buffer, sizeof(ps_absolute_buffer), filename_a, NULL,
+            D3D_COMPILE_STANDARD_FILE_INCLUDE, "main", "ps_2_0", 0, 0, &blob, &errors);
+    todo_wine ok(hr == S_OK, "Got hr %#x.\n", hr);
+    todo_wine ok(!!blob, "Got unexpected blob.\n");
+    todo_wine ok(!errors, "Got unexpected errors.\n");
+    if (blob)
+    {
+        ID3D10Blob_Release(blob);
+        blob = NULL;
+    }
+
     GetCurrentDirectoryW(MAX_PATH, directory);
     SetCurrentDirectoryW(temp_dir);
 




More information about the wine-cvs mailing list