From 3b79a7b4ac0e78152b643c721edd1ba250010919 Mon Sep 17 00:00:00 2001 From: Andrew Nguyen Date: Fri, 9 Jul 2010 04:09:52 -0500 Subject: [PATCH] msi/tests: Skip patch tests if product installation failed. --- dlls/msi/tests/patch.c | 21 ++++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c index ca0906b3683..6b4faf1cb78 100644 --- a/dlls/msi/tests/patch.c +++ b/dlls/msi/tests/patch.c @@ -700,7 +700,11 @@ static void test_simple_patch( void ) MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); r = MsiInstallProductA( msifile, NULL ); - ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + if (r != ERROR_SUCCESS) + { + skip("Product installation failed with error code %u\n", r); + goto cleanup; + } size = get_pf_file_size( "msitest\\patch.txt" ); ok( size == 1000, "expected 1000, got %u\n", size ); @@ -840,6 +844,7 @@ uninstall: ok( !delete_pf( "msitest\\patch.txt", TRUE ), "file not removed\n" ); ok( !delete_pf( "msitest", FALSE ), "directory not removed\n" ); +cleanup: DeleteFileA( msifile ); DeleteFileA( mspfile ); DeleteFileA( "msitest\\patch.txt" ); @@ -930,7 +935,11 @@ static void test_system_tables( void ) MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); r = MsiInstallProductA( msifile, NULL ); - ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + if (r != ERROR_SUCCESS) + { + skip("Product installation failed with error code %d\n", r); + goto cleanup; + } r = MsiOpenProductA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}", &hproduct ); ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); @@ -1059,6 +1068,7 @@ uninstall: r = MsiInstallProductA( msifile, "REMOVE=ALL" ); ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); +cleanup: DeleteFileA( msifile ); DeleteFileA( mspfile ); DeleteFileA( "msitest\\patch.txt" ); @@ -1085,7 +1095,11 @@ static void test_patch_registration( void ) MsiSetInternalUI( INSTALLUILEVEL_NONE, NULL ); r = MsiInstallProductA( msifile, NULL ); - ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); + if (r != ERROR_SUCCESS) + { + skip("Product installation failed with error code %d\n", r); + goto cleanup; + } r = MsiApplyPatchA( mspfile, NULL, INSTALLTYPE_DEFAULT, NULL ); ok( r == ERROR_SUCCESS || broken( r == ERROR_PATCH_PACKAGE_INVALID ), /* version 2.0 */ @@ -1151,6 +1165,7 @@ uninstall: INSTALLPROPERTY_LOCALPACKAGE, buffer, &size ); ok( r == ERROR_UNKNOWN_PRODUCT, "expected ERROR_UNKNOWN_PRODUCT, got %u\n", r ); +cleanup: DeleteFileA( msifile ); DeleteFileA( mspfile ); DeleteFileA( "msitest\\patch.txt" ); -- 2.11.4.GIT