From: Jacob Czekalla jczekalla@codeweavers.com
--- dlls/user32/tests/edit.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+)
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index bbde9b16616..6a769368fe9 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -3426,6 +3426,42 @@ static void test_dbcs_WM_CHAR(void) } }
+struct state_tests +{ + int style; + int style_ex; + RECT input; +}; + +static void test_small_rect(void) +{ + struct state_tests tests[6]; + HWND edit; + RECT correct; + RECT rc; + + tests[0] = (struct state_tests){ES_MULTILINE | WS_VISIBLE, 0, {0, 0, 0, 0}}; + tests[1] = (struct state_tests){ES_MULTILINE | WS_VISIBLE, 0, {0, 0, 10, 10}}; + tests[2] = (struct state_tests){ES_MULTILINE | WS_VISIBLE, 0, {1, 1, 10, 10}}; + tests[3] = (struct state_tests){ES_MULTILINE | WS_VISIBLE, WS_EX_CLIENTEDGE, {0, 0, 0, 0}}; + tests[4] = (struct state_tests){ES_MULTILINE | WS_VISIBLE, WS_EX_CLIENTEDGE, {0, 0, 10, 10}}; + tests[5] = (struct state_tests){ES_MULTILINE | WS_VISIBLE, WS_EX_CLIENTEDGE, {1, 1, 10, 10}}; + + for (int i = 0; i < ARRAY_SIZE(tests); i++) + { + edit = create_editcontrol(tests[i].style, tests[i].style_ex); + SendMessageA(edit, EM_GETRECT, 0, (LPARAM)&correct); + SetWindowTextA(edit, "Test Test Test\r\n\r\nTest Test Test Test Test Test Test Test Test Test Test Test\r\n\r\nTest Test Test"); + SendMessageA(edit, EM_SETRECT, 0, (LPARAM)&tests[i].input); + SendMessageA(edit, EM_GETRECT, 0, (LPARAM)&rc); + todo_wine ok(rc.left == correct.left, "left(%d): Expected %ld, got %ld\n", i, correct.left, rc.left); + todo_wine ok(rc.top == correct.top, "top(%d): Expected %ld, got %ld\n", i, correct.top, rc.top); + todo_wine ok(rc.right == correct.right, "right(%d): Expected %ld, got %ld\n", i, correct.right, rc.right); + todo_wine ok(rc.bottom == correct.bottom, "bottom(%d): Expected %ld, got %ld\n", i, correct.bottom, rc.bottom); + DestroyWindow(edit); + } +} + START_TEST(edit) { BOOL b; @@ -3464,6 +3500,7 @@ START_TEST(edit) test_EM_GETLINE(); test_wordbreak_proc(); test_dbcs_WM_CHAR(); + test_small_rect();
UnregisterWindowClasses(); }