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
d2dca89c
Commit
d2dca89c
authored
Jun 13, 2006
by
Mike McCormack
Committed by
Alexandre Julliard
Jun 14, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add a test for MsiDatabaseExport.
parent
e9cc5156
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
77 additions
and
0 deletions
+77
-0
db.c
dlls/msi/tests/db.c
+77
-0
No files found.
dlls/msi/tests/db.c
View file @
d2dca89c
...
...
@@ -812,6 +812,82 @@ static void test_viewgetcolumninfo(void)
MsiCloseHandle
(
hdb
);
}
static
void
test_msiexport
(
void
)
{
MSIHANDLE
hdb
=
0
,
hview
=
0
;
UINT
r
;
char
*
query
;
char
path
[
MAX_PATH
];
const
char
file
[]
=
"phone.txt"
;
HANDLE
handle
;
char
buffer
[
0x100
];
DWORD
length
;
const
char
expected
[]
=
"id
\t
name
\t
number
\r\n
"
"I2
\t
S32
\t
S32
\r\n
"
"phone
\t
id
\r\n
"
"1
\t
Abe
\t
8675309
\r\n
"
;
DeleteFile
(
msifile
);
/* 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 `phone` ( "
"`id` INT, `name` CHAR(32), `number` CHAR(32) "
"PRIMARY KEY `id`)"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
/* insert a value into it */
query
=
"INSERT INTO `phone` ( `id`, `name`, `number` )"
"VALUES('1', 'Abe', '8675309')"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
GetCurrentDirectory
(
MAX_PATH
,
path
);
todo_wine
{
r
=
MsiDatabaseExport
(
hdb
,
"phone"
,
path
,
file
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseExport failed
\n
"
);
MsiCloseHandle
(
hdb
);
lstrcat
(
path
,
"
\\
"
);
lstrcat
(
path
,
file
);
/* check the data that was written */
length
=
0
;
memset
(
buffer
,
0
,
sizeof
buffer
);
handle
=
CreateFile
(
path
,
GENERIC_READ
,
0
,
NULL
,
OPEN_EXISTING
,
0
,
NULL
);
if
(
handle
!=
INVALID_HANDLE_VALUE
)
{
ReadFile
(
handle
,
buffer
,
sizeof
buffer
,
&
length
,
NULL
);
CloseHandle
(
handle
);
DeleteFile
(
path
);
}
else
ok
(
0
,
"failed to open file %s
\n
"
,
path
);
ok
(
length
==
strlen
(
expected
),
"length of data wrong
\n
"
);
ok
(
!
lstrcmp
(
buffer
,
expected
),
"data doesn't match
\n
"
);
}
}
START_TEST
(
db
)
{
test_msidatabase
();
...
...
@@ -821,4 +897,5 @@ START_TEST(db)
test_viewmodify
();
test_viewgetcolumninfo
();
test_getcolinfo
();
test_msiexport
();
}
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