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
a40d6871
Commit
a40d6871
authored
Feb 25, 2007
by
James Hawkins
Committed by
Alexandre Julliard
Feb 26, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for using markers in SELECT clauses.
parent
d4a32494
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
117 additions
and
0 deletions
+117
-0
db.c
dlls/msi/tests/db.c
+117
-0
No files found.
dlls/msi/tests/db.c
View file @
a40d6871
...
...
@@ -3188,6 +3188,122 @@ static void test_special_tables(void)
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
}
static
void
test_select_markers
(
void
)
{
MSIHANDLE
hdb
=
0
,
rec
,
view
,
res
;
LPCSTR
query
;
UINT
r
;
DWORD
size
;
CHAR
buf
[
MAX_PATH
];
hdb
=
create_db
();
ok
(
hdb
,
"failed to create db
\n
"
);
r
=
run_query
(
hdb
,
0
,
"CREATE TABLE `Table` (`One` CHAR(72), `Two` CHAR(72), `Three` SHORT PRIMARY KEY `One`, `Two`, `Three`)"
);
ok
(
r
==
S_OK
,
"cannot create table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `Table` "
"( `One`, `Two`, `Three` ) VALUES ( 'apple', 'one', 1 )"
);
ok
(
r
==
S_OK
,
"cannot add file to the Media table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `Table` "
"( `One`, `Two`, `Three` ) VALUES ( 'apple', 'two', 1 )"
);
ok
(
r
==
S_OK
,
"cannot add file to the Media table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `Table` "
"( `One`, `Two`, `Three` ) VALUES ( 'apple', 'two', 2 )"
);
ok
(
r
==
S_OK
,
"cannot add file to the Media table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
0
,
"INSERT INTO `Table` "
"( `One`, `Two`, `Three` ) VALUES ( 'banana', 'three', 3 )"
);
ok
(
r
==
S_OK
,
"cannot add file to the Media table: %d
\n
"
,
r
);
rec
=
MsiCreateRecord
(
2
);
MsiRecordSetString
(
rec
,
1
,
"apple"
);
MsiRecordSetString
(
rec
,
2
,
"two"
);
query
=
"SELECT * FROM `Table` WHERE `One`=? AND `Two`=? ORDER BY `Three`"
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
view
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewExecute
(
view
,
rec
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
r
=
MsiViewFetch
(
view
,
&
res
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
res
,
1
,
buf
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"apple"
),
"Expected apple, got %s
\n
"
,
buf
);
}
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
res
,
2
,
buf
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"two"
),
"Expected two, got %s
\n
"
,
buf
);
}
r
=
MsiRecordGetInteger
(
res
,
3
);
todo_wine
{
ok
(
r
==
1
,
"Expected 1, got %d
\n
"
,
r
);
}
MsiCloseHandle
(
res
);
r
=
MsiViewFetch
(
view
,
&
res
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
}
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
res
,
1
,
buf
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"apple"
),
"Expected apple, got %s
\n
"
,
buf
);
}
size
=
MAX_PATH
;
r
=
MsiRecordGetString
(
res
,
2
,
buf
,
&
size
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"two"
),
"Expected two, got %s
\n
"
,
buf
);
}
r
=
MsiRecordGetInteger
(
res
,
3
);
todo_wine
{
ok
(
r
==
2
,
"Expected 2, got %d
\n
"
,
r
);
}
MsiCloseHandle
(
res
);
r
=
MsiViewFetch
(
view
,
&
res
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
r
=
MsiViewClose
(
view
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiViewClose failed
\n
"
);
r
=
MsiCloseHandle
(
view
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
r
=
MsiCloseHandle
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiCloseHandle failed
\n
"
);
}
START_TEST
(
db
)
{
test_msidatabase
();
...
...
@@ -3211,4 +3327,5 @@ START_TEST(db)
test_integers
();
test_update
();
test_special_tables
();
test_select_markers
();
}
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