Nikolay Sivov : ole32/tests: Fix tests failing on limited account.

Alexandre Julliard julliard at wine.codeweavers.com
Mon Mar 7 08:50:37 CST 2016


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

Author: Nikolay Sivov <nsivov at codeweavers.com>
Date:   Sat Mar  5 08:02:17 2016 +0300

ole32/tests: Fix tests failing on limited account.

Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>

---

 dlls/ole32/tests/compobj.c | 12 ++++++++----
 1 file changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/ole32/tests/compobj.c b/dlls/ole32/tests/compobj.c
index b88029f..49aced9 100644
--- a/dlls/ole32/tests/compobj.c
+++ b/dlls/ole32/tests/compobj.c
@@ -2364,17 +2364,21 @@ static void test_OleRegGetUserType(void)
     StringFromGUID2(&CLSID_non_existent, clsidW, sizeof(clsidW)/sizeof(clsidW[0]));
 
     ret = RegCreateKeyExW(HKEY_CLASSES_ROOT, clsidkeyW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &clsidhkey, &disposition);
+    if (!ret)
+    {
+        ret = RegCreateKeyExW(clsidhkey, clsidW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &classkey, NULL);
+        if (ret)
+            RegCloseKey(clsidhkey);
+    }
+
     if (ret == ERROR_ACCESS_DENIED)
     {
-        skip("Failed to create test key, skipping some of OleRegGetUserType() tests.\n");
+        win_skip("Failed to create test key, skipping some of OleRegGetUserType() tests.\n");
         return;
     }
 
     ok(!ret, "failed to create a key %d, error %d\n", ret, GetLastError());
 
-    ret = RegCreateKeyExW(clsidhkey, clsidW, 0, NULL, 0, KEY_ALL_ACCESS, NULL, &classkey, NULL);
-    ok(!ret, "failed to create a key %d, error %d\n", ret, GetLastError());
-
     ret = RegSetValueExW(classkey, NULL, 0, REG_SZ, (const BYTE*)defvalueW, sizeof(defvalueW));
     ok(!ret, "got %d, error %d\n", ret, GetLastError());
 




More information about the wine-cvs mailing list