Hans Leidekker : msi: Add a test to show that MsiOpenPackage must apply any existing patches.

Alexandre Julliard julliard at winehq.org
Wed Apr 21 10:40:22 CDT 2010


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

Author: Hans Leidekker <hans at codeweavers.com>
Date:   Wed Apr 21 11:37:29 2010 +0200

msi: Add a test to show that MsiOpenPackage must apply any existing patches.

---

 dlls/msi/tests/patch.c |   24 ++++++++++++++++++++++++
 1 files changed, 24 insertions(+), 0 deletions(-)

diff --git a/dlls/msi/tests/patch.c b/dlls/msi/tests/patch.c
index e889cf4..41651ab 100644
--- a/dlls/msi/tests/patch.c
+++ b/dlls/msi/tests/patch.c
@@ -674,6 +674,8 @@ static void test_simple_patch( void )
     UINT r;
     DWORD size;
     char path[MAX_PATH];
+    const char *query;
+    MSIHANDLE hpackage, hdb, hview, hrec;
 
     if (!pMsiApplyPatchA)
     {
@@ -712,6 +714,28 @@ static void test_simple_patch( void )
     strcat( path, "\\" );
     strcat( path, msifile );
 
+    r = MsiOpenPackageA( path, &hpackage );
+    ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
+
+    hdb = MsiGetActiveDatabase( hpackage );
+    ok( hdb, "failed to get database handle\n" );
+
+    query = "SELECT * FROM `Property` where `Property` = 'PATCHNEWPACKAGECODE'";
+    r = MsiDatabaseOpenView( hdb, query, &hview );
+    ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
+
+    r = MsiViewExecute( hview, 0 );
+    ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
+
+    r = MsiViewFetch( hview, &hrec );
+    todo_wine ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
+
+    MsiCloseHandle( hrec );
+    MsiViewClose( hview );
+    MsiCloseHandle( hview );
+    MsiCloseHandle( hdb );
+    MsiCloseHandle( hpackage );
+
     r = MsiInstallProductA( msifile, "REMOVE=ALL" );
     ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
 




More information about the wine-cvs mailing list