Module: wine Branch: master Commit: 71eac4a70b56ce5a8b20a0e10bacc7dcf7638627 URL: http://source.winehq.org/git/wine.git/?a=commit;h=71eac4a70b56ce5a8b20a0e10b...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon Dec 4 21:31:35 2017 +0300
user32/tests: Added some tests for WM_GETTEXTLENGTH/WM_GETTEXT after EM_GETHANDLE was used.
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/user32/tests/edit.c | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+)
diff --git a/dlls/user32/tests/edit.c b/dlls/user32/tests/edit.c index 0926a58..783ced6 100644 --- a/dlls/user32/tests/edit.c +++ b/dlls/user32/tests/edit.c @@ -2735,6 +2735,7 @@ static void test_EM_GETHANDLE(void) { static const char str0[] = "untouched"; static const char str1[] = "1111+1111+1111#"; + static const char str1_1[] = "2111+1111+1111#"; static const char str2[] = "2222-2222-2222-2222#"; static const char str3[] = "3333*3333*3333*3333*3333#"; CHAR current[42]; @@ -2783,6 +2784,33 @@ static void test_EM_GETHANDLE(void) "got %d and "%s" (expected %d and "%s")\n", len, buffer, lstrlenA(str1), str1); LocalUnlock(hmem);
+ /* See if WM_GETTEXTLENGTH/WM_GETTEXT still work. */ + len = SendMessageA(hEdit, WM_GETTEXTLENGTH, 0, 0); +todo_wine + ok(len == lstrlenA(str1), "Unexpected text length %d.\n", len); + + lstrcpyA(current, str0); + r = SendMessageA(hEdit, WM_GETTEXT, sizeof(current), (LPARAM)current); +todo_wine + ok((r == lstrlenA(str1)) && !lstrcmpA(current, str1), + "Unexpected retval %d and text "%s" (expected %d and "%s")\n", r, current, lstrlenA(str1), str1); + + /* Application altered buffer contents, see if WM_GETTEXTLENGTH/WM_GETTEXT pick that up. */ + buffer = LocalLock(hmem); + ok(buffer != NULL, "got %p (expected != NULL)\n", buffer); + buffer[0] = '2'; + LocalUnlock(hmem); + + len = SendMessageA(hEdit, WM_GETTEXTLENGTH, 0, 0); +todo_wine + ok(len == lstrlenA(str1), "Unexpected text length %d.\n", len); + + lstrcpyA(current, str0); + r = SendMessageA(hEdit, WM_GETTEXT, sizeof(current), (LPARAM)current); +todo_wine + ok((r == lstrlenA(str1_1)) && !lstrcmpA(current, str1_1), + "Unexpected retval %d and text "%s" (expected %d and "%s")\n", r, current, lstrlenA(str1_1), str1_1); + /* use LocalAlloc first to get a different handle */ halloc = LocalAlloc(LMEM_MOVEABLE, 42); ok(halloc != NULL, "got %p (expected != NULL)\n", halloc);