Commit 6be7ba75 authored by James Hawkins's avatar James Hawkins Committed by Alexandre Julliard

msi: Implement MsiDatabaseImport.

parent 4301816d
......@@ -1396,91 +1396,66 @@ static void test_msiimport(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = add_table_to_db(hdb, test_data);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
query = "SELECT * FROM `TestTable`";
r = MsiDatabaseOpenView(hdb, query, &view);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiViewGetColumnInfo(view, MSICOLINFO_NAMES, &rec);
count = MsiRecordGetFieldCount(rec);
todo_wine
{
ok(count == 9, "Expected 9, got %d\n", count);
ok(check_record(rec, 1, "FirstPrimaryColumn"), "Expected FirstPrimaryColumn\n");
ok(check_record(rec, 2, "SecondPrimaryColumn"), "Expected SecondPrimaryColumn\n");
ok(check_record(rec, 3, "ShortInt"), "Expected ShortInt\n");
ok(check_record(rec, 4, "ShortIntNullable"), "Expected ShortIntNullalble\n");
ok(check_record(rec, 5, "LongInt"), "Expected LongInt\n");
ok(check_record(rec, 6, "LongIntNullable"), "Expected LongIntNullalble\n");
ok(check_record(rec, 7, "String"), "Expected String\n");
ok(check_record(rec, 8, "LocalizableString"), "Expected LocalizableString\n");
ok(check_record(rec, 9, "LocalizableStringNullable"), "Expected LocalizableStringNullable\n");
}
ok(count == 9, "Expected 9, got %d\n", count);
ok(check_record(rec, 1, "FirstPrimaryColumn"), "Expected FirstPrimaryColumn\n");
ok(check_record(rec, 2, "SecondPrimaryColumn"), "Expected SecondPrimaryColumn\n");
ok(check_record(rec, 3, "ShortInt"), "Expected ShortInt\n");
ok(check_record(rec, 4, "ShortIntNullable"), "Expected ShortIntNullalble\n");
ok(check_record(rec, 5, "LongInt"), "Expected LongInt\n");
ok(check_record(rec, 6, "LongIntNullable"), "Expected LongIntNullalble\n");
ok(check_record(rec, 7, "String"), "Expected String\n");
ok(check_record(rec, 8, "LocalizableString"), "Expected LocalizableString\n");
ok(check_record(rec, 9, "LocalizableStringNullable"), "Expected LocalizableStringNullable\n");
r = MsiViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec);
count = MsiRecordGetFieldCount(rec);
ok(count == 9, "Expected 9, got %d\n", count);
ok(check_record(rec, 1, "s255"), "Expected s255\n");
ok(check_record(rec, 4, "I2"), "Expected I2\n");
ok(check_record(rec, 6, "I4"), "Expected I4\n");
ok(check_record(rec, 7, "S255"), "Expected S255\n");
ok(check_record(rec, 8, "S0"), "Expected S0\n");
ok(check_record(rec, 9, "s0"), "Expected s0\n");
todo_wine
{
ok(count == 9, "Expected 9, got %d\n", count);
ok(check_record(rec, 1, "s255"), "Expected s255\n");
ok(check_record(rec, 2, "i2"), "Expected i2\n");
ok(check_record(rec, 3, "i2"), "Expected i2\n");
ok(check_record(rec, 4, "I2"), "Expected I2\n");
ok(check_record(rec, 5, "i4"), "Expected i4\n");
ok(check_record(rec, 6, "I4"), "Expected I4\n");
ok(check_record(rec, 7, "S255"), "Expected S255\n");
ok(check_record(rec, 8, "S0"), "Expected S0\n");
ok(check_record(rec, 9, "s0"), "Expected s0\n");
}
query = "SELECT * FROM `TestTable`";
r = do_query(hdb, query, &rec);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
}
todo_wine
{
ok(check_record(rec, 1, "stringage"), "Expected 'stringage'\n");
ok(check_record(rec, 7, "another string"), "Expected 'another string'\n");
ok(check_record(rec, 8, "localizable"), "Expected 'localizable'\n");
ok(check_record(rec, 9, "duh"), "Expected 'duh'\n");
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
ok(check_record(rec, 1, "stringage"), "Expected 'stringage'\n");
ok(check_record(rec, 7, "another string"), "Expected 'another string'\n");
ok(check_record(rec, 8, "localizable"), "Expected 'localizable'\n");
ok(check_record(rec, 9, "duh"), "Expected 'duh'\n");
i = MsiRecordGetInteger(rec, 2);
todo_wine
{
ok(i == 5, "Expected 5, got %d\n", i);
}
ok(i == 5, "Expected 5, got %d\n", i);
i = MsiRecordGetInteger(rec, 3);
todo_wine
{
ok(i == 2, "Expected 2, got %d\n", i);
}
ok(i == 2, "Expected 2, got %d\n", i);
i = MsiRecordGetInteger(rec, 4);
ok(i == 0x80000000, "Expected 0x80000000, got %d\n", i);
i = MsiRecordGetInteger(rec, 5);
todo_wine
{
ok(i == 2147483640, "Expected 2147483640, got %d\n", i);
ok(i == 0x80000000, "Expected 0x80000000, got %d\n", i);
}
i = MsiRecordGetInteger(rec, 5);
ok(i == 2147483640, "Expected 2147483640, got %d\n", i);
i = MsiRecordGetInteger(rec, 6);
todo_wine
{
ok(i == -2147483640, "Expected -2147483640, got %d\n", i);
}
ok(i == -2147483640, "Expected -2147483640, got %d\n", i);
MsiCloseHandle(rec);
MsiCloseHandle(view);
......
......@@ -579,10 +579,7 @@ static void create_database(const CHAR *name, const msi_table *tables, int num_t
write_file(table->filename, table->data, (table->size - 1) * sizeof(char));
r = MsiDatabaseImportA(db, CURR_DIR, table->filename);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
DeleteFileA(table->filename);
}
......@@ -604,10 +601,7 @@ static void test_MsiInstallProduct(void)
DWORD num, size, type;
r = MsiInstallProductA(msifile, NULL);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
todo_wine
{
......@@ -624,19 +618,13 @@ static void test_MsiInstallProduct(void)
}
res = RegOpenKey(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest", &hkey);
todo_wine
{
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
}
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
size = MAX_PATH;
type = REG_SZ;
res = RegQueryValueExA(hkey, "Name", NULL, &type, (LPBYTE)path, &size);
todo_wine
{
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
ok(!lstrcmpA(path, "imaname"), "Expected imaname, got %s\n", path);
}
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
ok(!lstrcmpA(path, "imaname"), "Expected imaname, got %s\n", path);
size = MAX_PATH;
type = REG_SZ;
......@@ -649,11 +637,8 @@ static void test_MsiInstallProduct(void)
size = sizeof(num);
type = REG_DWORD;
res = RegQueryValueExA(hkey, "number", NULL, &type, (LPBYTE)&num, &size);
todo_wine
{
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
ok(num == 314, "Expected 314, got %ld\n", num);
}
ok(res == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %ld\n", res);
ok(num == 314, "Expected 314, got %ld\n", num);
RegDeleteKeyA(HKEY_LOCAL_MACHINE, "SOFTWARE\\Wine\\msitest");
}
......@@ -683,10 +668,7 @@ static void test_MsiSetComponentState(void)
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
r = MsiSetComponentState(package, "dangler", INSTALLSTATE_SOURCE);
todo_wine
{
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
}
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %u\n", r);
MsiCloseHandle(package);
CoUninitialize();
......@@ -710,37 +692,31 @@ static void test_packagecoltypes(void)
query = "SELECT * FROM `Media`";
r = MsiDatabaseOpenView( hdb, query, &view );
todo_wine
{
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
}
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
r = MsiViewGetColumnInfo( view, MSICOLINFO_NAMES, &rec );
count = MsiRecordGetFieldCount( rec );
todo_wine
{
ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
ok(count == 6, "Expected 6, got %d\n", count);
ok(check_record(rec, 1, "DiskId"), "wrong column label\n");
ok(check_record(rec, 2, "LastSequence"), "wrong column label\n");
ok(check_record(rec, 3, "DiskPrompt"), "wrong column label\n");
ok(check_record(rec, 4, "Cabinet"), "wrong column label\n");
ok(check_record(rec, 5, "VolumeLabel"), "wrong column label\n");
ok(check_record(rec, 6, "Source"), "wrong column label\n");
}
ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
ok(count == 6, "Expected 6, got %d\n", count);
ok(check_record(rec, 1, "DiskId"), "wrong column label\n");
ok(check_record(rec, 2, "LastSequence"), "wrong column label\n");
ok(check_record(rec, 3, "DiskPrompt"), "wrong column label\n");
ok(check_record(rec, 4, "Cabinet"), "wrong column label\n");
ok(check_record(rec, 5, "VolumeLabel"), "wrong column label\n");
ok(check_record(rec, 6, "Source"), "wrong column label\n");
r = MsiViewGetColumnInfo( view, MSICOLINFO_TYPES, &rec );
count = MsiRecordGetFieldCount( rec );
ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
ok(count == 6, "Expected 6, got %d\n", count);
ok(check_record(rec, 4, "S255"), "wrong column label\n");
ok(check_record(rec, 5, "S32"), "wrong column label\n");
ok(check_record(rec, 6, "S72"), "wrong column label\n");
todo_wine
{
ok(r == ERROR_SUCCESS, "MsiViewGetColumnInfo failed\n");
ok(count == 6, "Expected 6, got %d\n", count);
ok(check_record(rec, 1, "i2"), "wrong column label\n");
ok(check_record(rec, 2, "i4"), "wrong column label\n");
ok(check_record(rec, 3, "L64"), "wrong column label\n");
ok(check_record(rec, 4, "S255"), "wrong column label\n");
ok(check_record(rec, 5, "S32"), "wrong column label\n");
ok(check_record(rec, 6, "S72"), "wrong column label\n");
}
MsiCloseHandle(hdb);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment