Alexandre Julliard : user32/tests: Fix a few more input test failures on Windows.

Alexandre Julliard julliard at winehq.org
Wed Feb 25 09:22:42 CST 2009


Module: wine
Branch: master
Commit: 0db3d3cd2ea05561daced42eddd297a1efd1c233
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=0db3d3cd2ea05561daced42eddd297a1efd1c233

Author: Alexandre Julliard <julliard at winehq.org>
Date:   Wed Feb 25 12:24:53 2009 +0100

user32/tests: Fix a few more input test failures on Windows.

---

 dlls/user32/input.c       |    2 +-
 dlls/user32/tests/input.c |   31 ++++++++++++++-----------------
 2 files changed, 15 insertions(+), 18 deletions(-)

diff --git a/dlls/user32/input.c b/dlls/user32/input.c
index 2b11c7d..dc0ce56 100644
--- a/dlls/user32/input.c
+++ b/dlls/user32/input.c
@@ -1168,7 +1168,7 @@ int WINAPI GetMouseMovePointsEx(UINT size, LPMOUSEMOVEPOINT ptin, LPMOUSEMOVEPOI
         return -1;
     }
 
-    if(!ptin || !ptout) {
+    if(!ptin || (!ptout && count)) {
         SetLastError(ERROR_NOACCESS);
         return -1;
     }
diff --git a/dlls/user32/tests/input.c b/dlls/user32/tests/input.c
index 889244f..e534e1c 100644
--- a/dlls/user32/tests/input.c
+++ b/dlls/user32/tests/input.c
@@ -885,7 +885,7 @@ static void test_Input_blackbox(void)
         pSendInput(1, (INPUT*)&i, sizeof(TEST_INPUT));
         empty_message_queue();
         GetKeyboardState(ks2);
-        if (!ii && !sent_messages_cnt && !memcmp( ks1, ks2, sizeof(ks1) ))
+        if (!ii && sent_messages_cnt <= 1 && !memcmp( ks1, ks2, sizeof(ks1) ))
         {
             win_skip( "window doesn't receive the queued input\n" );
             break;
@@ -913,7 +913,7 @@ static void test_keynames(void)
 
 static POINT pt_old, pt_new;
 static BOOL clipped;
-#define STEP 20
+#define STEP 3
 
 static LRESULT CALLBACK hook_proc1( int code, WPARAM wparam, LPARAM lparam )
 {
@@ -1097,11 +1097,10 @@ static void test_GetMouseMovePointsEx(void)
     SetLastError(MYERROR);
     count = 0;
     retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, NULL, count, GMMP_USE_DISPLAY_POINTS);
-    todo_wine {
-    ok(retval == count, "expected GetMouseMovePointsEx to succeed, got %d\n", retval);
-    ok(MYERROR == GetLastError(),
-       "expected error %d, got %u\n", MYERROR, GetLastError());
-    }
+    if (retval == -1)
+        ok(GetLastError() == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", GetLastError());
+    else
+        ok(retval == count, "expected GetMouseMovePointsEx to succeed, got %d\n", retval);
 
     /* test fourth parameter
      * a value higher than 64 is expected to fail with ERROR_INVALID_PARAMETER
@@ -1116,20 +1115,18 @@ static void test_GetMouseMovePointsEx(void)
     SetLastError(MYERROR);
     count = 0;
     retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS);
-    todo_wine {
-    ok(retval == count, "expected GetMouseMovePointsEx to succeed, got %d\n", retval);
-    ok(MYERROR == GetLastError(),
-       "expected error %d, got %u\n", MYERROR, GetLastError());
-    }
+    if (retval == -1)
+        ok(GetLastError() == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", GetLastError());
+    else
+        ok(retval == count, "expected GetMouseMovePointsEx to succeed, got %d\n", retval);
 
     SetLastError(MYERROR);
     count = BUFLIM;
     retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, count, GMMP_USE_DISPLAY_POINTS);
-    todo_wine {
-    ok((0 <= retval) && (retval <= count), "expected GetMouseMovePointsEx to succeed, got %d\n", retval);
-    ok(MYERROR == GetLastError(),
-       "expected error %d, got %u\n", MYERROR, GetLastError());
-    }
+    if (retval == -1)
+        ok(GetLastError() == ERROR_POINT_NOT_FOUND, "unexpected error %u\n", GetLastError());
+    else
+        ok((0 <= retval) && (retval <= count), "expected GetMouseMovePointsEx to succeed, got %d\n", retval);
 
     SetLastError(MYERROR);
     retval = pGetMouseMovePointsEx(sizeof(MOUSEMOVEPOINT), &in, out, BUFLIM+1, GMMP_USE_DISPLAY_POINTS);




More information about the wine-cvs mailing list