Removed todo_wine from some tests that succeed now.

This commit is contained in:
Alexandre Julliard 2004-04-27 02:27:47 +00:00
parent ad9b799324
commit 115862146a
3 changed files with 63 additions and 99 deletions

View File

@ -193,21 +193,19 @@ static void test_CreateDirectoryA(void)
ret = RemoveDirectoryA(tmpdir);
ok(ret == TRUE, "RemoveDirectoryA should always succeed\n");
todo_wine {
lstrcatA(tmpdir, "?");
ret = CreateDirectoryA(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryA with ? wildcard name should fail, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryA(tmpdir);
lstrcatA(tmpdir, "?");
ret = CreateDirectoryA(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryA with ? wildcard name should fail, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryA(tmpdir);
tmpdir[lstrlenA(tmpdir) - 1] = '*';
ret = CreateDirectoryA(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryA with * wildcard name should fail, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryA(tmpdir);
}
tmpdir[lstrlenA(tmpdir) - 1] = '*';
ret = CreateDirectoryA(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryA with * wildcard name should fail, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryA(tmpdir);
}
static void test_CreateDirectoryW(void)
@ -256,21 +254,19 @@ static void test_CreateDirectoryW(void)
ret = RemoveDirectoryW(tmpdir);
ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
todo_wine {
lstrcatW(tmpdir, questionW);
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryW(tmpdir);
lstrcatW(tmpdir, questionW);
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryW with ? wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryW(tmpdir);
tmpdir[lstrlenW(tmpdir) - 1] = '*';
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryW(tmpdir);
}
tmpdir[lstrlenW(tmpdir) - 1] = '*';
ret = CreateDirectoryW(tmpdir, NULL);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"CreateDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
ret = RemoveDirectoryW(tmpdir);
}
static void test_RemoveDirectoryA(void)
@ -286,19 +282,17 @@ static void test_RemoveDirectoryA(void)
ret = RemoveDirectoryA(tmpdir);
ok(ret == TRUE, "RemoveDirectoryA should always succeed\n");
todo_wine {
lstrcatA(tmpdir, "?");
ret = RemoveDirectoryA(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryA with ? wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
lstrcatA(tmpdir, "?");
ret = RemoveDirectoryA(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryA with ? wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
tmpdir[lstrlenA(tmpdir) - 1] = '*';
ret = RemoveDirectoryA(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryA with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
}
tmpdir[lstrlenA(tmpdir) - 1] = '*';
ret = RemoveDirectoryA(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryA with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
}
static void test_RemoveDirectoryW(void)
@ -319,20 +313,17 @@ static void test_RemoveDirectoryW(void)
ret = RemoveDirectoryW(tmpdir);
ok(ret == TRUE, "RemoveDirectoryW should always succeed\n");
todo_wine {
lstrcatW(tmpdir, questionW);
ret = RemoveDirectoryW(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
tmpdir[lstrlenW(tmpdir) - 1] = '*';
ret = RemoveDirectoryW(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
}
lstrcatW(tmpdir, questionW);
ret = RemoveDirectoryW(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryW with wildcard should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
tmpdir[lstrlenW(tmpdir) - 1] = '*';
ret = RemoveDirectoryW(tmpdir);
ok(ret == FALSE && GetLastError() == ERROR_INVALID_NAME,
"RemoveDirectoryW with * wildcard name should fail with error 183, ret=%s error=%ld\n",
ret ? " True" : "False", GetLastError());
}
START_TEST(directory)

View File

@ -738,14 +738,12 @@ static void test_MoveFileA(void)
lstrcpyA(dest, tempdir);
lstrcatA(dest, "\\wild?.*");
/* FIXME: if we create a file with wildcards we can't delete it now that DeleteFile works correctly */
#if 0
ret = MoveFileA(source, dest);
todo_wine {
ok(!ret, "MoveFileA: shouldn't move to wildcard file\n");
ok(GetLastError() == ERROR_INVALID_NAME,
"MoveFileA: with wildcards, unexpected error %ld\n", GetLastError());
if (ret || (GetLastError() != ERROR_INVALID_NAME))
{
ok(!ret, "MoveFileA: shouldn't move to wildcard file\n");
ok(GetLastError() == ERROR_INVALID_NAME,
"MoveFileA: with wildcards, unexpected error %ld\n", GetLastError());
if (ret || (GetLastError() != ERROR_INVALID_NAME))
{
WIN32_FIND_DATAA fd;
char temppath[MAX_PATH];
HANDLE hFind;
@ -766,14 +764,11 @@ static void test_MoveFileA(void)
while (FindNextFileA(hFind, &fd));
FindClose(hFind);
}
}
ret = DeleteFileA(source);
ok(ret, "DeleteFileA: error %ld\n", GetLastError());
ret = DeleteFileA(dest);
ok(!ret, "DeleteFileA: error %ld\n", GetLastError());
}
#endif
ret = DeleteFileA(source);
ok(ret, "DeleteFileA: error %ld\n", GetLastError());
ret = DeleteFileA(dest);
ok(!ret, "DeleteFileA: error %ld\n", GetLastError());
ret = RemoveDirectoryA(tempdir);
ok(ret, "DeleteDirectoryA: error %ld\n", GetLastError());
}

View File

@ -48,7 +48,6 @@
*/
static const CHAR funny_chars[]="!@#$%^&*()=+{}[],?'`";
static const CHAR is_char_ok[] ="11111110111111111011";
static const CHAR wine_todo[] ="00000000000000000000";
static DWORD (WINAPI *pGetLongPathNameA)(LPCSTR,LPSTR,DWORD);
@ -228,44 +227,24 @@ static void test_LongtoShortA(CHAR *teststr,CHAR *goodstr,
Get(Short|Long)PathNameA should never pass, but GetFullPathNameA
should.
*/
static void test_FunnyChars(CHAR *curdir,CHAR *filename,
INT valid,INT todo,CHAR *errstr) {
static void test_FunnyChars(CHAR *curdir,CHAR *filename, INT valid,CHAR *errstr)
{
CHAR tmpstr[MAX_PATH],tmpstr1[MAX_PATH];
SLpassfail passfail;
test_ValidPathA(curdir,"",filename,tmpstr,&passfail,errstr);
if(valid) {
sprintf(tmpstr1,"%s\\%s",curdir,filename);
if(todo) {
todo_wine {
ok((passfail.shortlen==0 &&
(passfail.shorterror==ERROR_FILE_NOT_FOUND || passfail.shorterror==ERROR_PATH_NOT_FOUND || !passfail.shorterror)) ||
(passfail.shortlen==strlen(tmpstr1) && lstrcmpiA(tmpstr,tmpstr1)==0),
"%s: GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n",
errstr,passfail.shortlen,passfail.shorterror,tmpstr);
}
} else {
ok((passfail.shortlen==0 &&
(passfail.shorterror==ERROR_FILE_NOT_FOUND || passfail.shorterror==ERROR_PATH_NOT_FOUND || !passfail.shorterror)) ||
(passfail.shortlen==strlen(tmpstr1) && lstrcmpiA(tmpstr,tmpstr1)==0),
"%s: GetShortPathNameA error: len=%ld error=%ld tmpstr=[%s]\n",
errstr,passfail.shortlen,passfail.shorterror,tmpstr);
}
} else {
if(todo) {
todo_wine {
/* Win2k returns ERROR_INVALID_NAME, Win98, wine return ERROR_FILE_NOT_FOUND, NT4 doesn't set last error */
ok(passfail.shortlen==0 &&
(passfail.shorterror==ERROR_INVALID_NAME || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror),
"%s: GetShortPathA should have failed len=%ld, error=%ld\n",
errstr,passfail.shortlen,passfail.shorterror);
}
} else {
ok(passfail.shortlen==0 &&
(passfail.shorterror==ERROR_INVALID_NAME || passfail.shorterror==ERROR_FILE_NOT_FOUND || !passfail.shorterror),
"%s: GetShortPathA should have failed len=%ld, error=%ld\n",
errstr,passfail.shortlen,passfail.shorterror);
}
}
if(pGetLongPathNameA) {
ok(passfail.longlen==0,"GetLongPathNameA passed when it shouldn't have\n");
@ -782,30 +761,29 @@ static void test_PathNameA(CHAR *curdir, CHAR curDrive, CHAR otherDrive)
}
/* Check out Get*PathNameA on some funny characters */
for(i=0;i<lstrlenA(funny_chars);i++) {
INT valid,todo;
INT valid;
valid=(is_char_ok[i]=='0') ? 0 : 1;
todo=(wine_todo[i]=='0') ? 0 : 1;
sprintf(tmpstr1,"check%d-1",i);
sprintf(tmpstr,"file%c000.ext",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,todo,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
sprintf(tmpstr1,"check%d-2",i);
sprintf(tmpstr,"file000.e%ct",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,todo,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
sprintf(tmpstr1,"check%d-3",i);
sprintf(tmpstr,"%cfile000.ext",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,todo,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
sprintf(tmpstr1,"check%d-4",i);
sprintf(tmpstr,"file000%c.ext",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,todo,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
sprintf(tmpstr1,"check%d-5",i);
sprintf(tmpstr,"Long %c File",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,0,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
sprintf(tmpstr1,"check%d-6",i);
sprintf(tmpstr,"%c Long File",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,0,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
sprintf(tmpstr1,"check%d-7",i);
sprintf(tmpstr,"Long File %c",funny_chars[i]);
test_FunnyChars(curdir,tmpstr,valid,0,tmpstr1);
test_FunnyChars(curdir,tmpstr,valid,tmpstr1);
}
}