[USER32_APITEST]

- Add a test for SendMessageTimeout failure case
- Remove a pointless (and broken) memset (Coverity)
CORE-8699

svn path=/trunk/; revision=64948
This commit is contained in:
Thomas Faber 2014-10-24 09:16:04 +00:00
parent 02995bf1a1
commit 487818ab87
4 changed files with 43 additions and 2 deletions

View file

@ -19,6 +19,7 @@ list(APPEND SOURCE
RealGetWindowClass.c
ScrollDC.c
ScrollWindowEx.c
SendMessageTimeout.c
SetActiveWindow.c
SetCursorPos.c
SystemParametersInfo.c

View file

@ -0,0 +1,40 @@
/*
* PROJECT: ReactOS API tests
* LICENSE: LGPLv2.1+ - See COPYING.LIB in the top level directory
* PURPOSE: Test for SendMessageTimeout
* PROGRAMMERS: Thomas Faber <thomas.faber@reactos.org>
*/
#include <apitest.h>
#include <winuser.h>
static
void
TestSendMessageTimeout(HWND hWnd, UINT Msg)
{
LRESULT ret;
DWORD_PTR result;
ret = SendMessageTimeoutW(hWnd, Msg, 0, 0, SMTO_NORMAL, 0, NULL);
ok(ret == 0, "ret = %Id\n", ret);
result = 0x55555555;
ret = SendMessageTimeoutW(hWnd, Msg, 0, 0, SMTO_NORMAL, 0, &result);
ok(ret == 0, "ret = %Id\n", ret);
ok(result == 0, "result = %Iu\n", result);
ret = SendMessageTimeoutA(hWnd, Msg, 0, 0, SMTO_NORMAL, 0, NULL);
ok(ret == 0, "ret = %Id\n", ret);
result = 0x55555555;
ret = SendMessageTimeoutA(hWnd, Msg, 0, 0, SMTO_NORMAL, 0, &result);
ok(ret == 0, "ret = %Id\n", ret);
ok(result == 0, "result = %Iu\n", result);
}
START_TEST(SendMessageTimeout)
{
TestSendMessageTimeout(NULL, WM_USER);
TestSendMessageTimeout(NULL, WM_PAINT);
TestSendMessageTimeout(NULL, WM_GETICON);
}

View file

@ -95,8 +95,6 @@ void Test_SetCursorPos()
MSG msg;
int i;
memset(results, sizeof(results), 0);
hMouseHookLL = SetWindowsHookEx(WH_MOUSE_LL, MouseLLHookProc, GetModuleHandleA( NULL ), 0);
hMouseHook = SetWindowsHookExW(WH_MOUSE, MouseHookProc, GetModuleHandleW( NULL ), GetCurrentThreadId());
ok(hMouseHook!=NULL,"failed to set hook\n");

View file

@ -21,6 +21,7 @@ extern void func_LookupIconIdFromDirectoryEx(void);
extern void func_RealGetWindowClass(void);
extern void func_ScrollDC(void);
extern void func_ScrollWindowEx(void);
extern void func_SendMessageTimeout(void);
extern void func_SetActiveWindow(void);
extern void func_SetCursorPos(void);
extern void func_SystemParametersInfo(void);
@ -48,6 +49,7 @@ const struct test winetest_testlist[] =
{ "RealGetWindowClass", func_RealGetWindowClass },
{ "ScrollDC", func_ScrollDC },
{ "ScrollWindowEx", func_ScrollWindowEx },
{ "SendMessageTimeout", func_SendMessageTimeout },
{ "SetActiveWindow", func_SetActiveWindow },
{ "SetCursorPos", func_SetCursorPos },
{ "SystemParametersInfo", func_SystemParametersInfo },