msi: Add the column type INTEGER as an alias for INT.

This commit is contained in:
Mike McCormack 2006-10-24 02:02:43 +09:00 committed by Alexandre Julliard
parent 0d7dc8f98d
commit 8858011375
3 changed files with 54 additions and 80 deletions

View File

@ -2810,55 +2810,43 @@ static void test_integers(void)
"`five` SHORT NOT NULL, `six` INT NOT NULL, "
"`seven` INTEGER NOT NULL, `eight` LONG NOT NULL "
"PRIMARY KEY `one`)";
todo_wine
{
r = MsiDatabaseOpenView(hdb, query, &view);
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
r = MsiViewExecute(view, 0);
ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
r = MsiViewClose(view);
ok(r == ERROR_SUCCESS, "MsiViewClose failed\n");
}
r = MsiDatabaseOpenView(hdb, query, &view);
ok(r == ERROR_SUCCESS, "MsiDatabaseOpenView failed\n");
r = MsiViewExecute(view, 0);
ok(r == ERROR_SUCCESS, "MsiViewExecute failed\n");
r = MsiViewClose(view);
ok(r == ERROR_SUCCESS, "MsiViewClose failed\n");
r = MsiCloseHandle(view);
ok(r == ERROR_SUCCESS, "MsiCloseHandle failed\n");
query = "SELECT * FROM `integers`";
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 == 8, "Expected 8, got %d\n", count);
ok(check_record(rec, 1, "one"), "Expected one\n");
ok(check_record(rec, 2, "two"), "Expected two\n");
ok(check_record(rec, 3, "three"), "Expected three\n");
ok(check_record(rec, 4, "four"), "Expected four\n");
ok(check_record(rec, 5, "five"), "Expected five\n");
ok(check_record(rec, 6, "six"), "Expected six\n");
ok(check_record(rec, 7, "seven"), "Expected seven\n");
ok(check_record(rec, 8, "eight"), "Expected eight\n");
}
ok(count == 8, "Expected 8, got %d\n", count);
ok(check_record(rec, 1, "one"), "Expected one\n");
ok(check_record(rec, 2, "two"), "Expected two\n");
ok(check_record(rec, 3, "three"), "Expected three\n");
ok(check_record(rec, 4, "four"), "Expected four\n");
ok(check_record(rec, 5, "five"), "Expected five\n");
ok(check_record(rec, 6, "six"), "Expected six\n");
ok(check_record(rec, 7, "seven"), "Expected seven\n");
ok(check_record(rec, 8, "eight"), "Expected eight\n");
MsiCloseHandle(rec);
r = MsiViewGetColumnInfo(view, MSICOLINFO_TYPES, &rec);
count = MsiRecordGetFieldCount(rec);
todo_wine
{
ok(count == 8, "Expected 8, got %d\n", count);
ok(check_record(rec, 1, "I2"), "Expected I2\n");
ok(check_record(rec, 2, "I2"), "Expected I2\n");
ok(check_record(rec, 3, "I2"), "Expected I2\n");
ok(check_record(rec, 4, "I4"), "Expected I4\n");
ok(check_record(rec, 5, "i2"), "Expected i2\n");
ok(check_record(rec, 6, "i2"), "Expected i2\n");
ok(check_record(rec, 7, "i2"), "Expected i2\n");
ok(check_record(rec, 8, "i4"), "Expected i4\n");
}
ok(count == 8, "Expected 8, got %d\n", count);
ok(check_record(rec, 1, "I2"), "Expected I2\n");
ok(check_record(rec, 2, "I2"), "Expected I2\n");
ok(check_record(rec, 3, "I2"), "Expected I2\n");
ok(check_record(rec, 4, "I4"), "Expected I4\n");
ok(check_record(rec, 5, "i2"), "Expected i2\n");
ok(check_record(rec, 6, "i2"), "Expected i2\n");
ok(check_record(rec, 7, "i2"), "Expected i2\n");
ok(check_record(rec, 8, "i4"), "Expected i4\n");
MsiCloseHandle(rec);
MsiViewClose(view);
@ -2867,23 +2855,17 @@ static void test_integers(void)
/* insert values into it, NULL where NOT NULL is specified */
query = "INSERT INTO `integers` ( `one`, `two`, `three`, `four`, `five`, `six`, `seven`, `eight` )"
"VALUES('', '', '', '', '', '', '', '')";
todo_wine
{
r = MsiDatabaseOpenView(hdb, query, &view);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiViewExecute(view, 0);
ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
}
r = MsiDatabaseOpenView(hdb, query, &view);
ok(r == ERROR_SUCCESS, "Expected ERROR_SUCCESS, got %d\n", r);
r = MsiViewExecute(view, 0);
ok(r == ERROR_FUNCTION_FAILED, "Expected ERROR_FUNCTION_FAILED, got %d\n", r);
MsiViewClose(view);
MsiCloseHandle(view);
query = "SELECT * FROM `integers`";
r = do_query(hdb, query, &rec);
todo_wine
{
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
}
ok(r == ERROR_NO_MORE_ITEMS, "Expected ERROR_NO_MORE_ITEMS, got %d\n", r);
r = MsiRecordGetFieldCount(rec);
ok(r == -1, "record count wrong: %d\n", r);
@ -2893,46 +2875,36 @@ static void test_integers(void)
/* insert legitimate values into it */
query = "INSERT INTO `integers` ( `one`, `two`, `three`, `four`, `five`, `six`, `seven`, `eight` )"
"VALUES('', '2', '', '4', '5', '6', '7', '8')";
todo_wine
{
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);
}
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);
query = "SELECT * FROM `integers`";
r = do_query(hdb, query, &rec);
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 = MsiRecordGetFieldCount(rec);
todo_wine
{
ok(r == 8, "record count wrong: %d\n", r);
}
ok(r == 8, "record count wrong: %d\n", r);
todo_wine {
i = MsiRecordGetInteger(rec, 1);
ok(i == 0x80000000, "Expected 0x80000000, got %d\n", i);
ok(i == MSI_NULL_INTEGER, "Expected MSI_NULL_INTEGER, got %d\n", i);
i = MsiRecordGetInteger(rec, 3);
ok(i == 0x80000000, "Expected 0x80000000, got %d\n", i);
todo_wine
{
i = MsiRecordGetInteger(rec, 2);
ok(i == 2, "Expected 2, got %d\n", i);
i = MsiRecordGetInteger(rec, 4);
ok(i == 4, "Expected 4, got %d\n", i);
i = MsiRecordGetInteger(rec, 5);
ok(i == 5, "Expected 5, got %d\n", i);
i = MsiRecordGetInteger(rec, 6);
ok(i == 6, "Expected 6, got %d\n", i);
i = MsiRecordGetInteger(rec, 7);
ok(i == 7, "Expected 7, got %d\n", i);
i = MsiRecordGetInteger(rec, 8);
ok(i == 8, "Expected 8, got %d\n", i);
ok(i == MSI_NULL_INTEGER, "Expected MSI_NULL_INTEGER, got %d\n", i);
}
i = MsiRecordGetInteger(rec, 2);
ok(i == 2, "Expected 2, got %d\n", i);
i = MsiRecordGetInteger(rec, 4);
ok(i == 4, "Expected 4, got %d\n", i);
i = MsiRecordGetInteger(rec, 5);
ok(i == 5, "Expected 5, got %d\n", i);
i = MsiRecordGetInteger(rec, 6);
ok(i == 6, "Expected 6, got %d\n", i);
i = MsiRecordGetInteger(rec, 7);
ok(i == 7, "Expected 7, got %d\n", i);
i = MsiRecordGetInteger(rec, 8);
ok(i == 8, "Expected 8, got %d\n", i);
MsiCloseHandle(rec);
MsiViewClose(view);

View File

@ -1418,13 +1418,13 @@ static void test_msipackage(void)
r = try_query(hdb, query);
ok(r == ERROR_SUCCESS, "failed to create Properties table\n");
todo_wine {
query = "CREATE TABLE `InstallExecuteSequence` ("
"`Action` CHAR(72), `Condition` CHAR(0), `Sequence` INTEGER "
"PRIMARY KEY `Action`)";
r = try_query(hdb, query);
ok(r == ERROR_SUCCESS, "failed to create InstallExecuteSequence table\n");
todo_wine {
sprintf(name, "#%ld", hdb);
r = MsiOpenPackage(name, &hpack);
ok(r == ERROR_INSTALL_PACKAGE_INVALID, "MsiOpenPackage returned wrong code\n");

View File

@ -94,6 +94,7 @@ static const WCHAR INNER_W[] = { 'I','N','N','E','R',0 };
static const WCHAR INSERT_W[] = { 'I','N','S','E','R','T',0 };
static const WCHAR INSTEAD_W[] = { 'I','N','S','T','E','A','D',0 };
static const WCHAR INT_W[] = { 'I','N','T',0 };
static const WCHAR INTEGER_W[] = { 'I','N','T','E','G','E','R',0 };
static const WCHAR INTERSECT_W[] = { 'I','N','T','E','R','S','E','C','T',0 };
static const WCHAR INTO_W[] = { 'I','N','T','O',0 };
static const WCHAR IS_W[] = { 'I','S',0 };
@ -206,6 +207,7 @@ static const Keyword aKeywordTable[] = {
{ INSERT_W, TK_INSERT },
{ INSTEAD_W, TK_INSTEAD },
{ INT_W, TK_INT },
{ INTEGER_W, TK_INT },
{ INTERSECT_W, TK_INTERSECT },
{ INTO_W, TK_INTO },
{ IS_W, TK_IS },