From 050fa6a40ca0931e2eb4c9bf6224298dc5c4d377 Mon Sep 17 00:00:00 2001 From: James Hawkins Date: Wed, 13 Feb 2008 00:07:43 -0600 Subject: [PATCH] msi: Add tests for source folder resolution. --- dlls/msi/tests/install.c | 48 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) diff --git a/dlls/msi/tests/install.c b/dlls/msi/tests/install.c index 47ef2f046d5..0eb65480d5a 100644 --- a/dlls/msi/tests/install.c +++ b/dlls/msi/tests/install.c @@ -887,6 +887,18 @@ static const msi_table wrv_tables[] = ADD_TABLE(wrv_registry), }; +static const msi_table sf_tables[] = +{ + ADD_TABLE(wrv_component), + ADD_TABLE(directory), + ADD_TABLE(rof_feature), + ADD_TABLE(ci2_feature_comp), + ADD_TABLE(ci2_file), + ADD_TABLE(install_exec_seq), + ADD_TABLE(rof_media), + ADD_TABLE(property), +}; + /* cabinet definitions */ /* make the max size large so there is only one cab file */ @@ -3694,6 +3706,41 @@ static void test_writeregistryvalues(void) RemoveDirectory("msitest"); } +static void test_sourcefolder(void) +{ + UINT r; + + CreateDirectoryA("msitest", NULL); + create_file("augustus", 500); + + create_database(msifile, sf_tables, sizeof(sf_tables) / sizeof(msi_table)); + + MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL); + + r = MsiInstallProductA(msifile, NULL); + ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n"); + todo_wine + { + ok(r == ERROR_INSTALL_FAILURE, + "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + ok(!delete_pf("msitest", FALSE), "File installed\n"); + } + + RemoveDirectoryA("msitest"); + + r = MsiInstallProductA(msifile, NULL); + todo_wine + { + ok(r == ERROR_INSTALL_FAILURE, + "Expected ERROR_INSTALL_FAILURE, got %u\n", r); + ok(!delete_pf("msitest\\augustus", TRUE), "File installed\n"); + ok(!delete_pf("msitest", FALSE), "File installed\n"); + } + + DeleteFile(msifile); + DeleteFile("augustus"); +} + START_TEST(install) { DWORD len; @@ -3737,6 +3784,7 @@ START_TEST(install) test_missingcab(); test_duplicatefiles(); test_writeregistryvalues(); + test_sourcefolder(); SetCurrentDirectoryA(prev_path); }