From f80d8e33b227464b3ef5f960cb22760fb2f2e766 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Vincas=20Mili=C5=ABnas?= Date: Tue, 5 Jul 2011 23:16:11 +0300 Subject: [PATCH 09/20] user32/tests: Added basic GetRawInputData tests (try 16) --- dlls/user32/tests/input.c | 47 +++++++++++++++++++++++++++++++++++++++++++++ 1 files changed, 47 insertions(+), 0 deletions(-) diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c index fbfd954..180d2e4 100644 --- a/dlls/user32/tests/input.c +++ b/dlls/user32/tests/input.c @@ -78,6 +78,7 @@ static struct { static UINT (WINAPI *pSendInput) (UINT, INPUT*, size_t); static int (WINAPI *pGetMouseMovePointsEx) (UINT, LPMOUSEMOVEPOINT, LPMOUSEMOVEPOINT, int, DWORD); static UINT (WINAPI *pDefRawInputProc) (PRAWINPUT*, INT, UINT); +static INT (WINAPI *pGetRawInputData) (HRAWINPUT, UINT, LPVOID, PUINT, UINT); static UINT (WINAPI *pGetRawInputDeviceInfoA) (HANDLE, UINT, LPVOID, PUINT); static UINT (WINAPI *pGetRawInputDeviceInfoW) (HANDLE, UINT, LPVOID, PUINT); static UINT (WINAPI *pGetRawInputDeviceList) (PRAWINPUTDEVICELIST, PUINT, UINT); @@ -171,6 +172,7 @@ static void init_function_pointers(void) GET_PROC(SendInput) GET_PROC(DefRawInputProc) GET_PROC(GetMouseMovePointsEx) + GET_PROC(GetRawInputData) GET_PROC(GetRawInputDeviceInfoA) GET_PROC(GetRawInputDeviceInfoW) GET_PROC(GetRawInputDeviceList) @@ -2377,6 +2379,50 @@ static void test_extended_register_raw_input_devices(void) "expected 0, got %u\n", count); } +static void test_get_raw_input_data(void) +{ + UINT ret, count; + DWORD error; + + if (!pGetRawInputData) + { + win_skip("GetRawInputData is not available\n"); + return; + } + + SetLastError(0xdeadbeef); + ret = pGetRawInputData(NULL, 0, NULL, NULL, 0); + error = GetLastError(); + todo_wine ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " + "expected (UINT)-1, got %u\n", ret); + todo_wine ok(error == ERROR_INVALID_PARAMETER, "GetRawInputData returned " + "wrong error code: %u\n", error); + + SetLastError(0xdeadbeef); + ret = pGetRawInputData(NULL, 0, NULL, NULL, sizeof(RAWINPUTHEADER)); + error = GetLastError(); + todo_wine ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " + "expected (UINT)-1, got %u\n", ret); + todo_wine ok(error == ERROR_INVALID_HANDLE, "GetRawInputData returned " + "wrong error code: %u\n", error); + + SetLastError(0xdeadbeef); + ret = pGetRawInputData(NULL, 0, NULL, &count, 1); + error = GetLastError(); + todo_wine ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " + "expected (UINT)-1, got %u\n", ret); + todo_wine ok(error == ERROR_INVALID_PARAMETER, "GetRawInputData returned " + "wrong error code: %u\n", error); + + SetLastError(0xdeadbeef); + ret = pGetRawInputData(NULL, 0, NULL, &count, sizeof(RAWINPUTHEADER)); + error = GetLastError(); + todo_wine ok(ret == (UINT)-1, "GetRawInputData returned wrong value: " + "expected (UINT)-1, got %u\n", ret); + todo_wine ok(error == ERROR_INVALID_HANDLE, "GetRawInputData returned " + "wrong error code: %u\n", error); +} + START_TEST(input) { init_function_pointers(); @@ -2404,6 +2450,7 @@ START_TEST(input) test_basic_register_raw_input_devices(); test_raw_input_device_flag_preconditions(); test_extended_register_raw_input_devices(); + test_get_raw_input_data(); if(pGetMouseMovePointsEx) test_GetMouseMovePointsEx(); -- 1.7.3.4