Commit 22263587 authored by Jactry Zeng's avatar Jactry Zeng Committed by Alexandre Julliard

riched32/tests: Test EM_GETSELTEXT with multibyte character.

parent 30049ba7
...@@ -596,17 +596,27 @@ static void test_EM_GETSELTEXT(void) ...@@ -596,17 +596,27 @@ static void test_EM_GETSELTEXT(void)
SendMessageA(hwndRichEdit, EM_SETSEL, 4, 12); SendMessageA(hwndRichEdit, EM_SETSEL, 4, 12);
result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer); result = SendMessageA(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 8, "EM_GETTEXTRANGE returned %ld\n", result); ok(result == 8, "EM_GETSELTEXT returned %ld\n", result);
ok(!strcmp(expect1, buffer), "EM_GETTEXTRANGE filled %s\n", buffer); ok(!strcmp(expect1, 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(expect2, buffer), "EM_GETSELTEXT filled %s\n", buffer);
ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE 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);
ok(result == 4, "EM_GETSELTEXT returned %ld\n", result);
todo_wine ok(!strcmp("ef\x8e\xf0", 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