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
6f463db5
Commit
6f463db5
authored
Nov 04, 2016
by
Hans Leidekker
Committed by
Alexandre Julliard
Nov 04, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
msi/tests: Properly clean up test services.
Signed-off-by:
Hans Leidekker
<
hans@codeweavers.com
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
dea323dc
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
13 additions
and
12 deletions
+13
-12
action.c
dlls/msi/tests/action.c
+13
-12
No files found.
dlls/msi/tests/action.c
View file @
6f463db5
...
...
@@ -5427,28 +5427,23 @@ static void test_start_stop_services(void)
DeleteFileA
(
msifile
);
}
static
void
delete_
TestService
(
void
)
static
void
delete_
test_service
(
const
char
*
name
)
{
BOOL
ret
;
SC_HANDLE
manager
,
service
;
manager
=
OpenSCManagerA
(
NULL
,
NULL
,
SC_MANAGER_ALL_ACCESS
);
ok
(
manager
!=
NULL
,
"can't open service manager
\n
"
);
if
(
!
manager
)
return
;
service
=
OpenServiceA
(
manager
,
"TestService"
,
GENERIC_ALL
);
ok
(
service
!=
NULL
,
"TestService doesn't exist
\n
"
);
if
(
!
manager
)
return
;
service
=
OpenServiceA
(
manager
,
name
,
GENERIC_ALL
);
if
(
service
)
{
ret
=
DeleteService
(
service
);
ok
(
ret
,
"failed to delete service %u
\n
"
,
GetLastError
()
);
CloseServiceHandle
(
service
);
}
CloseServiceHandle
(
manager
);
}
static
void
test_delete_services
(
void
)
...
...
@@ -5473,7 +5468,7 @@ static void test_delete_services(void)
ok
(
service
!=
NULL
,
"can't create service %u
\n
"
,
GetLastError
());
CloseServiceHandle
(
service
);
CloseServiceHandle
(
manager
);
if
(
!
service
)
goto
error
;
if
(
!
service
)
return
;
create_test_files
();
create_database
(
msifile
,
sds_tables
,
sizeof
(
sds_tables
)
/
sizeof
(
msi_table
));
...
...
@@ -5516,7 +5511,9 @@ static void test_delete_services(void)
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"Directory not created
\n
"
);
error:
delete_TestService
();
delete_test_service
(
"TestService"
);
delete_test_service
(
"TestService2"
);
delete_test_service
(
"TestService3"
);
delete_test_files
();
DeleteFileA
(
msifile
);
}
...
...
@@ -5558,7 +5555,6 @@ static void test_install_services(void)
service
=
OpenServiceA
(
manager
,
"TestService4"
,
GENERIC_ALL
);
ok
(
service
==
NULL
,
"TestService4 installed
\n
"
);
CloseServiceHandle
(
manager
);
res
=
RegOpenKeyA
(
HKEY_LOCAL_MACHINE
,
"SYSTEM
\\
CurrentControlSet
\\
Services
\\
TestService"
,
&
hKey
);
ok
(
res
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %d
\n
"
,
res
);
...
...
@@ -5576,6 +5572,11 @@ static void test_install_services(void)
r
=
MsiInstallProductA
(
msifile
,
"REMOVE=ALL"
);
ok
(
r
==
ERROR_SUCCESS
,
"Expected ERROR_SUCCESS, got %u
\n
"
,
r
);
service
=
OpenServiceA
(
manager
,
"TestService"
,
GENERIC_ALL
);
ok
(
service
!=
NULL
,
"TestService deleted
\n
"
);
CloseServiceHandle
(
service
);
CloseServiceHandle
(
manager
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new
\\
five.txt"
,
TRUE
),
"File not installed
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
new"
,
FALSE
),
"Directory not created
\n
"
);
ok
(
delete_pf
(
"msitest
\\
cabout
\\
four.txt"
,
TRUE
),
"File not installed
\n
"
);
...
...
@@ -5591,7 +5592,7 @@ static void test_install_services(void)
ok
(
delete_pf
(
"msitest"
,
FALSE
),
"Directory not created
\n
"
);
error:
delete_
TestService
(
);
delete_
test_service
(
"TestService"
);
delete_test_files
();
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