one tricky question... could it be that on windows this test behaves differently on ntfs vs FAT filesystem ? or what would give re-opening the file after the deletefile call ?
A+
2012/6/21, Dmitry Timoshkov dmitry@baikal.ru:
Previous version had a typo in file name.
dlls/kernel32/tests/file.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+)
diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c index 8768b99..0a662d9 100644 --- a/dlls/kernel32/tests/file.c +++ b/dlls/kernel32/tests/file.c @@ -3236,6 +3236,31 @@ static void test_CreatFile(void)
DeleteFile(file_name);
} +static void test_delete_file(void) +{
- char temp_path[MAX_PATH], temp_file[MAX_PATH];
- HANDLE hfile;
- int ret;
- GetTempPathA(MAX_PATH, temp_path);
- GetTempFileName(temp_path, "tst", 0, temp_file);
- SetLastError(0xdeadbeef);
- hfile = CreateFile(temp_file, GENERIC_READ, FILE_SHARE_DELETE |
FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
- ok(hfile != INVALID_HANDLE_VALUE, "CreateFile error %d\n",
GetLastError());
- SetLastError(0xdeadbeef);
- ret = DeleteFile(temp_file);
+todo_wine
- ok(ret, "DeleteFile error %d\n", GetLastError());
- SetLastError(0xdeadbeef);
- ret = CloseHandle(hfile);
- ok(ret, "CloseHandle error %d\n", GetLastError());
- ret = DeleteFile(temp_file);
+todo_wine
- ok(!ret, "DeleteFile should fail\n");
+}
START_TEST(file) { @@ -3257,6 +3282,7 @@ START_TEST(file) test_CreateFileW(); test_DeleteFileA(); test_DeleteFileW();
- test_delete_file(); test_MoveFileA(); test_MoveFileW(); test_FindFirstFileA();
-- 1.7.11