msi/tests: Run tests again with older msi versions (MsiApplyMultiplePatchesA).

This commit is contained in:
Detlef Riekenberg 2009-05-04 23:08:52 +02:00 committed by Alexandre Julliard
parent 6f60208401
commit a31e9a1bfa
1 changed files with 20 additions and 9 deletions

View File

@ -32,6 +32,8 @@
static const char msifile[] = "winetest.msi"; static const char msifile[] = "winetest.msi";
char CURR_DIR[MAX_PATH]; char CURR_DIR[MAX_PATH];
static UINT (WINAPI *pMsiApplyMultiplePatchesA)(LPCSTR, LPCSTR, LPCSTR);
static void get_user_sid(LPSTR *usersid) static void get_user_sid(LPSTR *usersid)
{ {
HANDLE token; HANDLE token;
@ -11537,13 +11539,18 @@ static void test_MsiApplyMultiplePatches(void)
{ {
UINT r, type = GetDriveType(NULL); UINT r, type = GetDriveType(NULL);
r = MsiApplyMultiplePatchesA(NULL, NULL, NULL); if (!pMsiApplyMultiplePatchesA) {
win_skip("MsiApplyMultiplePatchesA not found\n");
return;
}
r = pMsiApplyMultiplePatchesA(NULL, NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r); ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
r = MsiApplyMultiplePatchesA("", NULL, NULL); r = pMsiApplyMultiplePatchesA("", NULL, NULL);
ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r); ok(r == ERROR_INVALID_PARAMETER, "Expected ERROR_INVALID_PARAMETER, got %u\n", r);
r = MsiApplyMultiplePatchesA(";", NULL, NULL); r = pMsiApplyMultiplePatchesA(";", NULL, NULL);
todo_wine todo_wine
{ {
if (type == DRIVE_FIXED) if (type == DRIVE_FIXED)
@ -11554,7 +11561,7 @@ static void test_MsiApplyMultiplePatches(void)
"Expected ERROR_INVALID_NAME, got %u\n", r); "Expected ERROR_INVALID_NAME, got %u\n", r);
} }
r = MsiApplyMultiplePatchesA(" ;", NULL, NULL); r = pMsiApplyMultiplePatchesA(" ;", NULL, NULL);
todo_wine todo_wine
{ {
if (type == DRIVE_FIXED) if (type == DRIVE_FIXED)
@ -11565,7 +11572,7 @@ static void test_MsiApplyMultiplePatches(void)
"Expected ERROR_INVALID_NAME, got %u\n", r); "Expected ERROR_INVALID_NAME, got %u\n", r);
} }
r = MsiApplyMultiplePatchesA(";;", NULL, NULL); r = pMsiApplyMultiplePatchesA(";;", NULL, NULL);
todo_wine todo_wine
{ {
if (type == DRIVE_FIXED) if (type == DRIVE_FIXED)
@ -11576,10 +11583,10 @@ static void test_MsiApplyMultiplePatches(void)
"Expected ERROR_INVALID_NAME, got %u\n", r); "Expected ERROR_INVALID_NAME, got %u\n", r);
} }
r = MsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL); r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;", NULL, NULL);
todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
r = MsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL); r = pMsiApplyMultiplePatchesA(";nosuchpatchpackage", NULL, NULL);
todo_wine todo_wine
{ {
if (type == DRIVE_FIXED) if (type == DRIVE_FIXED)
@ -11590,15 +11597,19 @@ static void test_MsiApplyMultiplePatches(void)
"Expected ERROR_INVALID_NAME, got %u\n", r); "Expected ERROR_INVALID_NAME, got %u\n", r);
} }
r = MsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL); r = pMsiApplyMultiplePatchesA("nosuchpatchpackage;nosuchpatchpackage", NULL, NULL);
todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
r = MsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL); r = pMsiApplyMultiplePatchesA(" nosuchpatchpackage ; nosuchpatchpackage ", NULL, NULL);
todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r); todo_wine ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
} }
START_TEST(package) START_TEST(package)
{ {
HMODULE hmsi = GetModuleHandleA("msi.dll");
pMsiApplyMultiplePatchesA = (void *)GetProcAddress(hmsi, "MsiApplyMultiplePatchesA");
GetCurrentDirectoryA(MAX_PATH, CURR_DIR); GetCurrentDirectoryA(MAX_PATH, CURR_DIR);
test_createpackage(); test_createpackage();