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
b5ac29a7
Commit
b5ac29a7
authored
Feb 25, 2009
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Add some tests for MsiEnumPatchesW, fix a few failures on XP.
parent
b4d81f85
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
38 additions
and
6 deletions
+38
-6
msi.c
dlls/msi/tests/msi.c
+38
-6
No files found.
dlls/msi/tests/msi.c
View file @
b5ac29a7
...
...
@@ -9090,6 +9090,7 @@ static void test_MsiEnumPatches(void)
CHAR
patchcode
[
MAX_PATH
],
patch_squashed
[
MAX_PATH
];
CHAR
prodcode
[
MAX_PATH
],
prod_squashed
[
MAX_PATH
];
CHAR
transforms
[
MAX_PATH
];
WCHAR
patchW
[
MAX_PATH
],
prodcodeW
[
MAX_PATH
],
transformsW
[
MAX_PATH
];
HKEY
prodkey
,
patches
,
udprod
;
HKEY
userkey
,
hpatch
,
udpatch
;
DWORD
size
,
data
;
...
...
@@ -9298,7 +9299,7 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
,
"Expected 8
, got %d
\n
"
,
size
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH
, got %d
\n
"
,
size
);
/* lpPatchBuf is NULL */
size
=
MAX_PATH
;
...
...
@@ -9341,7 +9342,7 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whate"
),
"Expected
\"
whate
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
16
,
"Expected
16, got %d
\n
"
,
size
);
ok
(
size
==
8
||
size
==
16
,
"Expected 8 or
16, got %d
\n
"
,
size
);
/* increase the index */
size
=
MAX_PATH
;
...
...
@@ -9507,7 +9508,7 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
,
"Expected 8
, got %d
\n
"
,
size
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH
, got %d
\n
"
,
size
);
RegDeleteKeyA
(
userkey
,
""
);
RegCloseKey
(
userkey
);
...
...
@@ -9632,7 +9633,7 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
,
"Expected 8
, got %d
\n
"
,
size
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH
, got %d
\n
"
,
size
);
lstrcpyA
(
keypath
,
"Software
\\
Microsoft
\\
Windows
\\
CurrentVersion
\\
"
);
lstrcatA
(
keypath
,
"Installer
\\
UserData
\\
S-1-5-18
\\
Products
\\
"
);
...
...
@@ -9651,7 +9652,7 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
,
"Expected 8
, got %d
\n
"
,
size
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH
, got %d
\n
"
,
size
);
res
=
RegCreateKeyA
(
udprod
,
"Patches"
,
&
udpatch
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -9666,7 +9667,7 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
,
"Expected 8
, got %d
\n
"
,
size
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH
, got %d
\n
"
,
size
);
res
=
RegCreateKeyA
(
udpatch
,
patch_squashed
,
&
hpatch
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -9698,8 +9699,39 @@ static void test_MsiEnumPatches(void)
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH, got %d
\n
"
,
size
);
/* now duplicate some of the tests for the W version */
/* pcchTransformsBuf is too small */
size
=
6
;
MultiByteToWideChar
(
CP_ACP
,
0
,
prodcode
,
-
1
,
prodcodeW
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"apple"
,
-
1
,
patchW
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"banana"
,
-
1
,
transformsW
,
MAX_PATH
);
r
=
MsiEnumPatchesW
(
prodcodeW
,
0
,
patchW
,
transformsW
,
&
size
);
ok
(
r
==
ERROR_MORE_DATA
,
"Expected ERROR_MORE_DATA, got %d
\n
"
,
r
);
WideCharToMultiByte
(
CP_ACP
,
0
,
patchW
,
-
1
,
patch
,
MAX_PATH
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
transformsW
,
-
1
,
transforms
,
MAX_PATH
,
NULL
,
NULL
);
ok
(
!
lstrcmpA
(
patch
,
patchcode
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whate"
),
"Expected
\"
whate
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
,
"Expected 8, got %d
\n
"
,
size
);
/* patch code value exists */
size
=
MAX_PATH
;
MultiByteToWideChar
(
CP_ACP
,
0
,
"apple"
,
-
1
,
patchW
,
MAX_PATH
);
MultiByteToWideChar
(
CP_ACP
,
0
,
"banana"
,
-
1
,
transformsW
,
MAX_PATH
);
r
=
MsiEnumPatchesW
(
prodcodeW
,
0
,
patchW
,
transformsW
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
WideCharToMultiByte
(
CP_ACP
,
0
,
patchW
,
-
1
,
patch
,
MAX_PATH
,
NULL
,
NULL
);
WideCharToMultiByte
(
CP_ACP
,
0
,
transformsW
,
-
1
,
transforms
,
MAX_PATH
,
NULL
,
NULL
);
ok
(
!
lstrcmpA
(
patch
,
patchcode
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
patchcode
,
patch
);
ok
(
!
lstrcmpA
(
transforms
,
"whatever"
),
"Expected
\"
whatever
\"
, got
\"
%s
\"\n
"
,
transforms
);
ok
(
size
==
8
||
size
==
MAX_PATH
,
"Expected 8 or MAX_PATH, got %d
\n
"
,
size
);
RegDeleteValueA
(
patches
,
patch_squashed
);
RegDeleteValueA
(
patches
,
"Patches"
);
RegDeleteKeyA
(
patches
,
""
);
...
...
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