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
34202629
Commit
34202629
authored
Apr 21, 2009
by
Nicolas Le Cam
Committed by
Alexandre Julliard
Apr 23, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Add empty dir test for the DrLocator part of the AppSearch action.
parent
03afdb02
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
51 additions
and
0 deletions
+51
-0
package.c
dlls/msi/tests/package.c
+51
-0
No files found.
dlls/msi/tests/package.c
View file @
34202629
...
...
@@ -8555,6 +8555,42 @@ static void test_appsearch_inilocator(void)
DeleteFileA
(
msifile
);
}
/*
* MSI AppSearch action on DrLocator table always returns absolute paths.
* If a relative path was set, it returns the first absolute path that
* matches or an empty string if it didn't find anything.
* This helper function replicates this behaviour.
*/
static
void
search_absolute_directory
(
LPSTR
absolute
,
LPCSTR
relative
)
{
int
i
,
size
;
DWORD
attr
,
drives
;
size
=
lstrlenA
(
relative
);
drives
=
GetLogicalDrives
();
lstrcpyA
(
absolute
,
"A:
\\
"
);
for
(
i
=
0
;
i
<
26
;
absolute
[
0
]
=
'\0'
,
i
++
)
{
if
(
!
(
drives
&
(
1
<<
i
)))
continue
;
absolute
[
0
]
=
'A'
+
i
;
if
(
GetDriveType
(
absolute
)
!=
DRIVE_FIXED
)
continue
;
lstrcpynA
(
absolute
+
3
,
relative
,
size
+
1
);
attr
=
GetFileAttributesA
(
absolute
);
if
(
attr
!=
INVALID_FILE_ATTRIBUTES
&&
(
attr
&
FILE_ATTRIBUTE_DIRECTORY
))
{
if
(
absolute
[
3
+
size
-
1
]
!=
'\\'
)
lstrcatA
(
absolute
,
"
\\
"
);
break
;
}
absolute
[
3
]
=
'\0'
;
}
}
static
void
test_appsearch_drlocator
(
void
)
{
MSIHANDLE
hpkg
,
hdb
;
...
...
@@ -8617,6 +8653,9 @@ static void test_appsearch_drlocator(void)
r
=
add_appsearch_entry
(
hdb
,
"'SIGPROP10', 'NewSignature10'"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
add_appsearch_entry
(
hdb
,
"'SIGPROP11', 'NewSignature11'"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
create_drlocator_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
@@ -8670,6 +8709,11 @@ static void test_appsearch_drlocator(void)
r
=
add_drlocator_entry
(
hdb
,
path
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
/* no parent, relative empty path, depth 0, no signature */
sprintf
(
path
,
"'NewSignature11', '', '', 0"
);
r
=
add_drlocator_entry
(
hdb
,
path
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
r
=
create_signature_table
(
hdb
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
...
...
@@ -8770,6 +8814,13 @@ static void test_appsearch_drlocator(void)
ok
(
!
lstrcmpA
(
prop
,
""
),
"Expected
\"\"
, got
\"
%s
\"\n
"
,
prop
);
}
size
=
MAX_PATH
;
search_absolute_directory
(
path
,
""
);
r
=
MsiGetPropertyA
(
hpkg
,
"SIGPROP11"
,
prop
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
r
);
todo_wine
ok
(
!
lstrcmpA
(
prop
,
path
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
path
,
prop
);
DeleteFileA
(
"FileName1"
);
DeleteFileA
(
"FileName3.dll"
);
DeleteFileA
(
"FileName4.dll"
);
...
...
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