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
f0d1d61d
Commit
f0d1d61d
authored
Mar 27, 2009
by
Hans Leidekker
Committed by
Alexandre Julliard
Mar 27, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add tests for MsiEnumProducts.
parent
9163b0d0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
71 additions
and
0 deletions
+71
-0
msi.c
dlls/msi/tests/msi.c
+71
-0
No files found.
dlls/msi/tests/msi.c
View file @
f0d1d61d
...
...
@@ -10874,6 +10874,76 @@ static void test_MsiGetPatchInfoEx(void)
RegCloseKey
(
udprod
);
}
static
void
test_MsiEnumProducts
(
void
)
{
UINT
r
;
int
found1
,
found2
,
found3
;
DWORD
index
;
char
product1
[
39
],
product2
[
39
],
product3
[
39
],
guid
[
39
];
char
product_squashed1
[
33
],
product_squashed2
[
33
],
product_squashed3
[
33
];
char
keypath1
[
MAX_PATH
],
keypath2
[
MAX_PATH
],
keypath3
[
MAX_PATH
];
char
*
usersid
;
HKEY
key1
,
key2
,
key3
;
create_test_guid
(
product1
,
product_squashed1
);
create_test_guid
(
product2
,
product_squashed2
);
create_test_guid
(
product3
,
product_squashed3
);
get_user_sid
(
&
usersid
);
strcpy
(
keypath1
,
"Software
\\
Classes
\\
Installer
\\
Products
\\
"
);
strcat
(
keypath1
,
product_squashed1
);
r
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath1
,
&
key1
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
strcpy
(
keypath2
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
Managed
\\
"
);
strcat
(
keypath2
,
usersid
);
strcat
(
keypath2
,
"
\\
Installer
\\
Products
\\
"
);
strcat
(
keypath2
,
product_squashed2
);
r
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath2
,
&
key2
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
strcpy
(
keypath3
,
"Software
\\
Microsoft
\\
Installer
\\
Products
\\
"
);
strcat
(
keypath3
,
product_squashed3
);
r
=
RegCreateKeyA
(
HKEY_CURRENT_USER
,
keypath3
,
&
key3
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
index
=
0
;
r
=
MsiEnumProductsA
(
index
,
NULL
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
r
);
index
=
2
;
r
=
MsiEnumProductsA
(
index
,
guid
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"Expected ERROR_INVALID_PARAMETER, got %u
\n
"
,
r
);
index
=
0
;
r
=
MsiEnumProductsA
(
index
,
guid
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
found1
=
found2
=
found3
=
0
;
while
((
r
=
MsiEnumProductsA
(
index
,
guid
))
==
ERROR_SUCCESS
)
{
if
(
!
strcmp
(
product1
,
guid
))
found1
=
1
;
if
(
!
strcmp
(
product2
,
guid
))
found2
=
1
;
if
(
!
strcmp
(
product3
,
guid
))
found3
=
1
;
index
++
;
}
ok
(
r
==
ERROR_NO_MORE_ITEMS
,
"Expected ERROR_NO_MORE_ITEMS, got %u
\n
"
,
r
);
ok
(
found1
,
"product1 not found
\n
"
);
ok
(
found2
,
"product2 not found
\n
"
);
ok
(
found3
,
"product3 not found
\n
"
);
RegDeleteKeyA
(
key1
,
""
);
RegDeleteKeyA
(
key2
,
""
);
RegDeleteKeyA
(
key3
,
""
);
RegCloseKey
(
key1
);
RegCloseKey
(
key2
);
RegCloseKey
(
key3
);
LocalFree
(
usersid
);
}
START_TEST
(
msi
)
{
init_functionpointers
();
...
...
@@ -10901,6 +10971,7 @@ START_TEST(msi)
test_MsiEnumPatchesEx
();
test_MsiEnumPatches
();
test_MsiGetPatchInfoEx
();
test_MsiEnumProducts
();
}
test_MsiGetFileVersion
();
...
...
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