From 7c1602464a9d8fb65663ff92de84b4888a1ac479 Mon Sep 17 00:00:00 2001 From: Zhenbo Li Date: Mon, 11 Nov 2013 23:52:31 +0800 Subject: [PATCH] shell32/tests: Add tests for SHFileOperationA. --- dlls/shell32/tests/shlfileop.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index a62292b69f6..bb150545ab4 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -646,6 +646,19 @@ static void test_delete(void) else skip("Test would show a dialog box\n"); + /* delete an existent file and a nonexistent file */ + shfo.pFrom = "test1.txt\0nonexistent.txt\0test2.txt\0"; + shfo.wFunc = FO_DELETE; + ret = SHFileOperationA(&shfo); + todo_wine + ok(ret == 1026 || + ret == ERROR_FILE_NOT_FOUND || /* Vista */ + broken(ret == ERROR_SUCCESS), /* NT4 */ + "Expected 1026 or ERROR_FILE_NOT_FOUND, got %d\n", ret); + todo_wine + ok(file_exists("test1.txt"), "Expected test1.txt to exist\n"); + ok(file_exists("test2.txt"), "Expected test2.txt to exist\n"); + /* try the FOF_NORECURSION flag, continues deleting subdirs */ init_shfo_tests(); shfo.pFrom = "testdir2\0";