[PATCH v3 1/2] kernelbase/tests: Add more tests for combining the second path.

Zhiyi Zhang zzhang at codeweavers.com
Sun Aug 22 22:05:34 CDT 2021


From: Daniel Lehman <dlehman at esri.com>

Signed-off-by: Zhiyi Zhang <zzhang at codeweavers.com>
---
v3: Supersede 212136~212137. Add more tests and some style changes.

 dlls/kernelbase/tests/path.c | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/dlls/kernelbase/tests/path.c b/dlls/kernelbase/tests/path.c
index 8d85542612f..f8712679eae 100644
--- a/dlls/kernelbase/tests/path.c
+++ b/dlls/kernelbase/tests/path.c
@@ -426,6 +426,7 @@ struct combine_test
     const CHAR *path1;
     const CHAR *path2;
     const CHAR *result;
+    BOOL todo;
 };
 
 static const struct combine_test combine_tests[] =
@@ -473,12 +474,21 @@ static const struct combine_test combine_tests[] =
     /* Second path is fully qualified */
     {"X:\\", "C:", "C:\\"},
     {"X:\\", "C:\\", "C:\\"},
+    {"X:\\", "C:\\a", "C:\\a", TRUE},
     {"X:\\", "\\\\", "\\\\"},
+    {"X:\\", "\\\\a", "\\\\a", TRUE},
     {"X:\\", "\\\\?\\C:", "C:\\"},
     {"X:\\", "\\\\?\\C:\\", "C:\\"},
+    {"X:\\", "\\\\?\\C:\\a", "C:\\a", TRUE},
+    {"X:\\", "\\\\?\\UNC", "\\\\?\\UNC", TRUE},
     {"X:\\", "\\\\?\\UNC\\", "\\\\"},
+    {"X:\\", "\\\\?\\UNC\\a", "\\\\a", TRUE},
+    {"X:\\", "\\\\?\\Volume{e51a1864-6f2d-4019-b73d-f4e60e600c26}",
+     "\\\\?\\Volume{e51a1864-6f2d-4019-b73d-f4e60e600c26}", TRUE},
     {"X:\\", "\\\\?\\Volume{e51a1864-6f2d-4019-b73d-f4e60e600c26}\\",
      "\\\\?\\Volume{e51a1864-6f2d-4019-b73d-f4e60e600c26}\\"},
+    {"X:\\", "\\\\?\\Volume{e51a1864-6f2d-4019-b73d-f4e60e600c26}\\a",
+     "\\\\?\\Volume{e51a1864-6f2d-4019-b73d-f4e60e600c26}\\a", TRUE},
 
     /* Canonicalization */
     {"C:\\a", ".\\b", "C:\\a\\b"},
@@ -537,6 +547,7 @@ static void test_PathAllocCombine(void)
         if (SUCCEEDED(hr))
         {
             WideCharToMultiByte(CP_ACP, 0, resultW, -1, resultA, ARRAY_SIZE(resultA), NULL, NULL);
+            todo_wine_if(t->todo)
             ok(!lstrcmpA(resultA, t->result), "combine %s %s expect result %s, got %s\n", t->path1, t->path2, t->result,
                resultA);
             LocalFree(resultW);
@@ -600,6 +611,7 @@ static void test_PathCchCombine(void)
 
         hr = pPathCchCombine(output, ARRAY_SIZE(output), p1, p2);
         ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+        todo_wine_if(combine_tests[i].todo)
         ok(!lstrcmpW(output, expected), "Combining %s with %s returned %s, expected %s\n", wine_dbgstr_w(p1),
            wine_dbgstr_w(p2), wine_dbgstr_w(output), wine_dbgstr_w(expected));
     }
@@ -668,6 +680,7 @@ static void test_PathCchCombineEx(void)
 
         hr = pPathCchCombineEx(output, MAX_PATH, p1, p2, 0);
         ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
+        todo_wine_if(combine_tests[i].todo)
         ok(!lstrcmpW(output, expected), "Combining %s with %s returned %s, expected %s\n",
             wine_dbgstr_w(p1), wine_dbgstr_w(p2), wine_dbgstr_w(output), wine_dbgstr_w(expected));
     }
-- 
2.30.2




More information about the wine-devel mailing list