Paul Vriens : shlwapi/tests: Fix some test failures on Vista.

Alexandre Julliard julliard at winehq.org
Wed Dec 17 09:39:54 CST 2008


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

Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date:   Wed Dec 17 10:46:49 2008 +0100

shlwapi/tests: Fix some test failures on Vista.

---

 dlls/shlwapi/tests/shreg.c |   21 ++++++++++++---------
 1 files changed, 12 insertions(+), 9 deletions(-)

diff --git a/dlls/shlwapi/tests/shreg.c b/dlls/shlwapi/tests/shreg.c
index 77a47e2..f088c2e 100644
--- a/dlls/shlwapi/tests/shreg.c
+++ b/dlls/shlwapi/tests/shreg.c
@@ -31,7 +31,7 @@
 
 /* Keys used for testing */
 #define REG_TEST_KEY        "Software\\Wine\\Test"
-#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion"
+#define REG_CURRENT_VERSION "Software\\Microsoft\\Windows\\CurrentVersion\\explorer"
 
 static HMODULE hshlwapi;
 typedef DWORD (WINAPI *SHCopyKeyA_func)(HKEY,LPCSTR,HKEY,DWORD);
@@ -284,6 +284,12 @@ static void test_SHCopyKey(void)
 	HKEY hKeySrc, hKeyDst;
         DWORD dwRet;
 
+        if (!pSHCopyKeyA)
+        {
+            win_skip("SHCopyKeyA is not available\n");
+            return;
+        }
+
 	/* Delete existing destination sub keys */
 	hKeyDst = NULL;
 	if (!RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination", &hKeyDst) && hKeyDst)
@@ -305,22 +311,19 @@ static void test_SHCopyKey(void)
         if (dwRet || !hKeySrc)
 	{
                 ok( 0, "Source couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
+                RegCloseKey(hKeyDst);
 		return;
 	}
 
-
-	if (pSHCopyKeyA)
-        {
-                dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
-                ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet);
-        }
+        dwRet = (*pSHCopyKeyA)(hKeySrc, NULL, hKeyDst, 0);
+        ok ( ERROR_SUCCESS == dwRet, "Copy failed, ret=(%u)\n", dwRet);
 
 	RegCloseKey(hKeySrc);
 	RegCloseKey(hKeyDst);
 
         /* Check we copied the sub keys, i.e. something that's on every windows system (including Wine) */
 	hKeyDst = NULL;
-        dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Setup", &hKeyDst);
+        dwRet = RegOpenKeyA(HKEY_CURRENT_USER, REG_TEST_KEY "\\CopyDestination\\Shell Folders", &hKeyDst);
         if (dwRet || !hKeyDst)
 	{
                 ok ( 0, "Copy couldn't be opened, RegOpenKeyA returned (%u)\n", dwRet);
@@ -328,7 +331,7 @@ static void test_SHCopyKey(void)
 	}
 
 	/* And the we copied the values too */
-	ok(!SHQueryValueExA(hKeyDst, "BootDir", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
+	ok(!SHQueryValueExA(hKeyDst, "Common AppData", NULL, NULL, NULL, NULL), "SHQueryValueExA failed\n");
 
 	RegCloseKey(hKeyDst);
 }




More information about the wine-cvs mailing list