Hans Leidekker : shell32/tests: Skip SHFileOperation tests if the user doesn't have admin rights.
Alexandre Julliard
julliard at winehq.org
Tue Dec 20 16:23:24 CST 2016
Module: wine
Branch: master
Commit: a2556760ec6995932e883e11fa93563b271a3951
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a2556760ec6995932e883e11fa93563b271a3951
Author: Hans Leidekker <hans at codeweavers.com>
Date: Tue Dec 20 12:07:52 2016 +0100
shell32/tests: Skip SHFileOperation tests if the user doesn't have admin rights.
Signed-off-by: Hans Leidekker <hans at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/shell32/tests/shlfileop.c | 8 +++++++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/dlls/shell32/tests/shlfileop.c b/dlls/shell32/tests/shlfileop.c
index d74c59a..4ae93ff 100644
--- a/dlls/shell32/tests/shlfileop.c
+++ b/dlls/shell32/tests/shlfileop.c
@@ -820,7 +820,7 @@ static void test_rename(void)
retval == DE_FILEDESTISFLD || /* Vista, running from c: */
broken(retval == DE_OPCANCELLED) || /* Win9x */
broken(retval == 65652), /* NT4 */
- "Expected ERROR_CANCELLED or DE_DIFFDIR\n");
+ "Expected ERROR_CANCELLED or DE_DIFFDIR, got %u\n", retval);
ok(file_exists("test1.txt"), "Expected test1.txt to exist\n");
/* pFrom is empty */
@@ -2517,6 +2517,11 @@ static void test_unicode(void)
skip("Unicode tests skipped on non-unicode system\n");
return;
}
+ if (GetLastError()==ERROR_ACCESS_DENIED)
+ {
+ skip("test needs admin rights\n");
+ return;
+ }
CloseHandle(file);
/* Try to delete a file with unicode filename */
@@ -2575,6 +2580,7 @@ static void test_unicode(void)
ok(GetLastError() == ERROR_SUCCESS ||
broken(GetLastError() == ERROR_INVALID_HANDLE), /* WinXp, win2k3 */
"Expected ERROR_SUCCESS, got %d\n", GetLastError());
+ DeleteFileW(UNICODE_PATH_TO);
/* Check last error after a failed file operation. */
DeleteFileW(UNICODE_PATH);
More information about the wine-cvs
mailing list