[PATCH] Fix test when running on Wine

Paul Vriens Paul.Vriens.Wine at gmail.com
Mon May 19 14:27:22 CDT 2008


---
 dlls/shell32/tests/shelllink.c |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

diff --git a/dlls/shell32/tests/shelllink.c b/dlls/shell32/tests/shelllink.c
index a331b10..a80fdaf 100644
--- a/dlls/shell32/tests/shelllink.c
+++ b/dlls/shell32/tests/shelllink.c
@@ -86,9 +86,7 @@ static LPITEMIDLIST path_to_pidl(const char* path)
         MultiByteToWideChar(CP_ACP, 0, path, -1, pathW, len);
 
         r=pSHILCreateFromPath(pathW, &pidl, NULL);
-        todo_wine {
         ok(SUCCEEDED(r), "SHILCreateFromPath failed (0x%08x)\n", r);
-        }
         HeapFree(GetProcessHeap(), 0, pathW);
     }
     return pidl;
@@ -170,9 +168,12 @@ static void test_get_set(void)
     ok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
     ok(lstrcmpi(buffer,str)==0, "GetPath returned '%s'\n", buffer);
 
-    /* Get some a real path to play with */
-    r=GetModuleFileName(NULL, mypath, sizeof(mypath));
-    ok(r>=0 && r<sizeof(mypath), "GetModuleFileName failed (%d)\n", r);
+    /* Get some real path to play with. Don't use GetModuleFileName as
+     * we could end up checking a non existing file. GetModuleFileName
+     * gives us this executable but it only exists as *.exe.so on Wine.
+     */
+    GetEnvironmentVariableA("windir", mypath, MAX_PATH);
+    strcat(mypath, "\\regedit.exe");
 
     /* Test the interaction of SetPath and SetIDList */
     tmp_pidl=NULL;
@@ -190,9 +191,7 @@ static void test_get_set(void)
     }
 
     pidl=path_to_pidl(mypath);
-    todo_wine {
     ok(pidl!=NULL, "path_to_pidl returned a NULL pidl\n");
-    }
 
     if (pidl)
     {
@@ -211,7 +210,9 @@ static void test_get_set(void)
         strcpy(buffer,"garbage");
         r = IShellLinkA_GetPath(sl, buffer, sizeof(buffer), NULL, SLGP_RAWPATH);
         ok(SUCCEEDED(r), "GetPath failed (0x%08x)\n", r);
+        todo_wine
         ok(lstrcmpi(buffer, mypath)==0, "GetPath returned '%s'\n", buffer);
+ 
     }
 
     /* test path with quotes (Win98 IShellLinkA_SetPath returns S_FALSE, WinXP returns S_OK) */
-- 
1.5.4.1


--------------010607010800040600050603--



More information about the wine-patches mailing list