Greg Geldorp : dinput/tests: Skip acquire tests when not running in the foreground.

Alexandre Julliard julliard at winehq.org
Thu Jan 6 12:33:55 CST 2011


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

Author: Greg Geldorp <ggeldorp at vmware.com>
Date:   Thu Jan  6 13:10:27 2011 +0100

dinput/tests: Skip acquire tests when not running in the foreground.

If our window isn't the foreground window, we'll never be able to
successfully Acquire with SetCooperativeLevel DISCL_FOREGROUND in effect.

---

 dlls/dinput/tests/mouse.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c
index 09b2b27..25a9a5e 100644
--- a/dlls/dinput/tests/mouse.c
+++ b/dlls/dinput/tests/mouse.c
@@ -73,6 +73,12 @@ static void test_acquire(LPDIRECTINPUT pDI, HWND hwnd)
     DIMOUSESTATE m_state;
     HWND hwnd2;
 
+    if (! SetForegroundWindow(hwnd))
+    {
+        skip("Not running as foreground app, skipping acquire tests\n");
+        return;
+    }
+
     hr = IDirectInput_CreateDevice(pDI, &GUID_SysMouse, &pMouse, NULL);
     ok(SUCCEEDED(hr), "IDirectInput_CreateDevice() failed: %08x\n", hr);
     if (FAILED(hr)) return;




More information about the wine-cvs mailing list