richedit: Added tests for EM_POSFROMCHAR for pos around end of text.
This commit is contained in:
parent
4c3d27dfee
commit
31951a099d
|
@ -529,6 +529,7 @@ static void test_EM_POSFROMCHAR(void)
|
||||||
LRESULT result;
|
LRESULT result;
|
||||||
unsigned int height = 0;
|
unsigned int height = 0;
|
||||||
int xpos = 0;
|
int xpos = 0;
|
||||||
|
POINTL pt;
|
||||||
static const char text[] = "aa\n"
|
static const char text[] = "aa\n"
|
||||||
"this is a long line of text that should be longer than the "
|
"this is a long line of text that should be longer than the "
|
||||||
"control's width\n"
|
"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",
|
"EM_POSFROMCHAR reports x=%hd, expected value less than %d\n",
|
||||||
(signed short)(LOWORD(result)), xpos);
|
(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);
|
DestroyWindow(hwndRichEdit);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue