Dylan Smith : riched32: Test for EM_GETTEXTRANGE from middle of end of paragraph run.

Alexandre Julliard julliard at winehq.org
Tue Jan 27 09:07:47 CST 2009


Module: wine
Branch: master
Commit: 5bf9e73dd097eecc7739cff3329db8aa8ec1901f
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=5bf9e73dd097eecc7739cff3329db8aa8ec1901f

Author: Dylan Smith <dylan.ah.smith at gmail.com>
Date:   Tue Jan 27 03:39:10 2009 -0500

riched32: Test for EM_GETTEXTRANGE from middle of end of paragraph run.

EM_GETTEXTRANGE should be able to get part of the end of paragraph run,
for instance just the line feed in a carraige return line feed pair.

---

 dlls/riched32/tests/editor.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)

diff --git a/dlls/riched32/tests/editor.c b/dlls/riched32/tests/editor.c
index 7332536..58e0bae 100644
--- a/dlls/riched32/tests/editor.c
+++ b/dlls/riched32/tests/editor.c
@@ -465,9 +465,10 @@ static void test_EM_GETTEXTRANGE(void)
 {
     HWND hwndRichEdit = new_richedit(NULL);
     const char * text1 = "foo bar\r\nfoo bar";
-    const char * text2 = "foo bar\rfoo bar";
+    const char * text3 = "foo bar\rfoo bar";
     const char * expect1 = "bar\r\nfoo";
-    const char * expect2 = "bar\rfoo";
+    const char * expect2 = "\nfoo";
+    const char * expect3 = "bar\rfoo";
     char buffer[1024] = {0};
     LRESULT result;
     TEXTRANGEA textRange;
@@ -481,7 +482,14 @@ static void test_EM_GETTEXTRANGE(void)
     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);
+    textRange.lpstrText = buffer;
+    textRange.chrg.cpMin = 8;
+    textRange.chrg.cpMax = 12;
+    result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
+    ok(result == 4, "EM_GETTEXTRANGE returned %ld\n", result);
+    todo_wine ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
+
+    SendMessage(hwndRichEdit, WM_SETTEXT, 0, (LPARAM)text3);
 
     textRange.lpstrText = buffer;
     textRange.chrg.cpMin = 4;
@@ -489,7 +497,7 @@ static void test_EM_GETTEXTRANGE(void)
     result = SendMessage(hwndRichEdit, EM_GETTEXTRANGE, 0, (LPARAM)&textRange);
     ok(result == 7, "EM_GETTEXTRANGE returned %ld\n", result);
 
-    ok(!strcmp(expect2, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
+    ok(!strcmp(expect3, buffer), "EM_GETTEXTRANGE filled %s\n", buffer);
 
 
     DestroyWindow(hwndRichEdit);




More information about the wine-cvs mailing list