[PATCH 2/3 resend] kernel32/tests: Correct ReplaceFileW error checking

Brock York twunknown at gmail.com
Mon Sep 3 05:15:19 CDT 2018


Check that ReplaceFileW returned 0 indicating
failure and that the error code was access denied.
This corrects the error checking for the test case
where ReplaceFileW should fail with ACCESS_DENIED
on a file with the READ_ONLY attribute set.

Tested on a Windows 10 and Windows XP vm and
also passed on all vm's on the wine test bot

Signed-off-by: Brock York <twunknown at gmail.com>
---
 dlls/kernel32/tests/file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/kernel32/tests/file.c b/dlls/kernel32/tests/file.c
index 2e2c55bcc9..33cae4b7c4 100644
--- a/dlls/kernel32/tests/file.c
+++ b/dlls/kernel32/tests/file.c
@@ -3666,7 +3666,7 @@ static void test_ReplaceFileA(void)
      */
     SetLastError(0xdeadbeef);
     ret = pReplaceFileA(replaced, replacement, backup, 0, 0, 0);
-    ok(ret != ERROR_UNABLE_TO_REMOVE_REPLACED, "ReplaceFileA: unexpected error %d\n", GetLastError());
+    todo_wine ok(ret == 0 && GetLastError() == ERROR_ACCESS_DENIED, "ReplaceFileA: unexpected error %d\n", GetLastError());
     /* make sure that the replacement file still exists */
     hReplacementFile = CreateFileA(replacement, GENERIC_READ, FILE_SHARE_READ, NULL, OPEN_EXISTING, 0, 0);
     ok(hReplacementFile != INVALID_HANDLE_VALUE ||
-- 
2.18.0




More information about the wine-devel mailing list