msi: Check that transforms preserve tables.

This commit is contained in:
Mike McCormack 2006-10-05 13:40:52 +09:00 committed by Alexandre Julliard
parent 33c6347472
commit 2e19d49538

View File

@ -1720,6 +1720,14 @@ static void test_generate_transform(void)
r = run_query(hdb1, 0, query);
ok(r == ERROR_SUCCESS, "failed to add table\n");
query = "INSERT INTO `AAR` ( `BAR`, `CAR` ) VALUES ( 1, 'vw' )";
r = run_query(hdb1, 0, query);
ok(r == ERROR_SUCCESS, "failed to add row 1\n");
query = "INSERT INTO `AAR` ( `BAR`, `CAR` ) VALUES ( 2, 'bmw' )";
r = run_query(hdb1, 0, query);
ok(r == ERROR_SUCCESS, "failed to add row 2\n");
todo_wine {
r = MsiDatabaseGenerateTransform(hdb1, hdb2, NULL, 0, 0);
ok( r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r );
@ -1727,11 +1735,19 @@ static void test_generate_transform(void)
r = MsiDatabaseGenerateTransform(hdb1, hdb2, mstfile, 0, 0);
ok( r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r );
/* database needs to be committed */
MsiDatabaseCommit(hdb1);
r = MsiDatabaseGenerateTransform(hdb1, hdb2, mstfile, 0, 0);
ok( r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r );
MsiCloseHandle( hdb1 );
r = MsiDatabaseApplyTransform( hdb2, mstfile, 0 );
ok( r == ERROR_SUCCESS, "return code %d, should be ERROR_SUCCESS\n", r );
MsiDatabaseCommit(hdb2);
/* apply the same transform again? */
r = MsiDatabaseApplyTransform( hdb2, mstfile, 0 );
ok( r == ERROR_INSTALL_TRANSFORM_FAILURE,
@ -1741,6 +1757,18 @@ static void test_generate_transform(void)
MsiCloseHandle( hdb2 );
DeleteFile(msifile);
r = MsiOpenDatabase(msifile2, MSIDBOPEN_READONLY, &hdb1 );
ok( r == ERROR_SUCCESS , "Failed to create database\n" );
todo_wine {
query = "select `BAR`,`CAR` from `AAR`";
r = run_query(hdb1, 0, query);
ok(r == ERROR_SUCCESS, "select query failed\n");
}
MsiCloseHandle( hdb1 );
DeleteFile(msifile2);
DeleteFile(mstfile);
}