From: "Olivier F. R. Dierick" Subject: [2/2] shell32/tests: Check if error status is reset after successful file copy Message-Id: <1438119266.32054.20.camel@piezo3.piezo-forte.be> Date: Tue, 28 Jul 2015 23:34:26 +0200 Addresses bug 36838. Add test to check if GetLastError() returns ERROR_SUCCESS after a successful file copy with SHFileOperationA() (calls SHNotifyCopyFileW() internally). Tested on Windows Vista. --- dlls/shell32/tests/shlfileop.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) -- Olivier F. R. Dierick o.dierick@piezo-forte.be From 2c7d449867b94570e23b171f5ea8404d99923587 Mon Sep 17 00:00:00 2001 From: "Olivier F. R. Dierick" Date: Tue, 28 Jul 2015 22:27:00 +0200 Subject: Check if error status is reset after successful file copy --- dlls/shell32/tests/shlfileop.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c index d33ad5b..36f3051 100644 --- a/dlls/shell32/tests/shlfileop.c +++ b/dlls/shell32/tests/shlfileop.c @@ -1819,6 +1819,18 @@ static void test_copy(void) ok(DeleteFileA("abcdefgh.abc"), "Expected file to exist\n"); ok(DeleteFileA("dir\\abcdefgh.abc"), "Expected file to exist\n"); ok(RemoveDirectoryA("dir"), "Expected dir to exist\n"); + + /* check if error status is reset after successful file copy */ + clean_after_shfo_tests(); + init_shfo_tests(); + shfo.pFrom = "test1.txt\0"; + shfo.pTo = "testdir2\0"; + shfo.fFlags = FOF_NOCONFIRMATION | FOF_SILENT | FOF_NOERRORUI; + SetLastError(0xdeadbeef); + retval = SHFileOperationA(&shfo); + ok(retval == ERROR_SUCCESS, "File copy failed with %d\n", retval); + ok(!shfo.fAnyOperationsAborted, "Didn't expect aborted operations\n"); + ok(GetLastError() == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", GetLastError()); } /* tests the FO_MOVE action */ -- 1.7.10.4