msi/tests: Avoid test failures on win2k3.

This commit is contained in:
Hans Leidekker 2015-07-10 12:53:55 +02:00 committed by Alexandre Julliard
parent 9e94232711
commit b71075ad9b
1 changed files with 5 additions and 146 deletions

View File

@ -2656,11 +2656,6 @@ 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");
@ -2939,11 +2934,6 @@ static void test_continuouscabs(void)
skip("Not enough rights to perform tests\n");
goto error;
}
else if (r == ERROR_INSTALL_FAILURE)
{
win_skip("broken result\n");
goto error;
}
else
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
@ -3143,11 +3133,6 @@ 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");
@ -3174,7 +3159,7 @@ static void test_samesequence(void)
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE), "Expected ERROR_SUCCESS, got %u\n", r);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
if (r == ERROR_SUCCESS)
{
ok(delete_pf("msitest\\augustus", TRUE), "File not installed\n");
@ -3196,7 +3181,7 @@ static void test_uiLevelFlags(void)
MsiSetInternalUI(INSTALLUILEVEL_NONE | INSTALLUILEVEL_SOURCERESONLY, NULL);
r = MsiInstallProductA(msifile, NULL);
ok(r == ERROR_SUCCESS || broken(r == ERROR_INSTALL_FAILURE), "Expected ERROR_SUCCESS, got %u\n", r);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
if (r == ERROR_SUCCESS)
{
ok(!delete_pf("msitest\\maximus", TRUE), "UI install occurred, but execute-only was requested.\n");
@ -3259,11 +3244,6 @@ 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");
@ -3316,11 +3296,6 @@ 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) );
@ -3364,11 +3339,6 @@ 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");
@ -3410,11 +3380,6 @@ 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");
@ -3651,11 +3616,6 @@ 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");
@ -3703,12 +3663,6 @@ 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);
@ -3723,11 +3677,6 @@ 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");
@ -3800,11 +3749,6 @@ 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");
@ -3883,11 +3827,6 @@ 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");
@ -3946,11 +3885,6 @@ 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");
@ -4058,11 +3992,6 @@ 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");
@ -4107,11 +4036,6 @@ 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");
@ -4643,11 +4567,6 @@ 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");
@ -4712,11 +4631,6 @@ 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");
@ -4771,11 +4685,6 @@ 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");
@ -4875,11 +4784,6 @@ 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);
@ -4938,11 +4842,6 @@ 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");
@ -5001,11 +4900,6 @@ 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");
@ -5057,11 +4951,6 @@ 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");
@ -5198,7 +5087,7 @@ static void process_pending_renames(HKEY hkey)
else
{
fileret = DeleteFileA(src);
ok(fileret, "Failed to delete file %s (%u)\n", src, GetLastError());
ok(fileret || broken(!fileret) /* win2k3 */, "Failed to delete file %s (%u)\n", src, GetLastError());
}
}
@ -5265,11 +5154,6 @@ 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);
@ -5332,11 +5216,6 @@ 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);
@ -5391,11 +5270,6 @@ 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");
@ -5553,11 +5427,6 @@ 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");
@ -5786,11 +5655,6 @@ 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);
@ -5933,17 +5797,11 @@ 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);
@ -6039,7 +5897,8 @@ START_TEST(install)
lstrcatA(log_file, "\\msitest.log");
MsiEnableLogA(INSTALLLOGMODE_FATALEXIT, log_file, 0);
test_MsiInstallProduct();
if (pSRSetRestorePointA) /* test has side-effects on win2k3 that cause failures in following tests */
test_MsiInstallProduct();
test_MsiSetComponentState();
test_packagecoltypes();
test_continuouscabs();