msi: Add a test to show that patches are not committed to the local package database.

This commit is contained in:
Hans Leidekker 2010-05-11 14:01:47 +02:00 committed by Alexandre Julliard
parent 2b07eadf0a
commit 06a8cc2a06
1 changed files with 24 additions and 0 deletions

View File

@ -717,6 +717,7 @@ static void test_simple_patch( void )
strcat( path, "\\" ); strcat( path, "\\" );
strcat( path, msifile ); strcat( path, msifile );
/* show that MsiOpenPackage applies registered patches */
r = MsiOpenPackageA( path, &hpackage ); r = MsiOpenPackageA( path, &hpackage );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
@ -739,6 +740,29 @@ static void test_simple_patch( void )
MsiCloseHandle( hdb ); MsiCloseHandle( hdb );
MsiCloseHandle( hpackage ); MsiCloseHandle( hpackage );
/* show that patches are not committed to the local package database */
size = sizeof(path);
r = MsiGetProductInfoA( "{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}",
"LocalPackage", path, &size );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
r = MsiOpenDatabaseA( path, MSIDBOPEN_READONLY, &hdb );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );
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 );
ok( r == ERROR_NO_MORE_ITEMS, "expected ERROR_NO_MORE_ITEMS, got %u\n", r );
MsiCloseHandle( hrec );
MsiViewClose( hview );
MsiCloseHandle( hview );
MsiCloseHandle( hdb );
r = MsiInstallProductA( msifile, "REMOVE=ALL" ); r = MsiInstallProductA( msifile, "REMOVE=ALL" );
ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r ); ok( r == ERROR_SUCCESS, "expected ERROR_SUCCESS, got %u\n", r );