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
07edeb83
Commit
07edeb83
authored
Jun 16, 2006
by
Andrey Turkin
Committed by
Alexandre Julliard
Jun 16, 2006
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi: Added tests for MsiSetTargetPath.
parent
9eb81363
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
4 deletions
+85
-4
package.c
dlls/msi/tests/package.c
+85
-4
No files found.
dlls/msi/tests/package.c
View file @
07edeb83
...
...
@@ -331,14 +331,59 @@ static void test_gettargetpath_bad(void)
DeleteFile
(
msifile
);
}
static
void
test_settargetpath
_bad
(
void
)
static
void
test_settargetpath
(
void
)
{
char
tempdir
[
MAX_PATH
+
8
],
buffer
[
MAX_PATH
];
DWORD
sz
;
MSIHANDLE
hpkg
;
UINT
r
;
hpkg
=
package_from_db
(
create_package_db
());
MSIHANDLE
hdb
;
hdb
=
create_package_db
();
ok
(
hdb
,
"failed to create package database
\n
"
);
r
=
add_directory_entry
(
hdb
,
"'TARGETDIR', '', 'SourceDir'"
);
ok
(
r
==
S_OK
,
"failed to add directory entry: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
/* these tables required by Windows Installer for MsiSetTargetPath */
"CREATE TABLE `Component` ( "
"`Component` CHAR(72) NOT NULL, "
"`ComponentId` CHAR(38), "
"`Directory_` CHAR(72) NOT NULL, "
"`Attributes` SHORT NOT NULL, "
"`Condition` CHAR(255), "
"`KeyPath` CHAR(72) "
"PRIMARY KEY `Component`)"
);
ok
(
r
==
S_OK
,
"cannot create Component table: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"INSERT INTO `Component` "
"(`Component`, `ComponentId`, `Directory_`, `Attributes`, `Condition`, `KeyPath`) "
"VALUES( 'WinWorkAround', '{83e2694d-0864-4124-9323-6d37630912a1}', 'TARGETDIR', 8, '', 'FL_dummycomponent')"
);
ok
(
r
==
S_OK
,
"cannot add dummy component: %d
\n
"
,
r
);
r
=
run_query
(
hdb
,
"CREATE TABLE `Feature` ( "
"`Feature` CHAR(38) NOT NULL, "
"`Feature_Parent` CHAR(38), "
"`Title` CHAR(64), "
"`Description` CHAR(255), "
"`Display` SHORT NOT NULL, "
"`Level` SHORT NOT NULL, "
"`Directory_` CHAR(72), "
"`Attributes` SHORT NOT NULL "
"PRIMARY KEY `Feature`)"
);
ok
(
r
==
S_OK
,
"cannot create Feature 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
,
"CostFinalize"
);
ok
(
r
==
ERROR_SUCCESS
,
"cost finalize failed
\n
"
);
r
=
MsiSetTargetPath
(
0
,
NULL
,
NULL
);
ok
(
r
==
ERROR_INVALID_PARAMETER
,
"wrong return val
\n
"
);
...
...
@@ -351,6 +396,42 @@ static void test_settargetpath_bad(void)
r
=
MsiSetTargetPath
(
hpkg
,
"boo"
,
"c:
\\
bogusx"
);
ok
(
r
==
ERROR_DIRECTORY
,
"wrong return val
\n
"
);
sz
=
sizeof
tempdir
-
1
;
r
=
MsiGetTargetPath
(
hpkg
,
"TARGETDIR"
,
tempdir
,
&
sz
);
if
(
r
==
S_OK
)
{
if
(
GetTempFileName
(
tempdir
,
"_wt"
,
0
,
buffer
)
)
{
sprintf
(
tempdir
,
"%s
\\
subdir"
,
buffer
);
r
=
MsiSetTargetPath
(
hpkg
,
"TARGETDIR"
,
buffer
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"MsiSetTargetPath on file returned %d
\n
"
,
r
);
}
r
=
MsiSetTargetPath
(
hpkg
,
"TARGETDIR"
,
tempdir
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"MsiSetTargetPath on 'subdir' of file returned %d
\n
"
,
r
);
}
DeleteFile
(
buffer
);
r
=
MsiSetTargetPath
(
hpkg
,
"TARGETDIR"
,
buffer
);
ok
(
r
==
ERROR_SUCCESS
,
"MsiSetTargetPath returned %d
\n
"
,
r
);
r
=
GetFileAttributes
(
buffer
);
ok
(
r
==
INVALID_FILE_ATTRIBUTES
,
"file/directory exists after MsiSetTargetPath. Attributes: %08X
\n
"
,
r
);
r
=
MsiSetTargetPath
(
hpkg
,
"TARGETDIR"
,
tempdir
);
todo_wine
{
ok
(
r
==
ERROR_SUCCESS
,
"MsiSetTargetPath on subsubdir returned %d
\n
"
,
r
);
}
}
else
{
trace
(
"GetTempFileName failed, cannot do some tests
\n
"
);
}
}
else
{
trace
(
"MsiGetTargetPath failed: %d
\n
"
,
r
);
}
MsiCloseHandle
(
hpkg
);
}
...
...
@@ -1017,7 +1098,7 @@ START_TEST(package)
test_getsourcepath
();
test_doaction
();
test_gettargetpath_bad
();
test_settargetpath
_bad
();
test_settargetpath
();
test_props
();
test_condition
();
test_msipackage
();
...
...
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