Author: tfaber
Date: Fri Oct 24 09:16:04 2014
New Revision: 64948
URL:
http://svn.reactos.org/svn/reactos?rev=64948&view=rev
Log:
[USER32_APITEST]
- Add a test for SendMessageTimeout failure case
- Remove a pointless (and broken) memset (Coverity)
CORE-8699
Added:
trunk/rostests/apitests/user32/SendMessageTimeout.c (with props)
Modified:
trunk/rostests/apitests/user32/CMakeLists.txt
trunk/rostests/apitests/user32/SetCursorPos.c
trunk/rostests/apitests/user32/testlist.c
Modified: trunk/rostests/apitests/user32/CMakeLists.txt
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/CMakeList…
==============================================================================
--- trunk/rostests/apitests/user32/CMakeLists.txt [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/CMakeLists.txt [iso-8859-1] Fri Oct 24 09:16:04 2014
@@ -19,6 +19,7 @@
RealGetWindowClass.c
ScrollDC.c
ScrollWindowEx.c
+ SendMessageTimeout.c
SetActiveWindow.c
SetCursorPos.c
SystemParametersInfo.c
Added: trunk/rostests/apitests/user32/SendMessageTimeout.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SendMessa…
==============================================================================
--- trunk/rostests/apitests/user32/SendMessageTimeout.c (added)
+++ trunk/rostests/apitests/user32/SendMessageTimeout.c [iso-8859-1] Fri Oct 24 09:16:04
2014
@@ -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(a)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);
+}
Propchange: trunk/rostests/apitests/user32/SendMessageTimeout.c
------------------------------------------------------------------------------
svn:eol-style = native
Modified: trunk/rostests/apitests/user32/SetCursorPos.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SetCursor…
==============================================================================
--- trunk/rostests/apitests/user32/SetCursorPos.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/SetCursorPos.c [iso-8859-1] Fri Oct 24 09:16:04 2014
@@ -95,8 +95,6 @@
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");
Modified: trunk/rostests/apitests/user32/testlist.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/testlist.…
==============================================================================
--- trunk/rostests/apitests/user32/testlist.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/testlist.c [iso-8859-1] Fri Oct 24 09:16:04 2014
@@ -21,6 +21,7 @@
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 @@
{ "RealGetWindowClass", func_RealGetWindowClass },
{ "ScrollDC", func_ScrollDC },
{ "ScrollWindowEx", func_ScrollWindowEx },
+ { "SendMessageTimeout", func_SendMessageTimeout },
{ "SetActiveWindow", func_SetActiveWindow },
{ "SetCursorPos", func_SetCursorPos },
{ "SystemParametersInfo", func_SystemParametersInfo },