msi/tests: Fix test failures on win2k3.

This commit is contained in:
Hans Leidekker 2015-06-22 12:12:08 +02:00 committed by Alexandre Julliard
parent b43850a363
commit 806ff30f92
1 changed files with 149 additions and 0 deletions

View File

@ -2656,6 +2656,11 @@ static void test_MsiInstallProduct(void)
/* published, reinstall */
r = MsiInstallProductA(msifile, NULL);
if (r == ERROR_INSTALL_FAILURE) /* win2k3 */
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
@ -2932,6 +2937,12 @@ static void test_continuouscabs(void)
if (r == ERROR_INSTALL_PACKAGE_REJECTED)
{
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
else
{
@ -3014,6 +3025,7 @@ static void test_continuouscabs(void)
ok(delete_pf("msitest", FALSE), "Directory not created\n");
}
error:
delete_cab_files();
DeleteFileA(msifile);
}
@ -3131,6 +3143,11 @@ static void test_mixedmedia(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest\\caesar", TRUE), "File not installed\n");
@ -3242,6 +3259,11 @@ static void test_readonlyfile(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(file_matches(path), "Expected file to be overwritten\n");
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
@ -3294,6 +3316,11 @@ static void test_readonlyfile_cab(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
memset( buf, 0, sizeof(buf) );
@ -3337,6 +3364,11 @@ static void test_setdirproperty(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_cf("msitest\\maximus", TRUE), "File not installed\n");
ok(delete_cf("msitest", FALSE), "Directory not created\n");
@ -3378,6 +3410,11 @@ static void test_cabisextracted(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
@ -3614,6 +3651,11 @@ static void test_transformprop(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
ok(!delete_pf("msitest", FALSE), "Directory created\n");
@ -3661,6 +3703,12 @@ static void test_currentworkingdir(void)
sprintf(path, "..\\%s", msifile);
r = MsiInstallProductA(path, NULL);
if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
todo_wine
{
ok(r == ERROR_FILE_NOT_FOUND, "Expected ERROR_FILE_NOT_FOUND, got %u\n", r);
@ -3675,6 +3723,11 @@ static void test_currentworkingdir(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "Directory not created\n");
@ -3747,6 +3800,11 @@ static void test_admin(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n");
ok(!delete_pf("msitest", FALSE), "Directory created\n");
@ -3825,6 +3883,11 @@ static void test_adminprops(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
ok(delete_pf("msitest", FALSE), "Directory created\n");
@ -3883,6 +3946,11 @@ static void test_missingcab(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
@ -3990,6 +4058,11 @@ static void test_customaction51(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
ok(delete_pf("msitest", FALSE), "Directory created\n");
@ -4034,6 +4107,11 @@ static void test_installstate(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\alpha", TRUE), "File not installed\n");
ok(!delete_pf("msitest\\beta", TRUE), "File installed\n");
@ -4512,6 +4590,11 @@ static void test_missingcomponent(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(pf_exists("msitest\\hydrogen"), "File not installed\n");
ok(pf_exists("msitest\\helium"), "File not installed\n");
@ -4560,6 +4643,11 @@ static void test_sourcedirprop(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File installed\n");
ok(delete_pf("msitest", FALSE), "Directory created\n");
@ -4624,6 +4712,11 @@ static void test_adminimage(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
@ -4678,6 +4771,11 @@ static void test_propcase(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "Directory not created\n");
@ -4777,6 +4875,11 @@ static void test_shortcut(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
hr = CoInitializeEx(NULL, COINIT_MULTITHREADED);
@ -4835,6 +4938,11 @@ static void test_preselected(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(!delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File installed\n");
@ -4893,6 +5001,11 @@ static void test_installed_prop(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
r = MsiInstallProductA(msifile, "FULL=1");
@ -4944,6 +5057,11 @@ static void test_allusers_prop(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
@ -5147,6 +5265,11 @@ static void test_file_in_use(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
ok(!file_matches_data(path, "msitest\\maximus"), "Expected file not to match\n");
CloseHandle(file);
@ -5209,6 +5332,11 @@ static void test_file_in_use_cab(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS_REBOOT_REQUIRED, "Expected ERROR_SUCCESS_REBOOT_REQUIRED got %u\n", r);
ok(!file_matches_data(path, "maximus"), "Expected file not to match\n");
CloseHandle(file);
@ -5263,6 +5391,11 @@ static void test_feature_override(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(pf_exists("msitest\\override.txt"), "file not installed\n");
@ -5420,6 +5553,11 @@ static void test_package_validation(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\maximus", TRUE), "file does not exist\n");
ok(delete_pf("msitest", FALSE), "directory does not exist\n");
@ -5648,6 +5786,11 @@ static void test_mixed_package(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
res = RegOpenKeyExA(HKEY_LOCAL_MACHINE, "Software\\Wine\\msitest", 0, KEY_ALL_ACCESS|KEY_WOW64_32KEY, &hkey);
@ -5790,11 +5933,17 @@ static void test_volume_props(void)
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiInstallProductA(msifile, NULL);
if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
ok(r == ERROR_SUCCESS, "got %u\n", r);
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "got %u\n", r);
error:
DeleteFileA("msitest\\volumeprop.txt");
RemoveDirectoryA("msitest");
DeleteFileA(msifile);