Author: cwittich
Date: Mon Mar 22 21:50:32 2010
New Revision: 46345
URL:
http://svn.reactos.org/svn/reactos?rev=46345&view=rev
Log:
[RICHED20_WINETEST]
sync riched20_winetest to wine 1.1.41
Modified:
trunk/rostests/winetests/riched20/editor.c
Modified: trunk/rostests/winetests/riched20/editor.c
URL:
http://svn.reactos.org/svn/reactos/trunk/rostests/winetests/riched20/editor…
==============================================================================
--- trunk/rostests/winetests/riched20/editor.c [iso-8859-1] (original)
+++ trunk/rostests/winetests/riched20/editor.c [iso-8859-1] Mon Mar 22 21:50:32 2010
@@ -4812,9 +4812,10 @@
static void test_EM_FORMATRANGE(void)
{
- int i, tpp_x, tpp_y;
+ int r, i, tpp_x, tpp_y;
HDC hdc;
HWND hwndRichEdit = new_richedit(NULL);
+ FORMATRANGE fr;
static const struct {
const char *string; /* The string */
int first; /* First 'pagebreak', 0 for don't care */
@@ -4834,14 +4835,29 @@
tpp_x = 1440 / GetDeviceCaps(hdc, LOGPIXELSX);
tpp_y = 1440 / GetDeviceCaps(hdc, LOGPIXELSY);
+ /* Test the simple case where all the text fits in the page rect. */
+ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"a");
+ fr.hdc = fr.hdcTarget = hdc;
+ fr.rc.top = fr.rcPage.top = fr.rc.left = fr.rcPage.left = 0;
+ fr.rc.right = fr.rcPage.right = 500 * tpp_x;
+ fr.rc.bottom = fr.rcPage.bottom = 500 * tpp_y;
+ fr.chrg.cpMin = 0;
+ fr.chrg.cpMax = -1;
+ r = SendMessage(hwndRichEdit, EM_FORMATRANGE, FALSE, (LPARAM)&fr);
+ todo_wine ok(r == 2, "r=%d expected r=2\n", r);
+
+ SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)"ab");
+ fr.rc.bottom = fr.rcPage.bottom;
+ r = SendMessage(hwndRichEdit, EM_FORMATRANGE, FALSE, (LPARAM)&fr);
+ todo_wine ok(r == 3, "r=%d expected r=3\n", r);
+
SendMessage(hwndRichEdit, EM_FORMATRANGE, FALSE, 0);
for (i = 0; i < sizeof(fmtstrings)/sizeof(fmtstrings[0]); i++)
{
- FORMATRANGE fr;
GETTEXTLENGTHEX gtl;
SIZE stringsize;
- int r, len;
+ int len;
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM) fmtstrings[i].string);
@@ -5523,6 +5539,45 @@
gtl.codepage = CP_ACP;
ret = SendMessageA(hwnd, EM_GETTEXTLENGTHEX, (WPARAM)>l, 0);
ok(ret == 6, "ret %d\n",ret);
+
+ /* Unicode/NUMCHARS/NUMBYTES */
+ SendMessage(hwnd, WM_SETTEXT, 0, (LPARAM) test_string_2);
+
+ gtl.flags = GTL_DEFAULT;
+ gtl.codepage = 1200;
+ ret = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
+ ok(ret == lstrlen(test_string_2),
+ "GTL_DEFAULT gave %i, expected %i\n", ret, lstrlen(test_string_2));
+
+ gtl.flags = GTL_NUMCHARS;
+ gtl.codepage = 1200;
+ ret = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
+ ok(ret == lstrlen(test_string_2),
+ "GTL_NUMCHARS gave %i, expected %i\n", ret, lstrlen(test_string_2));
+
+ gtl.flags = GTL_NUMBYTES;
+ gtl.codepage = 1200;
+ ret = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
+ ok(ret == lstrlen(test_string_2)*2,
+ "GTL_NUMBYTES gave %i, expected %i\n", ret, lstrlen(test_string_2)*2);
+
+ gtl.flags = GTL_PRECISE;
+ gtl.codepage = 1200;
+ ret = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
+ ok(ret == lstrlen(test_string_2)*2,
+ "GTL_PRECISE gave %i, expected %i\n", ret, lstrlen(test_string_2)*2);
+
+ gtl.flags = GTL_NUMCHARS | GTL_PRECISE;
+ gtl.codepage = 1200;
+ ret = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
+ ok(ret == lstrlen(test_string_2),
+ "GTL_NUMCHAR | GTL_PRECISE gave %i, expected %i\n", ret,
lstrlen(test_string_2));
+
+ gtl.flags = GTL_NUMCHARS | GTL_NUMBYTES;
+ gtl.codepage = 1200;
+ ret = SendMessage(hwnd, EM_GETTEXTLENGTHEX, (WPARAM) >l, 0);
+ ok(ret == E_INVALIDARG,
+ "GTL_NUMCHARS | GTL_NUMBYTES gave %i, expected %i\n", ret,
E_INVALIDARG);
DestroyWindow(hwnd);
}