Module: wine
Branch: master
Commit: ee1260e0d2c50a7eec7d9e7444b8ff4d622bbad5
URL: http://source.winehq.org/git/wine.git/?a=commit;h=ee1260e0d2c50a7eec7d9e744…
Author: Jeremy White <jwhite(a)codeweavers.com>
Date: Mon Dec 21 15:20:12 2015 -0600
kernel32/tests: Test GetLongPathNameA when the file name case differs from the input.
This shows that the original buffer is unmodified if the filename is long,
but the actual file name is returned when the filename is short.
Signed-off-by: Jeremy White <jwhite(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/kernel32/tests/path.c | 11 +++++++++++
1 file changed, 11 insertions(+)
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index 37d14cc..9475aa0 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -861,14 +861,25 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
/* Don't Starve relies on GetLongPathName returning the passed in filename,
even if the actual file on disk has a different case or separator */
if (pGetLongPathNameA) {
+ int len = lstrlenA(LONGDIR) + 1;
sprintf(tmpstr,"%s/%s",LONGDIR,LONGFILE);
ok(GetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed\n");
ok(lstrcmpiA(tmpstr,tmpstr1)==0,
"GetLongPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
+ tmpstr[len] = tolower(tmpstr[len]);
+ ok(GetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed\n");
+ todo_wine
+ ok(lstrcmpA(tmpstr,tmpstr1)==0,
+ "GetLongPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
sprintf(tmpstr,"%s/%s",SHORTDIR,SHORTFILE);
ok(GetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed\n");
ok(lstrcmpiA(tmpstr,tmpstr1)==0,
"GetLongPathNameA returned '%s' instead of '%s'\n",tmpstr1,tmpstr);
+ len = lstrlenA(SHORTDIR) + 1;
+ tmpstr[len] = toupper(tmpstr[len]);
+ ok(GetLongPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetLongPathNameA failed\n");
+ ok(lstrcmpiA(tmpstr,tmpstr1)==0 && lstrcmpA(tmpstr,tmpstr1) != 0,
+ "GetLongPathNameA returned '%s' instead of '%s/%s'\n",tmpstr1,SHORTDIR,SHORTFILE);
}
sprintf(tmpstr,"%s/%s",SHORTDIR,SHORTFILE);
ok(GetShortPathNameA(tmpstr,tmpstr1,MAX_PATH),"GetShortPathNameA failed\n");
Module: wine
Branch: master
Commit: 60836b41fa7cfc6505763a357d2296598edd5fa1
URL: http://source.winehq.org/git/wine.git/?a=commit;h=60836b41fa7cfc6505763a357…
Author: Jeremy White <jwhite(a)codeweavers.com>
Date: Mon Dec 21 15:20:09 2015 -0600
kernel32/tests: Add tests for GetLongPathName using a slash delimiter.
Signed-off-by: Jeremy White <jwhite(a)codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard(a)winehq.org>
---
dlls/kernel32/tests/path.c | 15 +++++++++++++++
1 file changed, 15 insertions(+)
diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index 4504603..0e9415c 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -858,6 +858,21 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
ok(lstrcmpiA(SHORTFILE,strptr)==0,
"GetFullPathNameA returned part '%s' instead of '%s'\n",strptr,SHORTFILE);
}
+ /* Don't Starve relies on GetLongPathName returning the passed in filename,
+ even if the actual file on disk has a different case or separator */
+ if (pGetLongPathNameA) {
+ sprintf(tmpstr,"%s/%s",LONGDIR,LONGFILE);
+ ok(GetLongPathNameA(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",SHORTDIR,SHORTFILE);
+ ok(GetLongPathNameA(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,"%c:%s/%s",curdir[0],SHORTDIR,SHORTFILE);
ok(GetFullPathNameA(tmpstr,MAX_PATH,tmpstr1,&strptr),"GetFullPathNameA failed\n");