[PATCH] fusion/tests: Do not use a fixed path to the assembly

Detlef Riekenberg wine.dev at web.de
Thu Feb 19 18:08:52 CST 2009


---
 dlls/fusion/tests/asmcache.c |   35 +++++++++++++++++++++++++----------
 1 files changed, 25 insertions(+), 10 deletions(-)

diff --git a/dlls/fusion/tests/asmcache.c b/dlls/fusion/tests/asmcache.c
index c5e4acd..98039ad 100644
--- a/dlls/fusion/tests/asmcache.c
+++ b/dlls/fusion/tests/asmcache.c
@@ -887,7 +887,10 @@ static void test_InstallAssembly(void)
     HRESULT hr;
     ULONG disp;
     DWORD attr;
+    CHAR fullname[MAX_PATH];
+    LPSTR ptr;
 
+    static const CHAR  location[] = "\\assembly\\GAC_MSIL\\wine\\1.0.0.0__2d03617b1c31e2f5\\wine.dll";
     static const WCHAR empty[] = {0};
     static const WCHAR noext[] = {'f','i','l','e',0};
     static const WCHAR badext[] = {'f','i','l','e','.','b','a','d',0};
@@ -940,8 +943,9 @@ static void test_InstallAssembly(void)
     hr = IAssemblyCache_InstallAssembly(cache, 0, winedll, NULL);
     ok(hr == S_OK, "Expected S_OK, got %08x\n", hr);
 
-    attr = GetFileAttributes("C:\\windows\\assembly\\GAC_MSIL\\wine\\"
-                             "1.0.0.0__2d03617b1c31e2f5/wine.dll");
+    GetWindowsDirectoryA(fullname, sizeof(fullname) - sizeof(location));
+    lstrcatA(fullname, location);
+    attr = GetFileAttributes(fullname);
     ok(attr != INVALID_FILE_ATTRIBUTES, "Expected assembly to exist\n");
 
     /* uninstall the assembly from the GAC */
@@ -955,10 +959,13 @@ static void test_InstallAssembly(void)
     }
 
     /* FIXME: remove once UninstallAssembly is implemented */
-    DeleteFileA("C:\\windows\\assembly\\GAC_MSIL\\wine\\"
-                "1.0.0.0__2d03617b1c31e2f5\\wine.dll");
-    RemoveDirectoryA("C:\\windows\\assembly\\GAC_MSIL\\wine\\1.0.0.0__2d03617b1c31e2f5");
-    RemoveDirectoryA("C:\\windows\\assembly\\GAC_MSIL\\wine");
+    DeleteFileA(fullname);
+    ptr = strrchr(fullname, '\\');
+    ptr[0] = '\0';
+    RemoveDirectoryA(fullname);
+    ptr = strrchr(fullname, '\\');
+    ptr[0] = '\0';
+    RemoveDirectoryA(fullname);
 
     DeleteFileA("test.dll");
     DeleteFileA("wine.dll");
@@ -982,7 +989,10 @@ static void test_QueryAssemblyInfo(void)
     HRESULT hr;
     DWORD size;
     ULONG disp;
+    CHAR fullname[MAX_PATH];
+    LPSTR ptr;
 
+    static const CHAR  location[] = "\\assembly\\GAC_MSIL\\wine\\1.0.0.0__2d03617b1c31e2f5\\wine.dll";
     static const WCHAR empty[] = {0};
     static const WCHAR commasep[] = {',',' ',0};
     static const WCHAR winedll[] = {'w','i','n','e','.','d','l','l',0};
@@ -1475,10 +1485,15 @@ static void test_QueryAssemblyInfo(void)
     }
 
     /* FIXME: remove once UninstallAssembly is implemented */
-    DeleteFileA("C:\\windows\\assembly\\GAC_MSIL\\wine\\"
-                "1.0.0.0__2d03617b1c31e2f5\\wine.dll");
-    RemoveDirectoryA("C:\\windows\\assembly\\GAC_MSIL\\wine\\1.0.0.0__2d03617b1c31e2f5");
-    RemoveDirectoryA("C:\\windows\\assembly\\GAC_MSIL\\wine");
+    GetWindowsDirectoryA(fullname, sizeof(fullname) - sizeof(location));
+    lstrcatA(fullname, location);
+    DeleteFileA(fullname);
+    ptr = strrchr(fullname, '\\');
+    ptr[0] = '\0';
+    RemoveDirectoryA(fullname);
+    ptr = strrchr(fullname, '\\');
+    ptr[0] = '\0';
+    RemoveDirectoryA(fullname);
 
     DeleteFileA("test.dll");
     DeleteFileA("wine.dll");
-- 
1.5.4.3


--=-pOJCVuIuKXZCdvEj02Qc--




More information about the wine-patches mailing list