richedit: Avoid strlen in traces.

This commit is contained in:
Alexandre Julliard 2008-05-02 13:59:06 +02:00
parent 0a4eebd744
commit 13ab99b404
2 changed files with 8 additions and 16 deletions

View File

@ -829,8 +829,7 @@ static void test_EM_GETTEXTRANGE(void)
textRange.chrg.cpMin = 4;
textRange.chrg.cpMax = 11;
result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect));
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2);
@ -839,8 +838,7 @@ static void test_EM_GETTEXTRANGE(void)
textRange.chrg.cpMin = 4;
textRange.chrg.cpMax = 11;
result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect));
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
DestroyWindow(hwndRichEdit);
@ -859,16 +857,14 @@ static void test_EM_GETSELTEXT(void)
SendMessage(hwndRichEdit, EM_SETSEL, 4, 11);
result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect));
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2);
SendMessage(hwndRichEdit, EM_SETSEL, 4, 11);
result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect));
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
DestroyWindow(hwndRichEdit);

View File

@ -489,8 +489,7 @@ static void test_EM_GETTEXTRANGE(void)
textRange.chrg.cpMin = 4;
textRange.chrg.cpMax = 12;
result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
ok(result == 8, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect1));
ok(result == 8, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect1, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2);
@ -499,8 +498,7 @@ static void test_EM_GETTEXTRANGE(void)
textRange.chrg.cpMin = 4;
textRange.chrg.cpMax = 11;
result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect2));
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
@ -522,16 +520,14 @@ static void test_EM_GETSELTEXT(void)
SendMessage(hwndRichEdit, EM_SETSEL, 4, 12);
result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 8, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect1));
ok(result == 8, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect1, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text2);
SendMessage(hwndRichEdit, EM_SETSEL, 4, 11);
result = SendMessage(hwndRichEdit, EM_GETSELTEXT, 0, (LPARAM)buffer);
ok(result == 7, "EM_GETTEXTRANGE returned %ld, expected %d\n",
result, strlen(expect2));
ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);