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
7984fb9f
Commit
7984fb9f
authored
Apr 03, 2015
by
Sebastian Lackner
Committed by
Alexandre Julliard
Apr 07, 2015
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
kernel32/tests: Add tests for waiting on an job object.
parent
1d359a58
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
85 additions
and
0 deletions
+85
-0
process.c
dlls/kernel32/tests/process.c
+85
-0
No files found.
dlls/kernel32/tests/process.c
View file @
7984fb9f
...
...
@@ -2443,6 +2443,90 @@ static void test_KillOnJobClose(void)
CloseHandle
(
pi
.
hThread
);
}
static
void
test_WaitForJobObject
(
void
)
{
HANDLE
job
;
PROCESS_INFORMATION
pi
;
BOOL
ret
;
DWORD
dwret
;
/* test waiting for a job object when the process is killed */
job
=
pCreateJobObjectW
(
NULL
,
NULL
);
ok
(
job
!=
NULL
,
"CreateJobObject error %u
\n
"
,
GetLastError
());
dwret
=
WaitForSingleObject
(
job
,
100
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %u
\n
"
,
dwret
);
create_process
(
"wait"
,
&
pi
);
ret
=
pAssignProcessToJobObject
(
job
,
pi
.
hProcess
);
ok
(
ret
,
"AssignProcessToJobObject error %u
\n
"
,
GetLastError
());
dwret
=
WaitForSingleObject
(
job
,
100
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %u
\n
"
,
dwret
);
ret
=
pTerminateJobObject
(
job
,
123
);
ok
(
ret
,
"TerminateJobObject error %u
\n
"
,
GetLastError
());
dwret
=
WaitForSingleObject
(
job
,
500
);
todo_wine
ok
(
dwret
==
WAIT_OBJECT_0
||
broken
(
dwret
==
WAIT_TIMEOUT
),
"WaitForSingleObject returned %u
\n
"
,
dwret
);
if
(
dwret
==
WAIT_TIMEOUT
)
/* Win 2000/XP */
{
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
CloseHandle
(
job
);
todo_wine
win_skip
(
"TerminateJobObject doesn't signal job, skipping tests
\n
"
);
return
;
}
/* the object is not reset immediately */
dwret
=
WaitForSingleObject
(
job
,
100
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
dwret
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
/* creating a new process doesn't reset the signalled state */
create_process
(
"wait"
,
&
pi
);
ret
=
pAssignProcessToJobObject
(
job
,
pi
.
hProcess
);
ok
(
ret
,
"AssignProcessToJobObject error %u
\n
"
,
GetLastError
());
dwret
=
WaitForSingleObject
(
job
,
100
);
ok
(
dwret
==
WAIT_OBJECT_0
,
"WaitForSingleObject returned %u
\n
"
,
dwret
);
ret
=
pTerminateJobObject
(
job
,
123
);
ok
(
ret
,
"TerminateJobObject error %u
\n
"
,
GetLastError
());
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
CloseHandle
(
job
);
/* repeat the test, but this time the process terminates properly */
job
=
pCreateJobObjectW
(
NULL
,
NULL
);
ok
(
job
!=
NULL
,
"CreateJobObject error %u
\n
"
,
GetLastError
());
dwret
=
WaitForSingleObject
(
job
,
100
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %u
\n
"
,
dwret
);
create_process
(
"exit"
,
&
pi
);
ret
=
pAssignProcessToJobObject
(
job
,
pi
.
hProcess
);
ok
(
ret
,
"AssignProcessToJobObject error %u
\n
"
,
GetLastError
());
dwret
=
WaitForSingleObject
(
job
,
100
);
ok
(
dwret
==
WAIT_TIMEOUT
,
"WaitForSingleObject returned %u
\n
"
,
dwret
);
CloseHandle
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
CloseHandle
(
job
);
}
static
HANDLE
test_AddSelfToJob
(
void
)
{
HANDLE
job
;
...
...
@@ -2625,6 +2709,7 @@ START_TEST(process)
test_QueryInformationJobObject
();
test_CompletionPort
();
test_KillOnJobClose
();
test_WaitForJobObject
();
job
=
test_AddSelfToJob
();
test_jobInheritance
(
job
);
test_BreakawayOk
(
job
);
...
...
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