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
925fb3b4
Commit
925fb3b4
authored
Oct 20, 2009
by
Hib Eris
Committed by
Alexandre Julliard
Oct 20, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Add tests for rows order.
parent
8d496332
Hide 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 @
925fb3b4
...
...
@@ -4449,6 +4449,142 @@ static void test_tables_order(void)
DeleteFile
(
msifile
);
}
static
void
test_rows_order
(
void
)
{
const
char
*
query
;
MSIHANDLE
hdb
=
0
,
hview
=
0
,
hrec
=
0
;
UINT
r
;
char
buffer
[
100
];
DWORD
sz
;
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiOpenDatabase failed
\n
"
);
query
=
"CREATE TABLE `foo` ( "
"`bar` LONGCHAR NOT NULL PRIMARY KEY `bar`)"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to create table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `foo` "
"( `bar` ) VALUES ( 'A' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `foo` "
"( `bar` ) VALUES ( 'B' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `foo` "
"( `bar` ) VALUES ( 'C' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `foo` "
"( `bar` ) VALUES ( 'D' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `foo` "
"( `bar` ) VALUES ( 'E' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `foo` "
"( `bar` ) VALUES ( 'F' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
query
=
"CREATE TABLE `bar` ( "
"`foo` LONGCHAR NOT NULL, "
"`baz` LONGCHAR NOT NULL "
"PRIMARY KEY `foo` )"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to create table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `bar` "
"( `foo`, `baz` ) VALUES ( 'C', 'E' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `bar` "
"( `foo`, `baz` ) VALUES ( 'F', 'A' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `bar` "
"( `foo`, `baz` ) VALUES ( 'A', 'B' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `bar` "
"( `foo`, `baz` ) VALUES ( 'D', 'E' )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add value to table
\n
"
);
/* The rows of the table must be ordered by the column values of
each row. For strings, the column value is the string id
in the string table. */
query
=
"SELECT * FROM `bar`"
;
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
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"A"
),
"Expected A, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"B"
),
"Expected B, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"C"
),
"Expected E, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"E"
),
"Expected E, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"D"
),
"Expected D, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"E"
),
"Expected E, got %s
\n
"
,
buffer
);
r
=
MsiCloseHandle
(
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to close record
\n
"
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewFetch failed
\n
"
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
1
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"F"
),
"Expected F, got %s
\n
"
,
buffer
);
sz
=
sizeof
(
buffer
);
r
=
MsiRecordGetString
(
hrec
,
2
,
buffer
,
&
sz
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmp
(
buffer
,
"A"
),
"Expected A, got %s
\n
"
,
buffer
);
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
"
);
r
=
MsiCloseHandle
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
DeleteFile
(
msifile
);
}
static
void
test_select_markers
(
void
)
{
MSIHANDLE
hdb
=
0
,
rec
,
view
,
res
;
...
...
@@ -8327,6 +8463,7 @@ START_TEST(db)
test_update
();
test_special_tables
();
test_tables_order
();
test_rows_order
();
test_select_markers
();
test_viewmodify_update
();
test_viewmodify_assign
();
...
...
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