Commit 71eac4a7 authored by Nikolay Sivov's avatar Nikolay Sivov Committed by Alexandre Julliard

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

parent 89d038e1
...@@ -2735,6 +2735,7 @@ static void test_EM_GETHANDLE(void) ...@@ -2735,6 +2735,7 @@ static void test_EM_GETHANDLE(void)
{ {
static const char str0[] = "untouched"; static const char str0[] = "untouched";
static const char str1[] = "1111+1111+1111#"; 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 str2[] = "2222-2222-2222-2222#";
static const char str3[] = "3333*3333*3333*3333*3333#"; static const char str3[] = "3333*3333*3333*3333*3333#";
CHAR current[42]; CHAR current[42];
...@@ -2783,6 +2784,33 @@ static void test_EM_GETHANDLE(void) ...@@ -2783,6 +2784,33 @@ static void test_EM_GETHANDLE(void)
"got %d and \"%s\" (expected %d and \"%s\")\n", len, buffer, lstrlenA(str1), str1); "got %d and \"%s\" (expected %d and \"%s\")\n", len, buffer, lstrlenA(str1), str1);
LocalUnlock(hmem); 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 */ /* use LocalAlloc first to get a different handle */
halloc = LocalAlloc(LMEM_MOVEABLE, 42); halloc = LocalAlloc(LMEM_MOVEABLE, 42);
ok(halloc != NULL, "got %p (expected != NULL)\n", halloc); ok(halloc != NULL, "got %p (expected != NULL)\n", halloc);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment