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
15ad5de1
Commit
15ad5de1
authored
Jul 10, 2006
by
James Hawkins
Committed by
Alexandre Julliard
Jul 11, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Test how SetTargetPath affects the target paths of install files.
parent
3b506c64
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
79 additions
and
0 deletions
+79
-0
package.c
dlls/msi/tests/package.c
+79
-0
No files found.
dlls/msi/tests/package.c
View file @
15ad5de1
...
...
@@ -331,6 +331,25 @@ static void test_gettargetpath_bad(void)
DeleteFile
(
msifile
);
}
static
void
query_file_path
(
MSIHANDLE
hpkg
,
LPCSTR
file
,
LPSTR
buff
)
{
UINT
r
;
DWORD
size
;
MSIHANDLE
rec
;
rec
=
MsiCreateRecord
(
1
);
ok
(
rec
,
"MsiCreate record failed
\n
"
);
r
=
MsiRecordSetString
(
rec
,
0
,
file
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
size
=
MAX_PATH
;
r
=
MsiFormatRecord
(
hpkg
,
rec
,
buff
,
&
size
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
MsiCloseHandle
(
rec
);
}
static
void
test_settargetpath
(
void
)
{
char
tempdir
[
MAX_PATH
+
8
],
buffer
[
MAX_PATH
];
...
...
@@ -363,6 +382,12 @@ static void test_settargetpath(void)
ok
(
r
==
S_OK
,
"cannot add dummy component: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"INSERT INTO `Component` "
"(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
"VALUES( 'TestComp', '{A3FB59C8-C293-4F7E-B8C5-F0E1D8EEE4E5}', 'TestDir', 0, '', 'TestFile')"
);
ok
(
r
==
S_OK
,
"cannot add test component: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"CREATE TABLE `Feature` ( "
"`Feature` CHAR(38) NOT NULL, "
"`Feature_Parent` CHAR(38), "
...
...
@@ -375,12 +400,56 @@ static void test_settargetpath(void)
"PRIMARY KEY `Feature`)"
);
ok
(
r
==
S_OK
,
"cannot create Feature table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"INSERT INTO `Feature` "
"(`Feature`, `Feature_Parent`, `Display`, `Level`, `Attributes`) "
"VALUES( 'TestFeature', '', 0, 1, 0 )"
);
ok
(
r
==
ERROR_SUCCESS
,
"cannot add TestFeature to Feature table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"CREATE TABLE `FeatureComponents` ( "
"`Feature_` CHAR(38) NOT NULL, "
"`Component_` CHAR(72) NOT NULL "
"PRIMARY KEY `Feature_` )"
);
ok
(
r
==
S_OK
,
"cannot create FeatureComponents table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"INSERT INTO `FeatureComponents` "
"(`Feature_`, `Component_`) "
"VALUES( 'TestFeature', 'TestComp' )"
);
ok
(
r
==
S_OK
,
"cannot insert component into FeatureComponents table: %d
\n
"
,
r
);
add_directory_entry
(
hdb
,
"'TestParent', 'TARGETDIR', 'TestParent'"
);
add_directory_entry
(
hdb
,
"'TestDir', 'TestParent', 'TestDir'"
);
r
=
run_query
(
hdb
,
"CREATE TABLE `File` ("
"`File` CHAR(72) NOT NULL, "
"`Component_` CHAR(72) NOT NULL, "
"`FileName` CHAR(255) NOT NULL, "
"`FileSize` LONG NOT NULL, "
"`Version` CHAR(72), "
"`Language` CHAR(20), "
"`Attributes` SHORT, "
"`Sequence` SHORT NOT NULL "
"PRIMARY KEY `File`)"
);
ok
(
r
==
S_OK
,
"cannot create File table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"INSERT INTO `File` "
"(`File`, `Component_`, `FileName`, `FileSize`, `Version`, `Language`, `Attributes`, `Sequence`) "
"VALUES( 'TestFile', 'TestComp', 'testfile.txt', 0, '', '1033', 8192, 1 )"
);
ok
(
r
==
S_OK
,
"cannot add file to the File table: %d
\n
"
,
r
);
hpkg
=
package_from_db
(
hdb
);
ok
(
hpkg
,
"failed to create package
\n
"
);
r
=
MsiDoAction
(
hpkg
,
"CostInitialize"
);
ok
(
r
==
ERROR_SUCCESS
,
"cost init failed
\n
"
);
r
=
MsiDoAction
(
hpkg
,
"FileCost"
);
ok
(
r
==
ERROR_SUCCESS
,
"file cost failed
\n
"
);
r
=
MsiDoAction
(
hpkg
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"cost finalize failed
\n
"
);
...
...
@@ -425,6 +494,16 @@ static void test_settargetpath(void)
}
else
{
trace
(
"MsiGetTargetPath failed: %d
\n
"
,
r
);
}
r
=
MsiSetTargetPath
(
hpkg
,
"TestParent"
,
"C:
\\
one
\\
two"
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiSetTargetPath returned %d
\n
"
,
r
);
query_file_path
(
hpkg
,
"[#TestFile]"
,
buffer
);
todo_wine
{
ok
(
!
lstrcmp
(
buffer
,
"C:
\\
one
\\
two
\\
TestDir
\\
testfile.txt"
),
"Expected C:
\\
one
\\
two
\\
TestDir
\\
testfile.txt, got %s
\n
"
,
buffer
);
}
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