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
27ce47a2
Commit
27ce47a2
authored
Jul 22, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Jul 22, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Test getting the source path from a package with short file names.
parent
e806a285
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
168 additions
and
0 deletions
+168
-0
package.c
dlls/msi/tests/package.c
+168
-0
No files found.
dlls/msi/tests/package.c
View file @
27ce47a2
...
...
@@ -5713,9 +5713,13 @@ static void test_shortlongsource(void)
lstrcatA
(
subsrc
,
"long"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* long file names */
hdb
=
create_package_db
();
ok
(
hdb
,
"failed to create database
\n
"
);
set_suminfo_prop
(
hdb
,
PID_WORDCOUNT
,
0
);
r
=
add_directory_entry
(
hdb
,
"'TARGETDIR', '', 'SourceDir'"
);
ok
(
r
==
S_OK
,
"failed
\n
"
);
...
...
@@ -5746,6 +5750,8 @@ static void test_shortlongsource(void)
r
=
add_directory_entry
(
hdb
,
"'SubDir7', 'TARGETDIR', 'eleven|twelve'"
);
ok
(
r
==
S_OK
,
"failed
\n
"
);
MsiDatabaseCommit
(
hdb
);
hpkg
=
package_from_db
(
hdb
);
ok
(
hpkg
,
"failed to create package
\n
"
);
...
...
@@ -5878,6 +5884,168 @@ static void test_shortlongsource(void)
RemoveDirectoryA
(
"eight"
);
RemoveDirectoryA
(
"nine"
);
RemoveDirectoryA
(
"twelve"
);
/* short file names */
r
=
MsiOpenDatabase
(
msifile
,
MSIDBOPEN_DIRECT
,
&
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
set_suminfo_prop
(
hdb
,
PID_WORDCOUNT
,
msidbSumInfoSourceTypeSFN
);
hpkg
=
package_from_db
(
hdb
);
ok
(
hpkg
,
"failed to create package
\n
"
);
MsiCloseHandle
(
hdb
);
CreateDirectoryA
(
"one"
,
NULL
);
CreateDirectoryA
(
"four"
,
NULL
);
r
=
MsiDoAction
(
hpkg
,
"CostInitialize"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
CreateDirectory
(
"five"
,
NULL
);
CreateDirectory
(
"eight"
,
NULL
);
r
=
MsiDoAction
(
hpkg
,
"FileCost"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
CreateDirectory
(
"nine"
,
NULL
);
CreateDirectory
(
"twelve"
,
NULL
);
r
=
MsiDoAction
(
hpkg
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"short"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* neither short nor long source directories exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
CreateDirectoryA
(
"short"
,
NULL
);
/* short source directory exists */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
CreateDirectoryA
(
"long"
,
NULL
);
/* both short and long source directories exist */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"one"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* short dir exists before CostInitialize */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir2"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"three"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* long dir exists before CostInitialize */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir3"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"five"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* short dir exists before FileCost */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir4"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"seven"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* long dir exists before FileCost */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir5"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"nine"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* short dir exists before CostFinalize */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir6"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
}
lstrcpyA
(
subsrc
,
cwd
);
lstrcatA
(
subsrc
,
"eleven"
);
lstrcatA
(
subsrc
,
"
\\
"
);
/* long dir exists before CostFinalize */
size
=
MAX_PATH
;
lstrcpyA
(
path
,
"kiwi"
);
r
=
MsiGetSourcePath
(
hpkg
,
"SubDir7"
,
path
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmpA
(
path
,
subsrc
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
subsrc
,
path
);
ok
(
size
==
lstrlenA
(
subsrc
),
"Expected %d, got %d
\n
"
,
lstrlenA
(
subsrc
),
size
);
MsiCloseHandle
(
hpkg
);
RemoveDirectoryA
(
"short"
);
RemoveDirectoryA
(
"long"
);
RemoveDirectoryA
(
"one"
);
RemoveDirectoryA
(
"four"
);
RemoveDirectoryA
(
"five"
);
RemoveDirectoryA
(
"eight"
);
RemoveDirectoryA
(
"nine"
);
RemoveDirectoryA
(
"twelve"
);
DeleteFileA
(
msifile
);
}
...
...
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