[ros-diffs] [gadamopoulos] 55347: [user32_apitest] - Add a couple of tests for SPI_SETMOUSESPEED and SPI_GETMOUSESPEED - inspired by bug 905

gadamopoulos at svn.reactos.org gadamopoulos at svn.reactos.org
Tue Jan 31 09:58:05 UTC 2012


Author: gadamopoulos
Date: Tue Jan 31 09:58:05 2012
New Revision: 55347

URL: http://svn.reactos.org/svn/reactos?rev=55347&view=rev
Log:
[user32_apitest]
- Add a couple of tests for SPI_SETMOUSESPEED and SPI_GETMOUSESPEED
- inspired by bug 905

Modified:
    trunk/rostests/apitests/user32/SystemParametersInfo.c

Modified: trunk/rostests/apitests/user32/SystemParametersInfo.c
URL: http://svn.reactos.org/svn/reactos/trunk/rostests/apitests/user32/SystemParametersInfo.c?rev=55347&r1=55346&r2=55347&view=diff
==============================================================================
--- trunk/rostests/apitests/user32/SystemParametersInfo.c [iso-8859-1] (original)
+++ trunk/rostests/apitests/user32/SystemParametersInfo.c [iso-8859-1] Tue Jan 31 09:58:05 2012
@@ -134,6 +134,26 @@
     COMPARE_CACHE(CaptionHeight_chain);
 }
 
+static void Test_MouseSpeed()
+{
+    ULONG ulMouseSpeed, temp;
+    BOOL ret;
+
+    ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &ulMouseSpeed, 0);
+    ok(ret, "SystemParametersInfo failed\n");
+    ok(ulMouseSpeed >= 1 && ulMouseSpeed <=20, "Wrong mouse speed (%d)\n", (int)ulMouseSpeed);
+
+    temp = 1;
+    ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)temp, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+    ok(ret, "SystemParametersInfo failed\n");
+    ret = SystemParametersInfo(SPI_GETMOUSESPEED, 0, &temp, 0);
+    ok(ret, "SystemParametersInfo failed\n");
+    ok(temp == 1, "SPI_GETMOUSESPEED did not get value set by SPI_SETMOUSESPEED (%d instead of 1)\n", (int)temp);
+
+    ret = SystemParametersInfo(SPI_SETMOUSESPEED, 0, (PVOID)ulMouseSpeed, SPIF_SENDCHANGE | SPIF_UPDATEINIFILE);
+    ok(ret, "SystemParametersInfo failed\n");
+}
+
 START_TEST(SystemParametersInfo)
 {
     RegisterSimpleClass(SysParamsTestProc, L"sysparamstest"); 
@@ -144,6 +164,7 @@
                          200, 200, 300, 300, NULL, NULL, 0, NULL);
 
     Test_NonClientMetrics();
+    Test_MouseSpeed();
 
     DestroyWindow(hWnd1);
     DestroyWindow(hWnd2);




More information about the Ros-diffs mailing list