dinput8/tests: Add some HID joystick IDirectInputDevice8_SetCooperativeLevel tests.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com> Signed-off-by: Alexandre Julliard <julliard@winehq.org>
This commit is contained in:
parent
7da842a738
commit
2975ad8134
|
@ -3409,6 +3409,7 @@ static void test_simple_joystick(void)
|
||||||
HRESULT hr;
|
HRESULT hr;
|
||||||
WCHAR *tmp;
|
WCHAR *tmp;
|
||||||
ULONG ref;
|
ULONG ref;
|
||||||
|
HWND hwnd;
|
||||||
|
|
||||||
GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd );
|
GetCurrentDirectoryW( ARRAY_SIZE(cwd), cwd );
|
||||||
GetTempPathW( ARRAY_SIZE(tempdir), tempdir );
|
GetTempPathW( ARRAY_SIZE(tempdir), tempdir );
|
||||||
|
@ -3700,6 +3701,31 @@ static void test_simple_joystick(void)
|
||||||
hr = IDirectInputDevice8_SetEventNotification( device, event );
|
hr = IDirectInputDevice8_SetEventNotification( device, event );
|
||||||
ok( hr == DI_OK, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr );
|
ok( hr == DI_OK, "IDirectInputDevice8_SetEventNotification returned: %#x\n", hr );
|
||||||
|
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, 0 );
|
||||||
|
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND );
|
||||||
|
ok( hr == DIERR_INVALIDPARAM, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE );
|
||||||
|
ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_EXCLUSIVE );
|
||||||
|
ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_FOREGROUND | DISCL_EXCLUSIVE );
|
||||||
|
ok( hr == E_HANDLE, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
|
||||||
|
hwnd = CreateWindowW( L"static", L"dinput", WS_OVERLAPPEDWINDOW | WS_VISIBLE, 10, 10, 200, 200,
|
||||||
|
NULL, NULL, NULL, NULL );
|
||||||
|
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_NONEXCLUSIVE );
|
||||||
|
ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_BACKGROUND | DISCL_EXCLUSIVE );
|
||||||
|
ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, hwnd, DISCL_FOREGROUND | DISCL_EXCLUSIVE );
|
||||||
|
ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
DestroyWindow( hwnd );
|
||||||
|
|
||||||
|
hr = IDirectInputDevice8_SetCooperativeLevel( device, NULL, DISCL_BACKGROUND | DISCL_NONEXCLUSIVE );
|
||||||
|
ok( hr == DI_OK, "IDirectInputDevice8_SetCooperativeLevel returned: %#x\n", hr );
|
||||||
|
|
||||||
ref = IDirectInputDevice8_Release( device );
|
ref = IDirectInputDevice8_Release( device );
|
||||||
ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
|
ok( ref == 0, "IDirectInputDeviceW_Release returned %d\n", ref );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue