Nikolay Sivov : user32/tests: Added some tests for WM_GETTEXTLENGTH/ WM_GETTEXT after EM_GETHANDLE was used.

Alexandre Julliard julliard at winehq.org
Sun Mar 18 09:02:32 CDT 2018


Module: wine
Branch: oldstable
Commit: aa0ead79d36e032382f8c85df0750b64ba67e17a
URL:    https://source.winehq.org/git/wine.git/?a=commit;h=aa0ead79d36e032382f8c85df0750b64ba67e17a

Author: Nikolay Sivov <nsivov at 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 at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 71eac4a70b56ce5a8b20a0e10bacc7dcf7638627)
Signed-off-by: Michael Stefaniuc <mstefani at 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 b9aa1c9..d745023 100644
--- a/dlls/user32/tests/edit.c
+++ b/dlls/user32/tests/edit.c
@@ -2722,6 +2722,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];
@@ -2770,6 +2771,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);




More information about the wine-cvs mailing list