Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
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-cw
Commits
14a6d899
Commit
14a6d899
authored
Sep 06, 2005
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Authors: Mike McCormack <mike@codeweavers.com>, Aric Stewart <aric@codeweavers.com>
Test creating a package.
parent
298cdaea
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
155 additions
and
0 deletions
+155
-0
.cvsignore
dlls/msi/tests/.cvsignore
+1
-0
Makefile.in
dlls/msi/tests/Makefile.in
+1
-0
package.c
dlls/msi/tests/package.c
+153
-0
No files found.
dlls/msi/tests/.cvsignore
View file @
14a6d899
Makefile
db.ok
format.ok
package.ok
record.ok
suminfo.ok
testlist.c
dlls/msi/tests/Makefile.in
View file @
14a6d899
...
...
@@ -8,6 +8,7 @@ IMPORTS = msi kernel32
CTESTS
=
\
db.c
\
format.c
\
package.c
\
record.c
\
suminfo.c
...
...
dlls/msi/tests/package.c
0 → 100644
View file @
14a6d899
/*
* tests for Microsoft Installer functionality
*
* Copyright 2005 Mike McCormack for CodeWeavers
* Copyright 2005 Aric Stewart for CodeWeavers
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Software Foundation; either
* version 2.1 of the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
*/
#define COBJMACROS
#include <stdio.h>
#include <windows.h>
#include <msi.h>
#include <msiquery.h>
#include "wine/test.h"
static
UINT
run_query
(
MSIHANDLE
hdb
,
const
char
*
query
)
{
MSIHANDLE
hview
=
0
;
UINT
r
;
r
=
MsiDatabaseOpenView
(
hdb
,
query
,
&
hview
);
if
(
r
!=
ERROR_SUCCESS
)
return
r
;
r
=
MsiViewExecute
(
hview
,
0
);
if
(
r
==
ERROR_SUCCESS
)
r
=
MsiViewClose
(
hview
);
MsiCloseHandle
(
hview
);
return
r
;
}
static
UINT
set_summary_info
(
MSIHANDLE
hdb
)
{
UINT
res
;
MSIHANDLE
suminfo
;
/* build summmary info */
res
=
MsiGetSummaryInformation
(
hdb
,
NULL
,
7
,
&
suminfo
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to open summaryinfo
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
2
,
VT_LPSTR
,
0
,
NULL
,
"Installation Database"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
3
,
VT_LPSTR
,
0
,
NULL
,
"Installation Database"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
4
,
VT_LPSTR
,
0
,
NULL
,
"Wine Hackers"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
7
,
VT_LPSTR
,
0
,
NULL
,
";1033"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
9
,
VT_LPSTR
,
0
,
NULL
,
"{913B8D18-FBB6-4CAC-A239-C74C11E3FA74}"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
14
,
VT_I4
,
100
,
NULL
,
NULL
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoSetProperty
(
suminfo
,
15
,
VT_I4
,
0
,
NULL
,
NULL
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to set summary info
\n
"
);
res
=
MsiSummaryInfoPersist
(
suminfo
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to make summary info persist
\n
"
);
res
=
MsiCloseHandle
(
suminfo
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to close suminfo
\n
"
);
return
res
;
}
MSIHANDLE
create_package_db
(
void
)
{
MSIHANDLE
hdb
=
0
;
CHAR
szName
[]
=
"C:
\\
mytest.msi"
;
UINT
res
;
DeleteFile
(
szName
);
/* create an empty database */
res
=
MsiOpenDatabase
(
szName
,
MSIDBOPEN_CREATE
,
&
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to create database
\n
"
);
if
(
res
!=
ERROR_SUCCESS
)
return
hdb
;
res
=
MsiDatabaseCommit
(
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to commit database
\n
"
);
res
=
set_summary_info
(
hdb
);
res
=
run_query
(
hdb
,
"CREATE TABLE `Directory` ( "
"`Directory` CHAR(255) NOT NULL, "
"`Directory_Parent` CHAR(255), "
"`DefaultDir` CHAR(255) NOT NULL "
"PRIMARY KEY `Directory`)"
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to create directory table
\n
"
);
return
hdb
;
}
MSIHANDLE
package_from_db
(
MSIHANDLE
hdb
)
{
UINT
res
;
CHAR
szPackage
[
10
];
MSIHANDLE
hPackage
;
sprintf
(
szPackage
,
"#%li"
,
hdb
);
res
=
MsiOpenPackage
(
szPackage
,
&
hPackage
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to open package
\n
"
);
res
=
MsiCloseHandle
(
hdb
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to close db handle
\n
"
);
return
hPackage
;
}
static
void
test_createpackage
(
void
)
{
MSIHANDLE
hPackage
=
0
;
UINT
res
;
hPackage
=
package_from_db
(
create_package_db
());
ok
(
hPackage
!=
0
,
" Failed to create package
\n
"
);
res
=
MsiCloseHandle
(
hPackage
);
ok
(
res
==
ERROR_SUCCESS
,
"Failed to close package
\n
"
);
}
START_TEST
(
package
)
{
test_createpackage
();
}
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