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
4f6a93b9
Commit
4f6a93b9
authored
Aug 01, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Aug 02, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for joining three tables.
parent
3ac2271f
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
137 additions
and
0 deletions
+137
-0
db.c
dlls/msi/tests/db.c
+137
-0
No files found.
dlls/msi/tests/db.c
View file @
4f6a93b9
...
...
@@ -2463,6 +2463,16 @@ struct join_res_4col
const
CHAR
four
[
MAX_PATH
];
};
struct
join_res_uint
{
UINT
one
;
UINT
two
;
UINT
three
;
UINT
four
;
UINT
five
;
UINT
six
;
};
static
const
struct
join_res
join_res_first
[]
=
{
{
"alveolar"
,
"procerus"
},
...
...
@@ -2521,6 +2531,16 @@ static const struct join_res_4col join_res_eighth[] =
{
"msvcr.dll"
,
"msvcr.dll.56789"
,
"single.dll.31415"
,
"msvcp.dll"
},
};
static
const
struct
join_res_uint
join_res_ninth
[]
=
{
{
1
,
2
,
3
,
4
,
7
,
8
},
{
1
,
2
,
5
,
6
,
7
,
8
},
{
1
,
2
,
3
,
4
,
9
,
10
},
{
1
,
2
,
5
,
6
,
9
,
10
},
{
1
,
2
,
3
,
4
,
11
,
12
},
{
1
,
2
,
5
,
6
,
11
,
12
},
};
static
void
test_join
(
void
)
{
MSIHANDLE
hdb
,
hview
,
hrec
;
...
...
@@ -2590,6 +2610,58 @@ static void test_join(void)
r
=
add_binary_entry
(
hdb
,
"'single.dll.31415', 'msvcp.dll'"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add binary: %d
\n
"
,
r
);
query
=
"CREATE TABLE `One` (`A` SHORT, `B` SHORT PRIMARY KEY `A`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create table: %d
\n
"
,
r
);
query
=
"CREATE TABLE `Two` (`C` SHORT, `D` SHORT PRIMARY KEY `C`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create table: %d
\n
"
,
r
);
query
=
"CREATE TABLE `Three` (`E` SHORT, `F` SHORT PRIMARY KEY `E`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create table: %d
\n
"
,
r
);
query
=
"INSERT INTO `One` (`A`, `B`) VALUES (1, 2)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Two` (`C`, `D`) VALUES (3, 4)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Two` (`C`, `D`) VALUES (5, 6)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Three` (`E`, `F`) VALUES (7, 8)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Three` (`E`, `F`) VALUES (9, 10)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Three` (`E`, `F`) VALUES (11, 12)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"CREATE TABLE `Four` (`G` SHORT, `H` SHORT PRIMARY KEY `G`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create table: %d
\n
"
,
r
);
query
=
"CREATE TABLE `Five` (`I` SHORT, `J` SHORT PRIMARY KEY `I`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot create table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Five` (`I`, `J`) VALUES (13, 14)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"INSERT INTO `Five` (`I`, `J`) VALUES (15, 16)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot insert into table: %d
\n
"
,
r
);
query
=
"SELECT `Component`.`ComponentId`, `FeatureComponents`.`Feature_` "
"FROM `Component`, `FeatureComponents` "
"WHERE `Component`.`Component` = `FeatureComponents`.`Component_` "
...
...
@@ -2984,6 +3056,71 @@ static void test_join(void)
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"SELECT * FROM `One`, `Two`, `Three` "
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
todo_wine
ok
(
r
==
ERROR_SUCCESS
,
"failed to open view: %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
todo_wine
ok
(
r
==
ERROR_SUCCESS
,
"failed to execute view: %d
\n
"
,
r
);
i
=
0
;
data_correct
=
TRUE
;
while
((
r
=
MsiViewFetch
(
hview
,
&
hrec
))
==
ERROR_SUCCESS
)
{
count
=
MsiRecordGetFieldCount
(
hrec
);
ok
(
count
==
6
,
"Expected 6 record fields, got %d
\n
"
,
count
);
r
=
MsiRecordGetInteger
(
hrec
,
1
);
if
(
r
!=
join_res_ninth
[
i
].
one
)
data_correct
=
FALSE
;
r
=
MsiRecordGetInteger
(
hrec
,
2
);
if
(
r
!=
join_res_ninth
[
i
].
two
)
data_correct
=
FALSE
;
r
=
MsiRecordGetInteger
(
hrec
,
3
);
if
(
r
!=
join_res_ninth
[
i
].
three
)
data_correct
=
FALSE
;
r
=
MsiRecordGetInteger
(
hrec
,
4
);
if
(
r
!=
join_res_ninth
[
i
].
four
)
data_correct
=
FALSE
;
r
=
MsiRecordGetInteger
(
hrec
,
5
);
if
(
r
!=
join_res_ninth
[
i
].
five
)
data_correct
=
FALSE
;
r
=
MsiRecordGetInteger
(
hrec
,
6
);
if
(
r
!=
join_res_ninth
[
i
].
six
)
data_correct
=
FALSE
;
i
++
;
MsiCloseHandle
(
hrec
);
}
ok
(
data_correct
,
"data returned in the wrong order
\n
"
);
todo_wine
{
ok
(
i
==
6
,
"Expected 6 rows, got %d
\n
"
,
i
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"expected no more items: %d
\n
"
,
r
);
}
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"SELECT * FROM `Four`, `Five`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to open view: %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to execute view: %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
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