Peter Beutner : kernel32/tests: Add path tests for double delimiters.

Alexandre Julliard julliard at winehq.org
Mon Aug 15 10:37:30 CDT 2016


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

Author: Peter Beutner <p.beutner at gmx.net>
Date:   Sun Aug 14 22:04:49 2016 +0200

kernel32/tests: Add path tests for double delimiters.

Signed-off-by: Peter Beutner <p.beutner at gmx.net>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/kernel32/tests/path.c | 42 ++++++++++++++++++++++++++++++++++++++++++
 1 file changed, 42 insertions(+)

diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index 6520513..764141d 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -945,6 +945,36 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
   test_ShortPathCase(curdir,SHORTDIR,LONGFILE);
   test_ShortPathCase(curdir,LONGDIR,SHORTFILE);
   test_ShortPathCase(curdir,LONGDIR,LONGFILE);
+
+  /* test double delimiters */
+  sprintf(tmpstr,"%s\\\\%s", SHORTDIR,SHORTFILE);
+  ok(GetShortPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetShortPathNameA failed\n");
+  todo_wine
+  ok(lstrcmpiA(tmpstr,tmpstr1)==0,
+       "GetShortPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
+  sprintf(tmpstr,".\\\\%s\\\\%s", SHORTDIR,SHORTFILE);
+  todo_wine
+  {
+  ok(GetShortPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetShortPathNameA failed\n");
+  ok(lstrcmpiA(tmpstr,tmpstr1)==0,
+       "GetShortPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
+  }
+
+  if (pGetLongPathNameA) {
+    sprintf(tmpstr,"%s\\\\%s",LONGDIR,LONGFILE);
+    ok(pGetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed\n");
+    todo_wine
+    ok(lstrcmpiA(tmpstr,tmpstr1)==0,
+        "GetLongPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
+
+    sprintf(tmpstr,".\\\\%s\\\\%s",LONGDIR,LONGFILE);
+    todo_wine
+    {
+    ok(pGetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed\n");
+    ok(lstrcmpiA(tmpstr,tmpstr1)==0,
+       "GetLongPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
+    }
+  }
 }
 
 static void test_GetTempPathA(char* tmp_dir)
@@ -2170,6 +2200,18 @@ static void test_relative_path(void)
     ok(ret, "GetShortPathName error %d\n", GetLastError());
     ok(!strcmp(buf, ".\\..\\foo\\file"), "expected .\\..\\foo\\file, got %s\n", buf);
 
+    /* test double delimiters */
+    strcpy(buf, "deadbeef");
+    ret = pGetLongPathNameA("..\\\\foo\\file", buf, MAX_PATH);
+    ok(ret, "GetLongPathName error %d\n", GetLastError());
+    todo_wine
+    ok(!strcmp(buf, "..\\\\foo\\file"), "expected ..\\\\foo\\file, got %s\n", buf);
+    strcpy(buf, "deadbeef");
+    ret = GetShortPathNameA("..\\\\foo\\file", buf, MAX_PATH);
+    ok(ret, "GetShortPathName error %d\n", GetLastError());
+    todo_wine
+    ok(!strcmp(buf, "..\\\\foo\\file"), "expected ..\\\\foo\\file, got %s\n", buf);
+
     SetCurrentDirectoryA("..");
     DeleteFileA("foo\\file");
     RemoveDirectoryA("foo");




More information about the wine-cvs mailing list