Sebastian Lackner : user32/tests: Add a test for sending WM_SIZE message to edit control.

Alexandre Julliard julliard at wine.codeweavers.com
Tue Oct 6 09:44:00 CDT 2015


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

Author: Sebastian Lackner <sebastian at fds-team.de>
Date:   Tue Oct  6 03:32:07 2015 +0200

user32/tests: Add a test for sending WM_SIZE message to edit control.

Signed-off-by: Sebastian Lackner <sebastian at fds-team.de>

---

 dlls/user32/tests/edit.c | 21 +++++++++++++++++----
 1 file changed, 17 insertions(+), 4 deletions(-)

diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c
index e8b41c2..bd7b6d5 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -1476,10 +1476,23 @@ static void test_margins(void)
     SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
     SendMessageA(hwEdit, EM_SETMARGINS, EC_LEFTMARGIN | EC_RIGHTMARGIN, MAKELONG(10, 10));
     SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
-    ok(new_rect.left == old_rect.left, "The left border of the rectangle has changed\n");
-    ok(new_rect.right == old_rect.right, "The right border of the rectangle has changed\n");
-    ok(new_rect.top == old_rect.top, "The top border of the rectangle has changed\n");
-    ok(new_rect.bottom == old_rect.bottom, "The bottom border of the rectangle has changed\n");
+    ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n");
+
+    /* The lParam argument of the WM_SIZE message should be ignored. */
+
+    SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&old_rect);
+    SendMessageA(hwEdit, WM_SIZE, SIZE_RESTORED, 0);
+    SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
+    todo_wine ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n");
+    SendMessageA(hwEdit, WM_SIZE, SIZE_MINIMIZED, 0);
+    SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
+    todo_wine ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n");
+    SendMessageA(hwEdit, WM_SIZE, SIZE_MAXIMIZED, 0);
+    SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
+    todo_wine ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n");
+    SendMessageA(hwEdit, WM_SIZE, SIZE_RESTORED, MAKELONG(10, 10));
+    SendMessageA(hwEdit, EM_GETRECT, 0, (LPARAM)&new_rect);
+    todo_wine ok(EqualRect(&old_rect, &new_rect), "The border of the rectangle has changed\n");
 
     DestroyWindow (hwEdit);
 




More information about the wine-cvs mailing list