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
7a9b2182
Commit
7a9b2182
authored
May 14, 2007
by
Misha Koshelev
Committed by
Alexandre Julliard
May 15, 2007
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: automation: Add tests for Installer::RelatedProducts.
parent
5b37ba6f
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
58 additions
and
3 deletions
+58
-3
automation.c
dlls/msi/tests/automation.c
+58
-3
No files found.
dlls/msi/tests/automation.c
View file @
7a9b2182
...
...
@@ -34,6 +34,7 @@
static
const
char
*
msifile
=
"winetest.msi"
;
static
const
WCHAR
szMsifile
[]
=
{
'w'
,
'i'
,
'n'
,
'e'
,
't'
,
'e'
,
's'
,
't'
,
'.'
,
'm'
,
's'
,
'i'
,
0
};
static
const
WCHAR
szProductCode
[]
=
{
'{'
,
'F'
,
'1'
,
'C'
,
'3'
,
'A'
,
'F'
,
'5'
,
'0'
,
'-'
,
'8'
,
'B'
,
'5'
,
'6'
,
'-'
,
'4'
,
'A'
,
'6'
,
'9'
,
'-'
,
'A'
,
'0'
,
'0'
,
'C'
,
'-'
,
'0'
,
'0'
,
'7'
,
'7'
,
'3'
,
'F'
,
'E'
,
'4'
,
'2'
,
'F'
,
'3'
,
'0'
,
'}'
,
0
};
static
const
WCHAR
szUpgradeCode
[]
=
{
'{'
,
'C'
,
'E'
,
'0'
,
'6'
,
'7'
,
'E'
,
'8'
,
'D'
,
'-'
,
'2'
,
'E'
,
'1'
,
'A'
,
'-'
,
'4'
,
'3'
,
'6'
,
'7'
,
'-'
,
'B'
,
'7'
,
'3'
,
'4'
,
'-'
,
'4'
,
'E'
,
'B'
,
'2'
,
'B'
,
'D'
,
'A'
,
'D'
,
'6'
,
'5'
,
'6'
,
'5'
,
'}'
,
0
};
CHAR
CURR_DIR
[
MAX_PATH
];
EXCEPINFO
excepinfo
;
...
...
@@ -763,6 +764,22 @@ static HRESULT Installer_Products(IDispatch **pStringList)
return
hr
;
}
static
HRESULT
Installer_RelatedProducts
(
LPCWSTR
szProduct
,
IDispatch
**
pStringList
)
{
VARIANT
varresult
;
VARIANTARG
vararg
[
1
];
DISPPARAMS
dispparams
=
{
vararg
,
NULL
,
sizeof
(
vararg
)
/
sizeof
(
VARIANTARG
),
0
};
HRESULT
hr
;
VariantInit
(
&
vararg
[
0
]);
V_VT
(
&
vararg
[
0
])
=
VT_BSTR
;
V_BSTR
(
&
vararg
[
0
])
=
SysAllocString
(
szProduct
);
hr
=
invoke
(
pInstaller
,
"RelatedProducts"
,
DISPATCH_PROPERTYGET
,
&
dispparams
,
&
varresult
,
VT_DISPATCH
);
*
pStringList
=
V_DISPATCH
(
&
varresult
);
return
hr
;
}
static
HRESULT
Installer_VersionGet
(
LPCWSTR
szVersion
)
{
VARIANT
varresult
;
...
...
@@ -1631,10 +1648,12 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
{
HRESULT
hr
;
CHAR
path
[
MAX_PATH
];
WCHAR
szString
[
MAX_PATH
];
LONG
res
;
HKEY
hkey
;
DWORD
num
,
size
,
type
;
int
iValue
;
int
iValue
,
iCount
;
IDispatch
*
pStringList
=
NULL
;
create_test_files
();
...
...
@@ -1647,6 +1666,27 @@ static void test_Installer_InstallProduct(LPCWSTR szPath)
ok
(
SUCCEEDED
(
hr
),
"Installer_ProductState failed, hresult 0x%08x
\n
"
,
hr
);
ok
(
iValue
==
INSTALLSTATE_DEFAULT
,
"Installer_ProductState returned %d, expected %d
\n
"
,
iValue
,
INSTALLSTATE_DEFAULT
);
/* Installer::RelatedProducts for our upgrade code */
todo_wine
{
hr
=
Installer_RelatedProducts
(
szUpgradeCode
,
&
pStringList
);
ok
(
SUCCEEDED
(
hr
),
"Installer_RelatedProducts failed, hresult 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* StringList::Count */
hr
=
StringList_Count
(
pStringList
,
&
iCount
);
ok
(
SUCCEEDED
(
hr
),
"StringList_Count failed, hresult 0x%08x
\n
"
,
hr
);
ok
(
iCount
==
1
,
"Expected one related product but found %d
\n
"
,
iCount
);
/* StringList::Item */
memset
(
szString
,
0
,
sizeof
(
szString
));
hr
=
StringList_Item
(
pStringList
,
0
,
szString
);
ok
(
SUCCEEDED
(
hr
),
"StringList_Item failed (idx 0, count %d), hresult 0x%08x
\n
"
,
iCount
,
hr
);
ok_w2
(
"StringList_Item returned %s but expected %s
\n
"
,
szString
,
szProductCode
);
IDispatch_Release
(
pStringList
);
}
}
/* Check & clean up installed files & registry keys */
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"File not installed
\n
"
);
...
...
@@ -1735,7 +1775,7 @@ static void test_Installer(void)
HRESULT
hr
;
UINT
len
;
IDispatch
*
pSession
=
NULL
,
*
pRecord
=
NULL
,
*
pStringList
=
NULL
;
int
iValue
;
int
iValue
,
iCount
;
if
(
!
pInstaller
)
return
;
...
...
@@ -1811,7 +1851,7 @@ static void test_Installer(void)
ok
(
SUCCEEDED
(
hr
),
"Installer_Products failed, hresult 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
int
i
Count
=
0
,
i
dx
;
int
idx
;
/* StringList::Count */
hr
=
StringList_Count
(
pStringList
,
&
iCount
);
...
...
@@ -1848,6 +1888,21 @@ static void test_Installer(void)
if
(
SUCCEEDED
(
hr
))
ok
(
iValue
==
INSTALLSTATE_UNKNOWN
,
"Installer_ProductState returned %d, expected %d
\n
"
,
iValue
,
INSTALLSTATE_UNKNOWN
);
/* Installer::RelatedProducts for our upgrade code, should not find anything */
todo_wine
{
hr
=
Installer_RelatedProducts
(
szUpgradeCode
,
&
pStringList
);
ok
(
SUCCEEDED
(
hr
),
"Installer_RelatedProducts failed, hresult 0x%08x
\n
"
,
hr
);
if
(
SUCCEEDED
(
hr
))
{
/* StringList::Count */
hr
=
StringList_Count
(
pStringList
,
&
iCount
);
ok
(
SUCCEEDED
(
hr
),
"StringList_Count failed, hresult 0x%08x
\n
"
,
hr
);
ok
(
!
iCount
,
"Expected no related products but found %d
\n
"
,
iCount
);
IDispatch_Release
(
pStringList
);
}
}
/* Installer::Version */
todo_wine
{
memset
(
szPath
,
0
,
sizeof
(
szPath
));
...
...
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