Dylan Smith : richedit: Added tests for EM_POSFROMCHAR for pos around end of text.
Alexandre Julliard
julliard at winehq.org
Wed Oct 22 08:00:30 CDT 2008
Module: wine
Branch: master
Commit: 31951a099da7adc494a931ba29633dca8a97a144
URL: http://source.winehq.org/git/wine.git/?a=commit;h=31951a099da7adc494a931ba29633dca8a97a144
Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date: Wed Oct 22 02:22:20 2008 -0400
richedit: Added tests for EM_POSFROMCHAR for pos around end of text.
---
dlls/riched20/tests/editor.c | 17 +++++++++++++++++
1 files changed, 17 insertions(+), 0 deletions(-)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 14bfb6d..d57aab0 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -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);
}
More information about the wine-cvs
mailing list