From 9ac7f205141bba9836d0f1f4afa4627078efb294 Mon Sep 17 00:00:00 2001 From: Alexandre Julliard Date: Mon, 3 Mar 2008 17:51:42 +0100 Subject: [PATCH] user32/tests: Skip tests instead of crashing if global hook cannot be set. --- dlls/user32/tests/msg.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c index 575d5d0f7fa..feb5d77a727 100644 --- a/dlls/user32/tests/msg.c +++ b/dlls/user32/tests/msg.c @@ -7239,7 +7239,12 @@ static void test_winevents(void) /****** start of global hook test *************/ hCBT_global_hook = SetWindowsHookExA(WH_CBT, cbt_global_hook_proc, GetModuleHandleA(0), 0); - assert(hCBT_global_hook); + if (!hCBT_global_hook) + { + ok(DestroyWindow(hwnd), "failed to destroy window\n"); + skip( "cannot set global hook\n" ); + return; + } hevent = CreateEventA(NULL, 0, 0, NULL); assert(hevent);