msi/tests: Fix test when run on a different drive than C:\.
Nicolas Le Cam
niko.lecam at gmail.com
Fri Apr 10 08:04:09 CDT 2009
---
dlls/msi/tests/package.c | 18 +++++++++++++-----
1 files changed, 13 insertions(+), 5 deletions(-)
diff --git a/dlls/msi/tests/package.c b/dlls/msi/tests/package.c
index c5c3b67..880dbbb 100644
--- a/dlls/msi/tests/package.c
+++ b/dlls/msi/tests/package.c
@@ -31,6 +31,7 @@
static const char msifile[] = "winetest.msi";
char CURR_DIR[MAX_PATH];
+char WIN_DIR[MAX_PATH];
static void get_user_sid(LPSTR *usersid)
{
@@ -8298,9 +8299,7 @@ static void delete_win_ini(LPCSTR file)
{
CHAR path[MAX_PATH];
- GetWindowsDirectoryA(path, MAX_PATH);
- lstrcatA(path, "\\");
- lstrcatA(path, file);
+ sprintf(path, "%s\\%s", WIN_DIR, file);
DeleteFileA(path);
}
@@ -8723,11 +8722,19 @@ static void test_appsearch_drlocator(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
+ /*
+ * MsiGetProperty returns something if current drive is the same as
+ * system drive (mostly C:\) or if current path has an equivalent on
+ * system drive (i.e. X:\temp and C:\temp).
+ */
size = MAX_PATH;
- sprintf(path, "%s\\", CURR_DIR);
+ sprintf(path, "%.2s\\%s\\", WIN_DIR, CURR_DIR + 3);
r = MsiGetPropertyA(hpkg, "SIGPROP3", prop, &size);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
- ok(!lstrcmpA(prop, path), "Expected \"%s\", got \"%s\"\n", path, prop);
+ todo_wine
+ ok(!lstrcmpA(prop, path) ||
+ !lstrcmpA(prop, ""),
+ "Expected \"%s\", got \"%s\"\n", path, prop);
size = MAX_PATH;
r = MsiGetPropertyA(hpkg, "SIGPROP4", prop, &size);
@@ -11485,6 +11492,7 @@ static void test_MsiSetProperty(void)
START_TEST(package)
{
+ GetWindowsDirectoryA(WIN_DIR, MAX_PATH);
GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
test_createpackage();
--
1.6.0.4
--=-M88z/j+pNGZN2ba5/DD6--
More information about the wine-patches
mailing list