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
fdd55977
Commit
fdd55977
authored
Mar 23, 2008
by
James Hawkins
Committed by
Alexandre Julliard
Mar 24, 2008
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Don't hardcode the root drive.
parent
9048ecef
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
30 additions
and
16 deletions
+30
-16
format.c
dlls/msi/tests/format.c
+30
-16
No files found.
dlls/msi/tests/format.c
View file @
fdd55977
...
...
@@ -21,6 +21,7 @@
#include <stdio.h>
#include <windows.h>
#include <shlwapi.h>
#include <msi.h>
#include <msiquery.h>
...
...
@@ -2176,6 +2177,7 @@ static void test_formatrecord_tables(void)
CHAR
buf
[
MAX_PATH
];
CHAR
curr_dir
[
MAX_PATH
];
CHAR
expected
[
MAX_PATH
];
CHAR
root
[
MAX_PATH
];
DWORD
size
;
UINT
r
;
...
...
@@ -2304,48 +2306,57 @@ static void test_formatrecord_tables(void)
r
=
MsiDoAction
(
hpkg
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"CostFinalize failed: %d
\n
"
,
r
);
size
=
MAX_PATH
;
MsiGetProperty
(
hpkg
,
"ROOTDRIVE"
,
root
,
&
size
);
sprintf
(
expected
,
"1: %sfrontal.txt "
,
root
);
/* frontal full file key */
size
=
MAX_PATH
;
MsiRecordSetString
(
hrec
,
1
,
"[#frontal_file]"
);
r
=
MsiFormatRecord
(
hpkg
,
hrec
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"format record failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"1: C:
\\
frontal.txt "
),
"Expected '1: C:
\\
frontal.txt ', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
/* frontal short file key */
size
=
MAX_PATH
;
MsiRecordSetString
(
hrec
,
1
,
"[!frontal_file]"
);
r
=
MsiFormatRecord
(
hpkg
,
hrec
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"format record failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"1: C:
\\
frontal.txt "
),
"Expected '1: C:
\\
frontal.txt ', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
sprintf
(
expected
,
"1: %sI am a really long directory
\\
temporal.txt "
,
root
);
/* temporal full file key */
size
=
MAX_PATH
;
MsiRecordSetString
(
hrec
,
1
,
"[#temporal_file]"
);
r
=
MsiFormatRecord
(
hpkg
,
hrec
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"format record failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"1: C:
\\
I am a really long directory
\\
temporal.txt "
),
"Expected '1: C:
\\
I am a really long directory
\\
temporal.txt ', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
/* temporal short file key */
size
=
MAX_PATH
;
MsiRecordSetString
(
hrec
,
1
,
"[!temporal_file]"
);
r
=
MsiFormatRecord
(
hpkg
,
hrec
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"format record failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"1: C:
\\
I am a really long directory
\\
temporal.txt "
),
"Expected '1: C:
\\
I am a really long directory
\\
temporal.txt ', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
/* custom action 51, files don't exist */
r
=
MsiDoAction
(
hpkg
,
"MyCustom"
);
ok
(
r
==
ERROR_SUCCESS
,
"MyCustom failed: %d
\n
"
,
r
);
sprintf
(
expected
,
"%sI am a really long directory
\\
temporal.txt"
,
root
);
size
=
MAX_PATH
;
r
=
MsiGetProperty
(
hpkg
,
"prop"
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"C:
\\
I am a really long directory
\\
temporal.txt"
),
"Expected 'C:
\\
I am a really long directory
\\
temporal.txt', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
sprintf
(
buf
,
"%sI am a really long directory"
,
root
);
CreateDirectory
(
buf
,
NULL
);
CreateDirectory
(
"C:
\\
I am a really long directory"
,
NULL
);
create_test_file
(
"C:
\\
I am a really long directory
\\
temporal.txt"
);
lstrcat
(
buf
,
"
\\
temporal.txt"
);
create_test_file
(
buf
);
/* custom action 51, files exist */
r
=
MsiDoAction
(
hpkg
,
"MyCustom"
);
...
...
@@ -2356,8 +2367,7 @@ static void test_formatrecord_tables(void)
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
todo_wine
{
ok
(
!
lstrcmp
(
buf
,
"C:
\\
I am a really long directory
\\
temporal.txt"
),
"Expected 'C:
\\
I am a really long directory
\\
temporal.txt', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
}
/* custom action 51, escaped text 1 */
...
...
@@ -2387,13 +2397,14 @@ static void test_formatrecord_tables(void)
ok
(
r
==
ERROR_SUCCESS
,
"get property failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
""
),
"Expected '', got %s
\n
"
,
buf
);
sprintf
(
expected
,
"1: %sI am a really long directory
\\
"
,
root
);
/* component with INSTALLSTATE_LOCAL */
size
=
MAX_PATH
;
MsiRecordSetString
(
hrec
,
1
,
"[$temporal]"
);
r
=
MsiFormatRecord
(
hpkg
,
hrec
,
buf
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"format record failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
"1: C:
\\
I am a really long directory
\\
"
),
"Expected '1: C:
\\
I am a really long directory
\\
', got %s
\n
"
,
buf
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected
\"
%s
\"
, got
\"
%s
\"\n
"
,
expected
,
buf
);
r
=
MsiSetComponentState
(
hpkg
,
"temporal"
,
INSTALLSTATE_SOURCE
);
ok
(
r
==
ERROR_SUCCESS
,
"failed to set install state: %d
\n
"
,
r
);
...
...
@@ -2408,8 +2419,11 @@ static void test_formatrecord_tables(void)
ok
(
r
==
ERROR_SUCCESS
,
"format record failed: %d
\n
"
,
r
);
ok
(
!
lstrcmp
(
buf
,
expected
),
"Expected '%s', got %s
\n
"
,
expected
,
buf
);
DeleteFile
(
"C:
\\
I am a really long directory
\\
temporal.txt"
);
RemoveDirectory
(
"C:
\\
I am a really long directory"
);
sprintf
(
buf
,
"%sI am a really long directory
\\
temporal.txt"
,
root
);
DeleteFile
(
buf
);
sprintf
(
buf
,
"%sI am a really long directory"
,
root
);
RemoveDirectory
(
buf
);
MsiCloseHandle
(
hrec
);
MsiCloseHandle
(
hpkg
);
...
...
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