Andrew Nguyen : msi/tests: Skip patch tests if product installation failed.

Alexandre Julliard julliard at winehq.org
Fri Jul 9 09:46:26 CDT 2010


Module: wine
Branch: master
Commit: 3b79a7b4ac0e78152b643c721edd1ba250010919
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=3b79a7b4ac0e78152b643c721edd1ba250010919

Author: Andrew Nguyen <anguyen at codeweavers.com>
Date:   Fri Jul  9 04:09:52 2010 -0500

msi/tests: Skip patch tests if product installation failed.

---

 dlls/msi/tests/patch.c |   21 ++++++++++++++++++---
 1 files changed, 18 insertions(+), 3 deletions(-)

diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c
index ca0906b..6b4faf1 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" );




More information about the wine-cvs mailing list