sync msi_winetest with wine 1.1.34

svn path=/trunk/; revision=44439
This commit is contained in:
Christoph von Wittich 2009-12-06 14:46:53 +00:00
parent 00ba19e9a8
commit 88f7d4c1bb
3 changed files with 150 additions and 5 deletions

View file

@ -1506,8 +1506,7 @@ static void test_SummaryInfo(IDispatch *pSummaryInfo, const msi_summary_info *in
hr = SummaryInfo_PropertyGet(pSummaryInfo, PID_LASTSAVE_DTM, &varresult, V_VT(&var));
ok(hr == S_OK, "SummaryInfo_PropertyGet failed, hresult 0x%08x\n", hr);
/* FIXME: Off by one second */
todo_wine ok(V_DATE(&var) == V_DATE(&varresult), "SummaryInfo_PropertyGet expected %lf, but returned %lf\n", V_DATE(&var), V_DATE(&varresult));
ok(V_DATE(&var) == V_DATE(&varresult), "SummaryInfo_PropertyGet expected %lf, but returned %lf\n", V_DATE(&var), V_DATE(&varresult));
VariantClear(&varresult);
VariantClear(&var);
@ -1714,12 +1713,12 @@ static void test_Session(IDispatch *pSession)
/* Session::Mode, put */
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, TRUE);
todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
hr = Session_ModeGet(pSession, MSIRUNMODE_REBOOTATEND, &bool);
ok(hr == S_OK, "Session_ModeGet failed, hresult 0x%08x\n", hr);
ok(bool, "Reboot at end session mode is %d, expected 1\n", bool);
hr = Session_ModePut(pSession, MSIRUNMODE_REBOOTATEND, FALSE); /* set it again so we don't reboot */
todo_wine ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
ok(hr == S_OK, "Session_ModePut failed, hresult 0x%08x\n", hr);
/* Session::Database, get */
hr = Session_Database(pSession, &pDatabase);

View file

@ -7901,6 +7901,80 @@ static void test_dbmerge(void)
DeleteFileA("binary.dat");
}
static void test_select_with_tablenames(void)
{
MSIHANDLE hdb, view, rec;
LPCSTR query;
UINT r;
int i;
int vals[4][2] = {
{1,12},
{4,12},
{1,15},
{4,15}};
hdb = create_db();
ok(hdb, "failed to create db\n");
/* Build a pair of tables with the same column names, but unique data */
query = "CREATE TABLE `T1` ( `A` SHORT, `B` SHORT PRIMARY KEY `A`)";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `T1` ( `A`, `B` ) VALUES ( 1, 2 )";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `T1` ( `A`, `B` ) VALUES ( 4, 5 )";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "CREATE TABLE `T2` ( `A` SHORT, `B` SHORT PRIMARY KEY `A`)";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `T2` ( `A`, `B` ) VALUES ( 11, 12 )";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "INSERT INTO `T2` ( `A`, `B` ) VALUES ( 14, 15 )";
r = run_query(hdb, 0, query);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
/* Test that selection based on prefixing the column with the table
* actually selects the right data */
query = "SELECT T1.A, T2.B FROM T1,T2";
r = MsiDatabaseOpenView(hdb, query, &view);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiViewExecute(view, 0);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
for (i = 0; i < 4; i++)
{
r = MsiViewFetch(view, &rec);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiRecordGetInteger(rec, 1);
ok(r == vals[i][0], "Expected %d, got %d\n", vals[i][0], r);
r = MsiRecordGetInteger(rec, 2);
ok(r == vals[i][1], "Expected %d, got %d\n", vals[i][1], r);
MsiCloseHandle(rec);
}
r = MsiViewFetch(view, &rec);
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
MsiViewClose(view);
MsiCloseHandle(view);
MsiCloseHandle(hdb);
DeleteFileA(msifile);
}
UINT ordervals[6][3] =
{
{ MSI_NULL_INTEGER, 12, 13 },
@ -8579,6 +8653,7 @@ START_TEST(db)
test_dbtopackage();
test_droptable();
test_dbmerge();
test_select_with_tablenames();
test_insertorder();
test_columnorder();
test_suminfo_import();

View file

@ -920,6 +920,32 @@ static const CHAR ip_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComm
"CustomAction\tAction\n"
"TestInstalledProp\t19\t\tTest failed\t\n";
static const CHAR aup_install_exec_seq_dat[] = "Action\tCondition\tSequence\n"
"s72\tS255\tI2\n"
"InstallExecuteSequence\tAction\n"
"CostFinalize\t\t1000\n"
"ValidateProductID\t\t700\n"
"CostInitialize\t\t800\n"
"FileCost\t\t900\n"
"RemoveFiles\t\t3500\n"
"InstallFiles\t\t4000\n"
"RegisterUser\t\t6000\n"
"RegisterProduct\t\t6100\n"
"PublishFeatures\t\t6300\n"
"PublishProduct\t\t6400\n"
"InstallFinalize\t\t6600\n"
"InstallInitialize\t\t1500\n"
"ProcessComponents\t\t1600\n"
"UnpublishFeatures\t\t1800\n"
"InstallValidate\t\t1400\n"
"LaunchConditions\t\t100\n"
"TestAllUsersProp\tALLUSERS AND NOT REMOVE\t50\n";
static const CHAR aup_custom_action_dat[] = "Action\tType\tSource\tTarget\tISComments\n"
"s72\ti2\tS64\tS0\tS255\n"
"CustomAction\tAction\n"
"TestAllUsersProp\t19\t\tTest failed\t\n";
typedef struct _msi_table
{
const CHAR *filename;
@ -1547,6 +1573,19 @@ static const msi_table ip_tables[] =
ADD_TABLE(property)
};
static const msi_table aup_tables[] =
{
ADD_TABLE(component),
ADD_TABLE(directory),
ADD_TABLE(feature),
ADD_TABLE(feature_comp),
ADD_TABLE(file),
ADD_TABLE(aup_install_exec_seq),
ADD_TABLE(aup_custom_action),
ADD_TABLE(media),
ADD_TABLE(property)
};
static const msi_table fiu_tables[] =
{
ADD_TABLE(rof_component),
@ -2810,7 +2849,7 @@ static void test_readonlyfile_cab(void)
ReadFile(file, buf, sizeof(buf) - 1, &size, NULL);
CloseHandle(file);
}
ok( !lstrcmp( buf, "maximus" ), "Expected file to be overwritten, got '%s'\n", buf );
ok(!memcmp( buf, "maximus", sizeof("maximus")-1 ), "Expected file to be overwritten, got '%s'\n", buf);
ok(delete_pf("msitest\\maximus", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "File not installed\n");
@ -6730,6 +6769,37 @@ static void test_installed_prop(void)
delete_test_files();
}
static void test_allusers_prop(void)
{
UINT r;
create_test_files();
create_database(msifile, aup_tables, sizeof(aup_tables) / sizeof(msi_table));
MsiSetInternalUI(INSTALLUILEVEL_NONE, NULL);
r = MsiInstallProductA(msifile, "FULL=1");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
ok(delete_pf("msitest\\cabout\\new\\five.txt", TRUE), "File not installed\n");
ok(delete_pf("msitest\\cabout\\new", FALSE), "File not installed\n");
ok(delete_pf("msitest\\cabout\\four.txt", TRUE), "File not installed\n");
ok(delete_pf("msitest\\cabout", FALSE), "File not installed\n");
ok(delete_pf("msitest\\changed\\three.txt", TRUE), "File not installed\n");
ok(delete_pf("msitest\\changed", FALSE), "File not installed\n");
ok(delete_pf("msitest\\first\\two.txt", TRUE), "File not installed\n");
ok(delete_pf("msitest\\first", FALSE), "File not installed\n");
ok(delete_pf("msitest\\filename", TRUE), "File not installed\n");
ok(delete_pf("msitest\\one.txt", TRUE), "File installed\n");
ok(delete_pf("msitest\\service.exe", TRUE), "File not installed\n");
ok(delete_pf("msitest", FALSE), "File not installed\n");
r = MsiInstallProductA(msifile, "REMOVE=ALL");
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
delete_test_files();
}
static char session_manager[] = "System\\CurrentControlSet\\Control\\Session Manager";
static char rename_ops[] = "PendingFileRenameOperations";
@ -7065,6 +7135,7 @@ START_TEST(install)
test_file_in_use();
test_file_in_use_cab();
test_MsiSetExternalUI();
test_allusers_prop();
DeleteFileA(log_file);