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
aefd63dc
Commit
aefd63dc
authored
Jun 23, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jun 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Add more tests for MsiQueryFeatureState.
parent
2d4e4b6a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
235 additions
and
1 deletion
+235
-1
msi.c
dlls/msi/tests/msi.c
+235
-1
No files found.
dlls/msi/tests/msi.c
View file @
aefd63dc
...
@@ -735,6 +735,8 @@ static void test_MsiQueryFeatureState(void)
...
@@ -735,6 +735,8 @@ static void test_MsiQueryFeatureState(void)
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
/* MSIINSTALLCONTEXT_USERUNMANAGED */
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Installer
\\
Features
\\
"
);
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Installer
\\
Features
\\
"
);
lstrcatA
(
keypath
,
prod_squashed
);
lstrcatA
(
keypath
,
prod_squashed
);
...
@@ -748,6 +750,7 @@ static void test_MsiQueryFeatureState(void)
...
@@ -748,6 +750,7 @@ static void test_MsiQueryFeatureState(void)
res
=
RegSetValueExA
(
userkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
2
);
res
=
RegSetValueExA
(
userkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* feature value exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
...
@@ -760,6 +763,7 @@ static void test_MsiQueryFeatureState(void)
...
@@ -760,6 +763,7 @@ static void test_MsiQueryFeatureState(void)
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
localkey
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
localkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* userdata features key exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
...
@@ -811,7 +815,237 @@ static void test_MsiQueryFeatureState(void)
...
@@ -811,7 +815,237 @@ static void test_MsiQueryFeatureState(void)
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
RegDeleteValueA
(
compkey
,
prod_squashed
);
RegDeleteValueA
(
compkey
,
prod_squashed
);
RegDeleteValueA
(
compkey
,
""
);
RegDeleteKeyA
(
compkey
,
""
);
RegDeleteValueA
(
localkey
,
"feature"
);
RegDeleteValueA
(
userkey
,
"feature"
);
RegDeleteKeyA
(
userkey
,
""
);
RegCloseKey
(
compkey
);
RegCloseKey
(
localkey
);
RegCloseKey
(
userkey
);
/* MSIINSTALLCONTEXT_USERMANAGED */
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
Managed
\\
"
);
lstrcatA
(
keypath
,
usersid
);
lstrcatA
(
keypath
,
"
\\
Installer
\\
Features
\\
"
);
lstrcatA
(
keypath
,
prod_squashed
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
userkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* feature key exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
userkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* feature value exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
usersid
);
lstrcatA
(
keypath
,
"
\\
Products
\\
"
);
lstrcatA
(
keypath
,
prod_squashed
);
lstrcatA
(
keypath
,
"
\\
Features"
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
localkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* userdata features key exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaa"
,
20
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_BADCONFIG
,
"Expected INSTALLSTATE_BADCONFIG, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaaa"
,
21
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaaaa"
,
22
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
comp_base85
,
21
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
usersid
);
lstrcatA
(
keypath
,
"
\\
Components
\\
"
);
lstrcatA
(
keypath
,
comp_squashed
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
compkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"apple"
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
RegDeleteValueA
(
compkey
,
prod_squashed
);
RegDeleteKeyA
(
compkey
,
""
);
RegDeleteValueA
(
localkey
,
"feature"
);
RegDeleteValueA
(
userkey
,
"feature"
);
RegDeleteKeyA
(
userkey
,
""
);
RegCloseKey
(
compkey
);
RegCloseKey
(
localkey
);
RegCloseKey
(
userkey
);
/* MSIINSTALLCONTEXT_MACHINE */
lstrcpyA
(
keypath
,
"Software
\\
Classes
\\
Installer
\\
Features
\\
"
);
lstrcatA
(
keypath
,
prod_squashed
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
userkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* feature key exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
ok
(
state
==
INSTALLSTATE_UNKNOWN
,
"Expected INSTALLSTATE_UNKNOWN, got %d
\n
"
,
state
);
res
=
RegSetValueExA
(
userkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
2
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* feature value exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
"S-1-5-18
\\
Products
\\
"
);
lstrcatA
(
keypath
,
prod_squashed
);
lstrcatA
(
keypath
,
"
\\
Features"
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
localkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
/* userdata features key exists */
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaa"
,
20
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_BADCONFIG
,
"Expected INSTALLSTATE_BADCONFIG, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaaa"
,
21
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"aaaaaaaaaaaaaaaaaaaaa"
,
22
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
localkey
,
"feature"
,
0
,
REG_SZ
,
(
const
BYTE
*
)
comp_base85
,
21
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
Installer
\\
UserData
\\
"
);
lstrcatA
(
keypath
,
"S-1-5-18
\\
Components
\\
"
);
lstrcatA
(
keypath
,
comp_squashed
);
res
=
RegCreateKeyA
(
HKEY_LOCAL_MACHINE
,
keypath
,
&
compkey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_ADVERTISED
,
"Expected INSTALLSTATE_ADVERTISED, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
""
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
res
=
RegSetValueExA
(
compkey
,
prod_squashed
,
0
,
REG_SZ
,
(
const
BYTE
*
)
"apple"
,
1
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
state
=
MsiQueryFeatureStateA
(
prodcode
,
"feature"
);
todo_wine
{
ok
(
state
==
INSTALLSTATE_LOCAL
,
"Expected INSTALLSTATE_LOCAL, got %d
\n
"
,
state
);
}
RegDeleteValueA
(
compkey
,
prod_squashed
);
RegDeleteKeyA
(
compkey
,
""
);
RegDeleteValueA
(
localkey
,
"feature"
);
RegDeleteValueA
(
localkey
,
"feature"
);
RegDeleteValueA
(
userkey
,
"feature"
);
RegDeleteValueA
(
userkey
,
"feature"
);
RegDeleteKeyA
(
userkey
,
""
);
RegDeleteKeyA
(
userkey
,
""
);
...
...
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