Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-winehq
Commits
fcd57a3f
Commit
fcd57a3f
authored
Oct 19, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Oct 20, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for integer column types.
parent
279f8158
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
156 additions
and
0 deletions
+156
-0
db.c
dlls/msi/tests/db.c
+156
-0
No files found.
dlls/msi/tests/db.c
View file @
fcd57a3f
...
@@ -2793,6 +2793,161 @@ static void test_alter(void)
...
@@ -2793,6 +2793,161 @@ static void test_alter(void)
DeleteFile
(
msifile
);
DeleteFile
(
msifile
);
}
}
static
void
test_integers
(
void
)
{
MSIHANDLE
hdb
=
0
,
view
=
0
,
rec
=
0
;
DWORD
count
,
i
;
const
char
*
query
;
UINT
r
;
/* just MsiOpenDatabase should not create a file */
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
/* create a table */
query
=
"CREATE TABLE `integers` ( "
"`one` SHORT, `two` INT, `three` INTEGER, `four` LONG, "
"`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
=
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
);
}
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
"
);
}
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
"
);
}
MsiCloseHandle
(
rec
);
MsiViewClose
(
view
);
MsiCloseHandle
(
view
);
/* 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
);
}
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
);
}
r
=
MsiRecordGetFieldCount
(
rec
);
ok
(
r
==
-
1
,
"record count wrong: %d
\n
"
,
r
);
MsiCloseHandle
(
rec
);
/* 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
);
}
query
=
"SELECT * FROM `integers`"
;
r
=
do_query
(
hdb
,
query
,
&
rec
);
todo_wine
{
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
);
}
i
=
MsiRecordGetInteger
(
rec
,
1
);
ok
(
i
==
0x80000000
,
"Expected 0x80000000, 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
);
}
MsiCloseHandle
(
rec
);
MsiViewClose
(
view
);
MsiCloseHandle
(
view
);
r
=
MsiDatabaseCommit
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseCommit failed
\n
"
);
r
=
MsiCloseHandle
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
r
=
DeleteFile
(
msifile
);
ok
(
r
==
TRUE
,
"file didn't exist after commit
\n
"
);
}
START_TEST
(
db
)
START_TEST
(
db
)
{
{
test_msidatabase
();
test_msidatabase
();
...
@@ -2813,4 +2968,5 @@ START_TEST(db)
...
@@ -2813,4 +2968,5 @@ START_TEST(db)
test_join
();
test_join
();
test_temporary_table
();
test_temporary_table
();
test_alter
();
test_alter
();
test_integers
();
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment