Commit 30049ba7 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

riched20/tests: Test EM_GETSELTEXT with multibyte character.

parent 4871b023
...@@ -1571,15 +1571,27 @@ static void test_EM_GETSELTEXT(void) ...@@ -1571,15 +1571,27 @@ static void test_EM_GETSELTEXT(void)
SendMessageA(hwndRichEdit, EM_SETSEL, 4, 11); SendMessageA(hwndRichEdit, EM_SETSEL, 4, 11);
result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result); ok(result == 7, "EM_GETSELTEXT returned %ld\n", result);
ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); ok(!strcmp(expect, buffer), "EM_GETSELTEXT filled %s\n", buffer);
SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2); SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2);
SendMessageA(hwndRichEdit, EM_SETSEL, 4, 11); SendMessageA(hwndRichEdit, EM_SETSEL, 4, 11);
result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result); ok(result == 7, "EM_GETSELTEXT returned %ld\n", result);
ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); ok(!strcmp(expect, buffer), "EM_GETSELTEXT filled %s\n", buffer);
/* Test with multibyte character */
if (!is_lang_japanese)
skip("Skip multibyte character tests on non-Japanese platform\n");
else
{
SendMessageA(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"abcdef\x8e\xf0ghijk");
SendMessageA(hwndRichEdit, EM_SETSEL, 4, 8);
result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
todo_wine ok(result == 5, "EM_GETSELTEXT returned %ld\n", result);
todo_wine ok(!strcmp("ef\x8e\xf0g", buffer), "EM_GETSELTEXT filled %s\n", buffer);
}
DestroyWindow(hwndRichEdit); DestroyWindow(hwndRichEdit);
} }
......
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