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
7e865905
Commit
7e865905
authored
Aug 30, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Sep 07, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add more tests for the _Streams table.
parent
39857443
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
89 additions
and
1 deletion
+89
-1
db.c
dlls/msi/tests/db.c
+89
-1
No files found.
dlls/msi/tests/db.c
View file @
7e865905
...
...
@@ -945,10 +945,25 @@ static void test_longstrings(void)
MsiCloseHandle
(
hdb
);
DeleteFile
(
msifile
);
}
static
void
create_file
(
const
CHAR
*
name
)
{
HANDLE
file
;
DWORD
written
;
file
=
CreateFileA
(
name
,
GENERIC_WRITE
,
0
,
NULL
,
CREATE_ALWAYS
,
0
,
NULL
);
ok
(
file
!=
INVALID_HANDLE_VALUE
,
"Failure to open file %s
\n
"
,
name
);
WriteFile
(
file
,
name
,
strlen
(
name
),
&
written
,
NULL
);
WriteFile
(
file
,
"
\n
"
,
strlen
(
"
\n
"
),
&
written
,
NULL
);
CloseHandle
(
file
);
}
static
void
test_streamtable
(
void
)
{
MSIHANDLE
hdb
=
0
,
rec
;
MSIHANDLE
hdb
=
0
,
rec
,
view
;
char
file
[
MAX_PATH
];
char
buf
[
MAX_PATH
];
DWORD
size
;
UINT
r
;
hdb
=
create_db
();
...
...
@@ -980,6 +995,79 @@ static void test_streamtable(void)
}
MsiCloseHandle
(
rec
);
/* insert a file into the _Streams table */
create_file
(
"test.txt"
);
rec
=
MsiCreateRecord
(
2
);
MsiRecordSetString
(
rec
,
1
,
"data"
);
r
=
MsiRecordSetStream
(
rec
,
2
,
"test.txt"
);
ok
(
r
==
ERROR_SUCCESS
,
"Failed to add stream data to the record: %d
\n
"
,
r
);
DeleteFile
(
"test.txt"
);
r
=
MsiDatabaseOpenView
(
hdb
,
"INSERT INTO `_Streams` ( `Name`, `Data` ) VALUES ( ?, ? )"
,
&
view
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database view: %d
\n
"
,
r
);
}
r
=
MsiViewExecute
(
view
,
rec
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute view: %d
\n
"
,
r
);
}
MsiCloseHandle
(
rec
);
MsiCloseHandle
(
view
);
r
=
MsiDatabaseOpenView
(
hdb
,
"SELECT `Name`, `Data` FROM `_Streams`"
,
&
view
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to open database view: %d
\n
"
,
r
);
}
r
=
MsiViewExecute
(
view
,
0
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to execute view: %d
\n
"
,
r
);
}
r
=
MsiViewFetch
(
view
,
&
rec
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to fetch record: %d
\n
"
,
r
);
}
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
rec
,
1
,
file
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to get string: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
file
,
"data"
),
"Expected 'data', got %s
\n
"
,
file
);
}
size
=
MAX_PATH
;
memset
(
buf
,
0
,
MAX_PATH
);
r
=
MsiRecordReadStream
(
rec
,
2
,
buf
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Failed to get stream: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"test.txt
\n
"
),
"Expected 'test.txt
\\
n', got %s
\n
"
,
buf
);
}
MsiCloseHandle
(
rec
);
r
=
MsiViewFetch
(
view
,
&
rec
);
todo_wine
{
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
}
MsiCloseHandle
(
view
);
MsiCloseHandle
(
hdb
);
DeleteFile
(
msifile
);
}
...
...
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