Paul Vriens : msi/tests: Fix a test for systems with %TEMP% being less than 2 levels deep.
Alexandre Julliard
julliard at winehq.org
Thu Mar 12 09:54:35 CDT 2009
Module: wine
Branch: master
Commit: 7a8000d4e86805e2f43c537d24a772a92610621e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=7a8000d4e86805e2f43c537d24a772a92610621e
Author: Paul Vriens <Paul.Vriens.Wine at gmail.com>
Date: Thu Mar 12 11:06:01 2009 +0100
msi/tests: Fix a test for systems with %TEMP% being less than 2 levels deep.
---
dlls/msi/tests/install.c | 23 +++++++++++------------
1 files changed, 11 insertions(+), 12 deletions(-)
diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c
index 601b0f7..f0ee296 100644
--- a/dlls/msi/tests/install.c
+++ b/dlls/msi/tests/install.c
@@ -4193,8 +4193,8 @@ static void test_transformprop(void)
static void test_currentworkingdir(void)
{
UINT r;
- CHAR path[MAX_PATH];
- LPSTR ptr, ptr2;
+ CHAR drive[MAX_PATH], path[MAX_PATH];
+ LPSTR ptr;
CreateDirectoryA("msitest", NULL);
create_file("msitest\\augustus", 500);
@@ -4221,18 +4221,17 @@ static void test_currentworkingdir(void)
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "File not installed\n");
- lstrcpyA(path, CURR_DIR);
+ lstrcpyA(drive, CURR_DIR);
+ drive[2] = '\\';
+ drive[3] = '\0';
+ SetCurrentDirectoryA(drive);
+
+ lstrcpy(path, CURR_DIR);
if (path[lstrlenA(path) - 1] != '\\')
lstrcatA(path, "\\");
- lstrcatA(path, "msitest.msi");
-
- ptr2 = strrchr(path, '\\');
- *ptr2 = '\0';
- ptr = strrchr(path, '\\');
- *ptr2 = '\\';
- *(ptr++) = '\0';
-
- SetCurrentDirectoryA(path);
+ lstrcatA(path, msifile);
+ ptr = strchr(path, ':');
+ ptr +=2;
r = MsiInstallProductA(ptr, NULL);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
More information about the wine-cvs
mailing list