mirror of
https://github.com/reactos/reactos.git
synced 2025-01-04 05:20:54 +00:00
[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:
parent
02995bf1a1
commit
487818ab87
4 changed files with 43 additions and 2 deletions
|
@ -19,6 +19,7 @@ list(APPEND SOURCE
|
|||
RealGetWindowClass.c
|
||||
ScrollDC.c
|
||||
ScrollWindowEx.c
|
||||
SendMessageTimeout.c
|
||||
SetActiveWindow.c
|
||||
SetCursorPos.c
|
||||
SystemParametersInfo.c
|
||||
|
|
40
rostests/apitests/user32/SendMessageTimeout.c
Normal file
40
rostests/apitests/user32/SendMessageTimeout.c
Normal 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);
|
||||
}
|
|
@ -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");
|
||||
|
|
|
@ -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 },
|
||||
|
|
Loading…
Reference in a new issue