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
7cd67368
Commit
7cd67368
authored
Oct 07, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Oct 07, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for dropping tables with multiple columns.
parent
374c0428
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
133 additions
and
2 deletions
+133
-2
db.c
dlls/msi/tests/db.c
+133
-2
No files found.
dlls/msi/tests/db.c
View file @
7cd67368
...
...
@@ -6316,7 +6316,9 @@ static void test_dbtopackage(void)
static
void
test_droptable
(
void
)
{
MSIHANDLE
hdb
,
hview
,
hrec
;
CHAR
buf
[
MAX_PATH
];
LPCSTR
query
;
DWORD
size
;
UINT
r
;
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_CREATE
,
&
hdb
);
...
...
@@ -6331,17 +6333,54 @@ static void test_droptable(void)
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
query
=
"SELECT * FROM `_Tables` WHERE `Name` = 'One'"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
r
=
MsiDatabaseOpenViewA
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
1
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"One"
),
"Expected
\"
One
\"
, got
\"
%s
\"\n
"
,
buf
);
MsiCloseHandle
(
hrec
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"SELECT * FROM `_Columns` WHERE `Table` = 'One'"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
r
=
MsiDatabaseOpenViewA
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
1
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"One"
),
"Expected
\"
One
\"
, got
\"
%s
\"\n
"
,
buf
);
r
=
MsiRecordGetInteger
(
hrec
,
2
);
ok
(
r
==
1
,
"Expected 1, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
3
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"A"
),
"Expected
\"
A
\"
, got
\"
%s
\"\n
"
,
buf
);
MsiCloseHandle
(
hrec
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"DROP `One`"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
...
...
@@ -6397,6 +6436,98 @@ static void test_droptable(void)
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
query
=
"CREATE TABLE `One` ( `B` INT, `C` INT PRIMARY KEY `B` )"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
query
=
"SELECT * FROM `One`"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
query
=
"SELECT * FROM `_Tables` WHERE `Name` = 'One'"
;
r
=
MsiDatabaseOpenViewA
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
1
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"One"
),
"Expected
\"
One
\"
, got
\"
%s
\"\n
"
,
buf
);
MsiCloseHandle
(
hrec
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"SELECT * FROM `_Columns` WHERE `Table` = 'One'"
;
r
=
MsiDatabaseOpenViewA
(
hdb
,
query
,
&
hview
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewExecute
(
hview
,
0
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
1
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"One"
),
"Expected
\"
One
\"
, got
\"
%s
\"\n
"
,
buf
);
r
=
MsiRecordGetInteger
(
hrec
,
2
);
ok
(
r
==
1
,
"Expected 1, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
3
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"B"
),
"Expected
\"
B
\"
, got
\"
%s
\"\n
"
,
buf
);
MsiCloseHandle
(
hrec
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
1
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"One"
),
"Expected
\"
One
\"
, got
\"
%s
\"\n
"
,
buf
);
r
=
MsiRecordGetInteger
(
hrec
,
2
);
ok
(
r
==
2
,
"Expected 2, got %d
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiRecordGetStringA
(
hrec
,
3
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
ok
(
!
lstrcmpA
(
buf
,
"C"
),
"Expected
\"
C
\"
, got
\"
%s
\"\n
"
,
buf
);
MsiCloseHandle
(
hrec
);
r
=
MsiViewFetch
(
hview
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
query
=
"DROP TABLE One"
;
r
=
run_query
(
hdb
,
0
,
query
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
query
=
"SELECT * FROM `One`"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_BAD_QUERY_SYNTAX
,
"Expected ERROR_BAD_QUERY_SYNTAX, got %d
\n
"
,
r
);
query
=
"SELECT * FROM `_Tables` WHERE `Name` = 'One'"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
query
=
"SELECT * FROM `_Columns` WHERE `Table` = 'One'"
;
r
=
do_query
(
hdb
,
query
,
&
hrec
);
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %d
\n
"
,
r
);
MsiCloseHandle
(
hdb
);
DeleteFileA
(
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