shell32/tests: Rewording and cleanup.

This commit is contained in:
Paul Vriens 2007-03-02 14:12:27 +01:00 committed by Alexandre Julliard
parent d478f5dadd
commit b564a9130c
1 changed files with 29 additions and 29 deletions

View File

@ -248,18 +248,18 @@ static void test_delete(void)
shfo.hNameMappings = NULL;
shfo.lpszProgressTitle = NULL;
ok(!SHFileOperationA(&shfo), "Deletion was successful\n");
ok(file_exists("test4.txt"), "Directory should not be removed\n");
ok(!file_exists("test1.txt"), "File should be removed\n");
ok(!SHFileOperationA(&shfo), "Deletion was not successful\n");
ok(file_exists("test4.txt"), "Directory should not have been removed\n");
ok(!file_exists("test1.txt"), "File should have been removed\n");
ret = SHFileOperationA(&shfo);
ok(!ret, "Directory exists, but is not removed, ret=%d\n", ret);
ok(file_exists("test4.txt"), "Directory should not be removed\n");
ok(file_exists("test4.txt"), "Directory should not have been removed\n");
shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI;
ok(!SHFileOperationA(&shfo), "Directory removed\n");
ok(!file_exists("test4.txt"), "Directory should be removed\n");
ok(!SHFileOperationA(&shfo), "Directory is not removed\n");
ok(!file_exists("test4.txt"), "Directory should have been removed\n");
ret = SHFileOperationA(&shfo);
ok(!ret, "The requested file does not exist, ret=%d\n", ret);
@ -267,33 +267,33 @@ static void test_delete(void)
init_shfo_tests();
sprintf(buf, "%s\\%s", CURR_DIR, "test4.txt");
buf[strlen(buf) + 1] = '\0';
ok(MoveFileA("test1.txt", "test4.txt\\test1.txt"), "Fill the subdirectory\n");
ok(!SHFileOperationA(&shfo), "Directory removed\n");
ok(!file_exists("test4.txt"), "Directory is removed\n");
ok(MoveFileA("test1.txt", "test4.txt\\test1.txt"), "Filling the subdirectory failed\n");
ok(!SHFileOperationA(&shfo), "Directory is not removed\n");
ok(!file_exists("test4.txt"), "Directory is not removed\n");
init_shfo_tests();
shfo.pFrom = "test1.txt\0test4.txt\0";
ok(!SHFileOperationA(&shfo), "Directory and a file removed\n");
ok(!file_exists("test1.txt"), "The file should be removed\n");
ok(!file_exists("test4.txt"), "Directory should be removed\n");
ok(file_exists("test2.txt"), "This file should not be removed\n");
ok(!SHFileOperationA(&shfo), "Directory and a file are not removed\n");
ok(!file_exists("test1.txt"), "The file should have been removed\n");
ok(!file_exists("test4.txt"), "Directory should have been removed\n");
ok(file_exists("test2.txt"), "This file should not have been removed\n");
/* FOF_FILESONLY does not delete a dir matching a wildcard */
init_shfo_tests();
shfo.fFlags |= FOF_FILESONLY;
shfo.pFrom = "*.txt\0";
ok(!SHFileOperation(&shfo), "Failed to delete files\n");
ok(!file_exists("test1.txt"), "test1.txt should be removed\n");
ok(!file_exists("test_5.txt"), "test_5.txt should be removed\n");
ok(file_exists("test4.txt"), "test4.txt should not be removed\n");
ok(!file_exists("test1.txt"), "test1.txt should have been removed\n");
ok(!file_exists("test_5.txt"), "test_5.txt should have been removed\n");
ok(file_exists("test4.txt"), "test4.txt should not have been removed\n");
/* FOF_FILESONLY only deletes a dir if explicitly specified */
init_shfo_tests();
shfo.pFrom = "test_?.txt\0test4.txt\0";
ok(!SHFileOperation(&shfo), "Failed to delete files\n");
ok(!file_exists("test4.txt"), "test4.txt should be removed\n");
ok(!file_exists("test_5.txt"), "test_5.txt should be removed\n");
ok(file_exists("test1.txt"), "test1.txt should not be removed\n");
ok(!SHFileOperation(&shfo), "Failed to delete files and directory\n");
ok(!file_exists("test4.txt"), "test4.txt should have been removed\n");
ok(!file_exists("test_5.txt"), "test_5.txt should have been removed\n");
ok(file_exists("test1.txt"), "test1.txt should not have been removed\n");
/* try to delete an invalid filename */
init_shfo_tests();