From 62670dc39e00fd7855e26d46771fa6d10104c690 Mon Sep 17 00:00:00 2001 From: Greg Geldorp Date: Thu, 6 Jan 2011 13:10:27 +0100 Subject: [PATCH] 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 file changed, 6 insertions(+) diff --git a/dlls/dinput/tests/mouse.c b/dlls/dinput/tests/mouse.c index 09b2b275cd5..25a9a5e85d1 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;