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
eaea537f
Commit
eaea537f
authored
Jul 06, 2009
by
Hib Eris
Committed by
Alexandre Julliard
Jul 06, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Add tests for MsiViewModify ASSIGN mode.
parent
e1386528
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
122 additions
and
0 deletions
+122
-0
db.c
dlls/msi/tests/db.c
+122
-0
No files found.
dlls/msi/tests/db.c
View file @
eaea537f
...
...
@@ -4763,6 +4763,127 @@ static void test_viewmodify_update(void)
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase close failed
\n
"
);
}
static
void
test_viewmodify_assign
(
void
)
{
MSIHANDLE
hdb
=
0
,
hview
=
0
,
hrec
=
0
;
const
char
*
query
;
UINT
r
;
/* setup database */
DeleteFile
(
msifile
);
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
query
=
"CREATE TABLE `table` (`A` INT, `B` INT PRIMARY KEY `A`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"query failed
\n
"
);
/* assign to view, new primary key */
query
=
"SELECT * FROM `table`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
hrec
=
MsiCreateRecord
(
2
);
ok
(
hrec
!=
0
,
"MsiCreateRecord failed
\n
"
);
r
=
MsiRecordSetInteger
(
hrec
,
1
,
1
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to set integer
\n
"
);
r
=
MsiRecordSetInteger
(
hrec
,
2
,
2
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to set integer
\n
"
);
r
=
MsiViewModify
(
hview
,
MSIMODIFY_ASSIGN
,
hrec
);
todo_wine
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewModify failed: %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
query
=
"SELECT * FROM `table`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
todo_wine
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
r
=
MsiRecordGetInteger
(
hrec
,
1
);
todo_wine
ok
(
r
==
1
,
"Expected 1, got %d
\n
"
,
r
);
r
=
MsiRecordGetInteger
(
hrec
,
2
);
todo_wine
ok
(
r
==
2
,
"Expected 2, got %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
/* assign to view, primary key matches */
query
=
"SELECT * FROM `table`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
hrec
=
MsiCreateRecord
(
2
);
ok
(
hrec
!=
0
,
"MsiCreateRecord failed
\n
"
);
r
=
MsiRecordSetInteger
(
hrec
,
1
,
1
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to set integer
\n
"
);
r
=
MsiRecordSetInteger
(
hrec
,
2
,
4
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to set integer
\n
"
);
r
=
MsiViewModify
(
hview
,
MSIMODIFY_ASSIGN
,
hrec
);
todo_wine
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewModify failed: %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
query
=
"SELECT * FROM `table`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiDatabaseOpenView failed
\n
"
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewExecute failed
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
todo_wine
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
r
=
MsiRecordGetInteger
(
hrec
,
1
);
todo_wine
ok
(
r
==
1
,
"Expected 1, got %d
\n
"
,
r
);
r
=
MsiRecordGetInteger
(
hrec
,
2
);
todo_wine
ok
(
r
==
4
,
"Expected 4, got %d
\n
"
,
r
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
r
=
MsiViewClose
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
/* close database */
r
=
MsiCloseHandle
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase close failed
\n
"
);
}
static
const
WCHAR
data10
[]
=
{
/* MOO */
0x8001
,
0x000b
,
};
...
...
@@ -8099,6 +8220,7 @@ START_TEST(db)
test_tables_order
();
test_select_markers
();
test_viewmodify_update
();
test_viewmodify_assign
();
test_stringtable
();
test_viewmodify_delete
();
test_defaultdatabase
();
...
...
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