Alexandre Julliard : user32/tests: Skip tests instead of crashing if global hook cannot be set.

Alexandre Julliard julliard at winehq.org
Mon Mar 3 14:03:31 CST 2008


Module: wine
Branch: master
Commit: 9ac7f205141bba9836d0f1f4afa4627078efb294
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=9ac7f205141bba9836d0f1f4afa4627078efb294

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Mon Mar  3 17:51:42 2008 +0100

user32/tests: Skip tests instead of crashing if global hook cannot be set.

---

 dlls/user32/tests/msg.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/dlls/user32/tests/msg.c b/dlls/user32/tests/msg.c
index 575d5d0..feb5d77 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);




More information about the wine-cvs mailing list