From 2e19d49538e2829f48f78a29403166479abe4016 Mon Sep 17 00:00:00 2001 From: Mike McCormack Date: Thu, 5 Oct 2006 13:40:52 +0900 Subject: [PATCH] msi: Check that transforms preserve tables. --- dlls/msi/tests/db.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/dlls/msi/tests/db.c b/dlls/msi/tests/db.c index 318d1676db..a06547751b 100644 --- a/dlls/msi/tests/db.c +++ b/dlls/msi/tests/db.c @@ -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); }