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

This commit is contained in:
Alexandre Julliard 2009-02-03 15:21:47 +01:00
parent 1a28fb6c16
commit 3cd4150059
1 changed files with 8 additions and 6 deletions

View File

@ -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 ||
GetLastError() == ERROR_ALREADY_EXISTS),
"CreateDirectoryA(\"c:\" should have failed (%d)\n", GetLastError());
bRes = CreateDirectoryA("c:\\",NULL);
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,"%c:\\", *curDrive);
bRes = CreateDirectoryA(tmpstr,NULL);
ok(!bRes && (GetLastError() == ERROR_ACCESS_DENIED ||
GetLastError() == ERROR_ALREADY_EXISTS),
"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);