richedit: Added tests for EM_POSFROMCHAR for pos around end of text.

This commit is contained in:
Dylan Smith 2008-10-22 02:22:20 -04:00 committed by Alexandre Julliard
parent 4c3d27dfee
commit 31951a099d
1 changed files with 17 additions and 0 deletions

View File

@ -529,6 +529,7 @@ static void test_EM_POSFROMCHAR(void)
LRESULT result;
unsigned int height = 0;
int xpos = 0;
POINTL pt;
static const char text[] = "aa\n"
"this is a long line of text that should be longer than the "
"control's width\n"
@ -636,6 +637,22 @@ static void test_EM_POSFROMCHAR(void)
"EM_POSFROMCHAR reports x=%hd, expected value less than %d\n",
(signed short)(LOWORD(result)), xpos);
}
SendMessage(hwndRichEdit, WM_HSCROLL, SB_LINELEFT, 0);
/* Test around end of text that doesn't end in a newline. */
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) "12345678901234");
SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt,
SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)-1);
ok(pt.x > 1, "pt.x = %d\n", pt.x);
xpos = pt.x;
SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt,
SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0));
todo_wine ok(pt.x > xpos, "pt.x = %d\n", pt.x);
xpos = pt.x;
SendMessage(hwndRichEdit, EM_POSFROMCHAR, (WPARAM)&pt,
SendMessage(hwndRichEdit, WM_GETTEXTLENGTH, 0, 0)+1);
ok(pt.x == xpos, "pt.x = %d\n", pt.x);
DestroyWindow(hwndRichEdit);
}