Alexandre Julliard : kernel32/tests: Don' t hardcode C drive for CreateDirectory tests.

Alexandre Julliard julliard at winehq.org
Tue Feb 3 09:13:40 CST 2009


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

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Tue Feb  3 15:21:47 2009 +0100

kernel32/tests: Don't hardcode C drive for CreateDirectory tests.

---

 dlls/kernel32/tests/path.c |   12 +++++++-----
 1 files changed, 7 insertions(+), 5 deletions(-)

diff --git a/dlls/kernel32/tests/path.c b/dlls/kernel32/tests/path.c
index a272b56..397d4f4 100644
--- a/dlls/kernel32/tests/path.c
+++ b/dlls/kernel32/tests/path.c
@@ -384,14 +384,16 @@ static void test_InitPathA(CHAR *newdir, CHAR *curDrive, CHAR *otherDrive)
   ok(CreateDirectoryA(tmpstr,NULL),"CreateDirectoryA failed\n");
   sprintf(tmpstr,"%s\\%s",newdir,LONGDIR);
   ok(CreateDirectoryA(tmpstr,NULL),"CreateDirectoryA failed\n");
-  bRes = CreateDirectoryA("c:",NULL);
-  ok(!bRes && (GetLastError() == ERROR_ACCESS_DENIED  || 
+  sprintf(tmpstr,"%c:", *curDrive);
+  bRes = CreateDirectoryA(tmpstr,NULL);
+  ok(!bRes && (GetLastError() == ERROR_ACCESS_DENIED  ||
                GetLastError() == ERROR_ALREADY_EXISTS),
-     "CreateDirectoryA(\"c:\" should have failed (%d)\n", GetLastError());
-  bRes = CreateDirectoryA("c:\\",NULL);
+     "CreateDirectoryA(\"%s\" should have failed (%d)\n", tmpstr, GetLastError());
+  sprintf(tmpstr,"%c:\\", *curDrive);
+  bRes = CreateDirectoryA(tmpstr,NULL);
   ok(!bRes && (GetLastError() == ERROR_ACCESS_DENIED  ||
                GetLastError() == ERROR_ALREADY_EXISTS),
-     "CreateDirectoryA(\"c:\\\" should have failed (%d)\n", GetLastError());
+     "CreateDirectoryA(\"%s\" should have failed (%d)\n", tmpstr, GetLastError());
   sprintf(tmpstr,"%s\\%s\\%s",newdir,SHORTDIR,SHORTFILE);
   hndl=CreateFileA(tmpstr,GENERIC_WRITE,0,NULL,
                    CREATE_NEW,FILE_ATTRIBUTE_NORMAL,NULL);




More information about the wine-cvs mailing list