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
328fbb68
Commit
328fbb68
authored
Aug 31, 2016
by
Sebastian Lackner
Committed by
Alexandre Julliard
Aug 31, 2016
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
services/tests: Add test for passing arguments to a service.
Signed-off-by:
Sebastian Lackner
<
sebastian@fds-team.de
>
Signed-off-by:
Alexandre Julliard
<
julliard@winehq.org
>
parent
985443ed
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
8 deletions
+9
-8
service.c
programs/services/tests/service.c
+9
-8
No files found.
programs/services/tests/service.c
View file @
328fbb68
...
...
@@ -98,9 +98,10 @@ static void WINAPI service_main(DWORD argc, char **argv)
SERVICE_STATUS
status
;
BOOL
res
;
service_ok
(
argc
==
1
,
"argc = %d
\n
"
,
argc
);
if
(
argc
)
service_ok
(
!
strcmp
(
argv
[
0
],
service_name
),
"argv[0] = %s, expected %s
\n
"
,
argv
[
0
],
service_name
);
service_ok
(
argc
==
3
,
"argc = %u, expected 3
\n
"
,
argc
);
service_ok
(
!
strcmp
(
argv
[
0
],
service_name
),
"argv[0] = '%s', expected '%s'
\n
"
,
argv
[
0
],
service_name
);
service_ok
(
!
strcmp
(
argv
[
1
],
"param1"
),
"argv[1] = '%s', expected 'param1'
\n
"
,
argv
[
1
]);
service_ok
(
!
strcmp
(
argv
[
2
],
"param2"
),
"argv[2] = '%s', expected 'param2'
\n
"
,
argv
[
2
]);
service_handle
=
pRegisterServiceCtrlHandlerExA
(
service_name
,
service_handler
,
NULL
);
service_ok
(
service_handle
!=
NULL
,
"RegisterServiceCtrlHandlerEx failed: %u
\n
"
,
GetLastError
());
...
...
@@ -194,9 +195,8 @@ static void WINAPI no_stop_main(DWORD argc, char **argv)
SERVICE_STATUS
status
;
BOOL
res
;
service_ok
(
argc
==
1
,
"argc = %d
\n
"
,
argc
);
if
(
argc
)
service_ok
(
!
strcmp
(
argv
[
0
],
service_name
),
"argv[0] = %s, expected %s
\n
"
,
argv
[
0
],
service_name
);
service_ok
(
argc
==
1
,
"argc = %u, expected 1
\n
"
,
argc
);
service_ok
(
!
strcmp
(
argv
[
0
],
service_name
),
"argv[0] = '%s', expected '%s'
\n
"
,
argv
[
0
],
service_name
);
service_handle
=
pRegisterServiceCtrlHandlerExA
(
service_name
,
no_stop_handler
,
NULL
);
service_ok
(
service_handle
!=
NULL
,
"RegisterServiceCtrlHandlerEx failed: %u
\n
"
,
GetLastError
());
...
...
@@ -278,7 +278,7 @@ static void expect_event(const char *event_name)
static
DWORD
WINAPI
pipe_thread
(
void
*
arg
)
{
char
buf
[
257
],
*
ptr
;
char
buf
[
512
],
*
ptr
;
DWORD
read
;
BOOL
res
;
...
...
@@ -320,6 +320,7 @@ static DWORD WINAPI pipe_thread(void *arg)
static
void
test_service
(
void
)
{
static
const
char
*
argv
[
2
]
=
{
"param1"
,
"param2"
};
SC_HANDLE
service_handle
=
register_service
(
"simple_service"
);
SERVICE_STATUS_PROCESS
status2
;
SERVICE_STATUS
status
;
...
...
@@ -330,7 +331,7 @@ static void test_service(void)
return
;
trace
(
"starting...
\n
"
);
res
=
StartServiceA
(
service_handle
,
0
,
NULL
);
res
=
StartServiceA
(
service_handle
,
2
,
argv
);
ok
(
res
,
"StartService failed: %u
\n
"
,
GetLastError
());
if
(
!
res
)
{
DeleteService
(
service_handle
);
...
...
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