Francois Gouget : shlwapi/tests: Skip some tests if not allowed to modify the registry.

Alexandre Julliard julliard at winehq.org
Wed Sep 21 13:35:14 CDT 2011


Module: wine
Branch: master
Commit: fcb351b40fc50f0f0294744154cb78c54689c9ab
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=fcb351b40fc50f0f0294744154cb78c54689c9ab

Author: Francois Gouget <fgouget at free.fr>
Date:   Wed Sep 21 00:40:08 2011 +0200

shlwapi/tests: Skip some tests if not allowed to modify the registry.

---

 dlls/shlwapi/tests/ordinal.c |   13 +++++++++----
 1 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/dlls/shlwapi/tests/ordinal.c b/dlls/shlwapi/tests/ordinal.c
index cde3378..8316112 100644
--- a/dlls/shlwapi/tests/ordinal.c
+++ b/dlls/shlwapi/tests/ordinal.c
@@ -2853,13 +2853,18 @@ static void test_SHGetShellKey(void)
     hkey = pSHGetShellKey(SHKEY_Root_HKLM, WineTestW, FALSE);
     ok(hkey == NULL, "hkey != NULL\n");
 
-    hkey = pSHGetShellKey(SHKEY_Root_HKLM, WineTestW, TRUE);
-    ok(hkey != NULL, "Can't create key\n");
+    hkey = pSHGetShellKey(SHKEY_Root_HKLM, NULL, FALSE);
+    ok(hkey != NULL, "Can't open key\n");
+    ok(SUCCEEDED(RegDeleteKeyW(hkey, WineTestW)), "Can't delte key\n");
     RegCloseKey(hkey);
 
-    hkey = pSHGetShellKey(SHKEY_Root_HKLM, NULL, FALSE);
+    hkey = pSHGetShellKey(SHKEY_Root_HKLM, WineTestW, TRUE);
+    if (!hkey && GetLastError() == ERROR_ACCESS_DENIED)
+    {
+        skip("Not authorized to create keys\n");
+        return;
+    }
     ok(hkey != NULL, "Can't create key\n");
-    ok(SUCCEEDED(RegDeleteKeyW(hkey, WineTestW)), "Can't delte key\n");
     RegCloseKey(hkey);
 
     if (!pSKGetValueW || !pSKSetValueW || !pSKDeleteValueW || !pSKAllocValueW)




More information about the wine-cvs mailing list