Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
1a159dfd
Commit
1a159dfd
authored
Jun 03, 2010
by
Matijn Woudt
Committed by
Alexandre Julliard
Jun 07, 2010
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Testcases for CREATE TABLE.
parent
d5e0a2ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
107 additions
and
0 deletions
+107
-0
db.c
dlls/msi/tests/db.c
+107
-0
No files found.
dlls/msi/tests/db.c
View file @
1a159dfd
...
...
@@ -8845,6 +8845,112 @@ static void test_columnorder(void)
DeleteFileA
(
msifile
);
}
static
void
test_createtable
(
void
)
{
MSIHANDLE
hdb
,
htab
=
0
,
hrec
=
0
;
LPCSTR
query
;
UINT
res
;
DWORD
size
;
char
buffer
[
0x20
];
hdb
=
create_db
();
ok
(
hdb
,
"failed to create db
\n
"
);
query
=
"CREATE TABLE `blah` (`foo` CHAR(72) NOT NULL PRIMARY KEY `foo`)"
;
res
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
if
(
res
==
ERROR_SUCCESS
)
{
res
=
MsiViewExecute
(
htab
,
hrec
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiViewGetColumnInfo
(
htab
,
MSICOLINFO_NAMES
,
&
hrec
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
size
=
sizeof
(
buffer
);
res
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
size
);
todo_wine
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiViewClose
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiCloseHandle
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
}
query
=
"CREATE TABLE `a` (`b` INT PRIMARY KEY `b`)"
;
res
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
if
(
res
==
ERROR_SUCCESS
)
{
res
=
MsiViewExecute
(
htab
,
0
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiViewClose
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiCloseHandle
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
query
=
"SELECT * FROM `a`"
;
res
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiViewGetColumnInfo
(
htab
,
MSICOLINFO_NAMES
,
&
hrec
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
size
=
sizeof
(
buffer
);
res
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
!
strcmp
(
buffer
,
"b"
),
"b != %s
\n
"
,
buffer
);
res
=
MsiViewClose
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiCloseHandle
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiDatabaseCommit
(
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiCloseHandle
(
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_TRANSACT
,
&
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
query
=
"SELECT * FROM `a`"
;
res
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiViewGetColumnInfo
(
htab
,
MSICOLINFO_NAMES
,
&
hrec
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
size
=
sizeof
(
buffer
);
res
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
size
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
todo_wine
ok
(
!
strcmp
(
buffer
,
"b"
),
"b != %s
\n
"
,
buffer
);
res
=
MsiCloseHandle
(
hrec
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiViewClose
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiCloseHandle
(
htab
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
}
res
=
MsiDatabaseCommit
(
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
res
=
MsiCloseHandle
(
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
DeleteFileA
(
msifile
);
}
START_TEST
(
db
)
{
test_msidatabase
();
...
...
@@ -8896,4 +9002,5 @@ START_TEST(db)
test_insertorder
();
test_columnorder
();
test_suminfo_import
();
test_createtable
();
}
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