Jacek Caban : kernel32/tests: Improve timeout handling in debugger tests.
Alexandre Julliard
julliard at winehq.org
Tue Aug 6 17:41:59 CDT 2019
Module: wine
Branch: master
Commit: 6b46a4d24aa6030724a74ec5e21f7299af416ec7
URL: https://source.winehq.org/git/wine.git/?a=commit;h=6b46a4d24aa6030724a74ec5e21f7299af416ec7
Author: Jacek Caban <jacek at codeweavers.com>
Date: Tue Aug 6 15:05:17 2019 +0200
kernel32/tests: Improve timeout handling in debugger tests.
Signed-off-by: Jacek Caban <jacek at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/kernel32/tests/debugger.c | 13 ++++++++-----
1 file changed, 8 insertions(+), 5 deletions(-)
diff --git a/dlls/kernel32/tests/debugger.c b/dlls/kernel32/tests/debugger.c
index bc12ea8..7594b25 100644
--- a/dlls/kernel32/tests/debugger.c
+++ b/dlls/kernel32/tests/debugger.c
@@ -226,6 +226,9 @@ struct debugger_context
void *image_base;
};
+#define WAIT_EVENT_TIMEOUT 20000
+#define POLL_EVENT_TIMEOUT 200
+
#define next_event(a,b) next_event_(__LINE__,a,b)
static void next_event_(unsigned line, struct debugger_context *ctx, unsigned timeout)
{
@@ -301,7 +304,7 @@ static void process_attach_events(struct debugger_context *ctx)
do
{
- next_event(ctx, 2000);
+ next_event(ctx, WAIT_EVENT_TIMEOUT);
if (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT)
ok(ctx->ev.u.LoadDll.lpBaseOfDll != ntdll, "ntdll.dll reported out of order\n");
} while (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT || ctx->ev.dwDebugEventCode == UNLOAD_DLL_DEBUG_EVENT);
@@ -312,7 +315,7 @@ static void process_attach_events(struct debugger_context *ctx)
if (ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT)
{
DWORD last_thread = ctx->ev.dwThreadId;
- next_event(ctx, 2000);
+ next_event(ctx, WAIT_EVENT_TIMEOUT);
ok(ctx->ev.dwThreadId == last_thread, "unexpected thread\n");
}
@@ -322,7 +325,7 @@ static void process_attach_events(struct debugger_context *ctx)
ok(ctx->ev.u.Exception.ExceptionRecord.ExceptionAddress == pDbgBreakPoint, "ExceptionAddres != DbgBreakPoint\n");
/* flush debug events */
- do next_event(ctx, 200);
+ do next_event(ctx, POLL_EVENT_TIMEOUT);
while (ctx->ev.dwDebugEventCode == LOAD_DLL_DEBUG_EVENT || ctx->ev.dwDebugEventCode == UNLOAD_DLL_DEBUG_EVENT
|| ctx->ev.dwDebugEventCode == CREATE_THREAD_DEBUG_EVENT || ctx->ev.dwDebugEventCode == EXIT_THREAD_DEBUG_EVENT);
ok(ctx->ev.dwDebugEventCode == -1, "dwDebugEventCode = %d\n", ctx->ev.dwDebugEventCode);
@@ -370,7 +373,7 @@ static void doDebugger(int argc, char** argv)
if (strstr(myARGV[2], "process"))
{
- next_event(&ctx, 2000);
+ next_event(&ctx, WAIT_EVENT_TIMEOUT);
ok(ctx.ev.dwDebugEventCode == EXCEPTION_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode);
ok(ctx.ev.u.Exception.ExceptionRecord.ExceptionCode == STATUS_ACCESS_VIOLATION, "ExceptionCode = %x\n",
ctx.ev.u.Exception.ExceptionRecord.ExceptionCode);
@@ -958,7 +961,7 @@ static void test_debug_children(char *name, DWORD flag, BOOL debug_child)
if (flag)
{
- next_event(&ctx, 2000);
+ next_event(&ctx, WAIT_EVENT_TIMEOUT);
ok(ctx.ev.dwDebugEventCode == CREATE_PROCESS_DEBUG_EVENT, "dwDebugEventCode = %d\n", ctx.ev.dwDebugEventCode);
ok(ctx.pid == pi.dwProcessId, "unexpected dwProcessId %x\n", ctx.ev.dwProcessId == ctx.pid);
More information about the wine-cvs
mailing list