Commit f39c64a8 authored by Zhenbo Li's avatar Zhenbo Li Committed by Alexandre Julliard

kernel32/tests: Add some tests for DeleteFileA.

parent 3740b2bb
...@@ -1632,6 +1632,9 @@ static void test_DeleteFileA( void ) ...@@ -1632,6 +1632,9 @@ static void test_DeleteFileA( void )
GetLastError() == ERROR_INVALID_FUNCTION), GetLastError() == ERROR_INVALID_FUNCTION),
"DeleteFileA(\"nul\") returned ret=%d error=%d\n",ret,GetLastError()); "DeleteFileA(\"nul\") returned ret=%d error=%d\n",ret,GetLastError());
ret = DeleteFileA("nonexist.txt");
ok(!ret && GetLastError() == ERROR_FILE_NOT_FOUND, "DeleteFileA(\"nonexist.txt\") returned ret=%d error=%d\n",ret,GetLastError());
GetTempPathA(MAX_PATH, temp_path); GetTempPathA(MAX_PATH, temp_path);
GetTempFileNameA(temp_path, "tst", 0, temp_file); GetTempFileNameA(temp_path, "tst", 0, temp_file);
...@@ -1650,6 +1653,15 @@ todo_wine ...@@ -1650,6 +1653,15 @@ todo_wine
ret = DeleteFileA(temp_file); ret = DeleteFileA(temp_file);
todo_wine todo_wine
ok(!ret, "DeleteFile should fail\n"); ok(!ret, "DeleteFile should fail\n");
SetLastError(0xdeadbeef);
ret = CreateDirectoryA("testdir", NULL);
ok(ret, "CreateDirectory failed, got err %d\n", GetLastError());
ret = DeleteFileA("testdir");
ok(!ret && GetLastError() == ERROR_ACCESS_DENIED,
"Expected ERROR_ACCESS_DENIED, got error %d\n", GetLastError());
ret = RemoveDirectoryA("testdir");
ok(ret, "Remove a directory failed, got error %d\n", GetLastError());
} }
static void test_DeleteFileW( void ) static void test_DeleteFileW( void )
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment