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
05c71749
Commit
05c71749
authored
Feb 07, 2008
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tests: Add a helper routine to wait for a child process and propagate its result correctly.
parent
d89ee5fd
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
32 additions
and
28 deletions
+32
-28
security.c
dlls/advapi32/tests/security.c
+3
-1
actctx.c
dlls/kernel32/tests/actctx.c
+1
-2
toolhelp.c
dlls/kernel32/tests/toolhelp.c
+1
-4
exception.c
dlls/ntdll/tests/exception.c
+2
-1
marshal.c
dlls/ole32/tests/marshal.c
+1
-1
server.c
dlls/rpcrt4/tests/server.c
+4
-8
shellpath.c
dlls/shell32/tests/shellpath.c
+1
-2
cursoricon.c
dlls/user32/tests/cursoricon.c
+1
-9
test.h
include/wine/test.h
+18
-0
No files found.
dlls/advapi32/tests/security.c
View file @
05c71749
...
...
@@ -1812,8 +1812,10 @@ static void test_process_security(void)
ok
(
CreateProcessA
(
NULL
,
buffer
,
&
psa
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
startup
,
&
info
),
"CreateProcess with err:%d
\n
"
,
GetLastError
());
TEST_GRANTED_ACCESS
(
info
.
hProcess
,
PROCESS_ALL_ACCESS
);
ok
(
WaitForSingleObject
(
info
.
hProcess
,
30000
)
==
WAIT_OBJECT_0
,
"Child process termination
\n
"
);
winetest_wait_child_process
(
info
.
hProcess
);
CloseHandle
(
info
.
hProcess
);
CloseHandle
(
info
.
hThread
);
CloseHandle
(
event
);
HeapFree
(
GetProcessHeap
(),
0
,
Acl
);
HeapFree
(
GetProcessHeap
(),
0
,
SecurityDescriptor
);
...
...
dlls/kernel32/tests/actctx.c
View file @
05c71749
...
...
@@ -1097,9 +1097,8 @@ static void run_child_process(void)
sprintf
(
cmdline
,
"
\"
%s
\"
%s manifest1"
,
argv
[
0
],
argv
[
1
]);
ok
(
CreateProcess
(
argv
[
0
],
cmdline
,
NULL
,
NULL
,
FALSE
,
0
,
NULL
,
NULL
,
&
si
,
&
pi
)
!=
0
,
"Could not create process: %u
\n
"
,
GetLastError
());
winetest_wait_child_process
(
pi
.
hProcess
);
CloseHandle
(
pi
.
hThread
);
WaitForSingleObject
(
pi
.
hProcess
,
INFINITE
);
CloseHandle
(
pi
.
hProcess
);
DeleteFileA
(
path
);
}
...
...
dlls/kernel32/tests/toolhelp.c
View file @
05c71749
...
...
@@ -342,8 +342,5 @@ START_TEST(toolhelp)
test_module
(
info
.
dwProcessId
,
sub_expected_modules
,
NUM_OF
(
sub_expected_modules
));
SetEvent
(
ev2
);
w
=
WaitForSingleObject
(
info
.
hProcess
,
WAIT_TIME
);
ok
(
w
==
WAIT_OBJECT_0
,
"Failed to wait on sub-process termination
\n
"
);
ok
(
GetExitCodeProcess
(
info
.
hProcess
,
&
w
),
"couldn't get process exit code
\n
"
);
ok
(
w
==
WAIT_OBJECT_0
,
"Sub-Process failed to terminate properly
\n
"
);
winetest_wait_child_process
(
info
.
hProcess
);
}
dlls/ntdll/tests/exception.c
View file @
05c71749
...
...
@@ -619,7 +619,7 @@ static void test_debugger(void)
if
(
de
.
u
.
CreateProcessInfo
.
lpBaseOfImage
!=
pNtCurrentTeb
()
->
Peb
->
ImageBaseAddress
)
{
skip
(
"child process loaded at different address, terminating it
\n
"
);
pNtTerminateProcess
(
pi
.
hProcess
,
1
);
pNtTerminateProcess
(
pi
.
hProcess
,
0
);
}
}
else
if
(
de
.
dwDebugEventCode
==
EXCEPTION_DEBUG_EVENT
)
...
...
@@ -710,6 +710,7 @@ static void test_debugger(void)
}
while
(
de
.
dwDebugEventCode
!=
EXIT_PROCESS_DEBUG_EVENT
);
winetest_wait_child_process
(
pi
.
hProcess
);
ok
(
CloseHandle
(
pi
.
hThread
)
!=
0
,
"error %u
\n
"
,
GetLastError
());
ok
(
CloseHandle
(
pi
.
hProcess
)
!=
0
,
"error %u
\n
"
,
GetLastError
());
...
...
dlls/ole32/tests/marshal.c
View file @
05c71749
...
...
@@ -2575,7 +2575,7 @@ static void test_local_server(void)
quit_event
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
"Wine COM Test Quit Event"
);
SetEvent
(
quit_event
);
WaitForSingleObject
(
process
,
INFINITE
);
winetest_wait_child_process
(
process
);
CloseHandle
(
quit_event
);
CloseHandle
(
process
);
}
...
...
dlls/rpcrt4/tests/server.c
View file @
05c71749
...
...
@@ -634,25 +634,21 @@ make_cmdline(char buffer[MAX_PATH], const char *test)
sprintf
(
buffer
,
"%s server %s"
,
progname
,
test
);
}
static
int
static
void
run_client
(
const
char
*
test
)
{
char
cmdline
[
MAX_PATH
];
PROCESS_INFORMATION
info
;
STARTUPINFOA
startup
;
DWORD
exitcode
;
memset
(
&
startup
,
0
,
sizeof
startup
);
startup
.
cb
=
sizeof
startup
;
make_cmdline
(
cmdline
,
test
);
ok
(
CreateProcessA
(
NULL
,
cmdline
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
),
"CreateProcess
\n
"
);
ok
(
WaitForSingleObject
(
info
.
hProcess
,
30000
)
==
WAIT_OBJECT_0
,
"Child process termination
\n
"
);
ok
(
GetExitCodeProcess
(
info
.
hProcess
,
&
exitcode
),
"GetExitCodeProcess
\n
"
);
winetest_wait_child_process
(
info
.
hProcess
);
ok
(
CloseHandle
(
info
.
hProcess
),
"CloseHandle
\n
"
);
ok
(
CloseHandle
(
info
.
hThread
),
"CloseHandle
\n
"
);
return
exitcode
==
0
;
}
static
void
...
...
@@ -1208,10 +1204,10 @@ server(void)
stop_event
=
CreateEvent
(
NULL
,
FALSE
,
FALSE
,
NULL
);
ok
(
stop_event
!=
NULL
,
"CreateEvent failed
\n
"
);
ok
(
run_client
(
"tcp_basic"
),
"tcp_basic client test failed
\n
"
);
run_client
(
"tcp_basic
"
);
ok
(
RPC_S_OK
==
RpcServerUseProtseqEp
(
np
,
0
,
pipe
,
NULL
),
"RpcServerUseProtseqEp
\n
"
);
ok
(
run_client
(
"np_basic"
),
"np_basic client test failed
\n
"
);
run_client
(
"np_basic
"
);
ok
(
WAIT_OBJECT_0
==
WaitForSingleObject
(
stop_event
,
60000
),
"WaitForSingleObject
\n
"
);
todo_wine
{
...
...
dlls/shell32/tests/shellpath.c
View file @
05c71749
...
...
@@ -864,8 +864,7 @@ static void testNonExistentPath(void)
startup
.
dwFlags
=
SW_SHOWNORMAL
;
CreateProcessA
(
NULL
,
buffer
,
NULL
,
NULL
,
FALSE
,
0L
,
NULL
,
NULL
,
&
startup
,
&
info
);
ok
(
WaitForSingleObject
(
info
.
hProcess
,
30000
)
==
WAIT_OBJECT_0
,
"child process termination
\n
"
);
winetest_wait_child_process
(
info
.
hProcess
);
/* Query the path to be able to delete it below */
hr
=
pSHGetFolderPathA
(
NULL
,
CSIDL_FAVORITES
,
NULL
,
...
...
dlls/user32/tests/cursoricon.c
View file @
05c71749
...
...
@@ -167,16 +167,8 @@ static void do_parent(void)
static
void
finish_child_process
(
void
)
{
DWORD
exit_code
;
BOOL
ret
;
SendMessage
(
child
,
WM_CLOSE
,
0
,
0
);
ok
(
WaitForSingleObject
(
child_process
,
30000
)
==
WAIT_OBJECT_0
,
"Child process termination failed.
\n
"
);
ret
=
GetExitCodeProcess
(
child_process
,
&
exit_code
);
ok
(
ret
,
"GetExitCodeProcess() failed. Error: %u
\n
"
,
GetLastError
());
ok
(
exit_code
==
0
,
"Exit code == %u.
\n
"
,
exit_code
);
winetest_wait_child_process
(
child_process
);
CloseHandle
(
child_process
);
}
...
...
include/wine/test.h
View file @
05c71749
...
...
@@ -57,6 +57,7 @@ extern void winetest_start_todo( const char* platform );
extern
int
winetest_loop_todo
(
void
);
extern
void
winetest_end_todo
(
const
char
*
platform
);
extern
int
winetest_get_mainargs
(
char
***
pargv
);
extern
void
winetest_wait_child_process
(
HANDLE
process
);
#ifdef STANDALONE
#define START_TEST(name) \
...
...
@@ -340,6 +341,23 @@ int winetest_get_mainargs( char*** pargv )
return
winetest_argc
;
}
void
winetest_wait_child_process
(
HANDLE
process
)
{
DWORD
exit_code
=
1
;
if
(
WaitForSingleObject
(
process
,
30000
))
fprintf
(
stdout
,
"%s: child process wait failed
\n
"
,
current_test
->
name
);
else
GetExitCodeProcess
(
process
,
&
exit_code
);
if
(
exit_code
)
{
fprintf
(
stdout
,
"%s: %u failures in child process
\n
"
,
current_test
->
name
,
exit_code
);
InterlockedExchangeAdd
(
&
failures
,
exit_code
);
}
}
/* Find a test by name */
static
const
struct
test
*
find_test
(
const
char
*
name
)
{
...
...
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