Alex Villacís Lasso : riched20: Yet more tests for EM_STREAMIN.
Alexandre Julliard
julliard at winehq.org
Thu Apr 24 06:23:15 CDT 2008
Module: wine
Branch: master
Commit: a9caca3edabec21f5c4d5de5fd25198cfa25b33e
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a9caca3edabec21f5c4d5de5fd25198cfa25b33e
Author: Alex Villacís Lasso <a_villacis at palosanto.com>
Date: Wed Apr 23 09:52:14 2008 -0500
riched20: Yet more tests for EM_STREAMIN.
---
dlls/riched20/tests/editor.c | 54 ++++++++++++++++++++++++++++++++++++++++++
1 files changed, 54 insertions(+), 0 deletions(-)
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 69d9ac3..236a777 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -2328,6 +2328,10 @@ static void test_EM_STREAMIN(void)
EDITSTREAM es;
char buffer[1024] = {0};
+ const char * streamText0 = "{\\rtf1 TestSomeText}";
+ const char * streamText0a = "{\\rtf1 TestSomeText\\par}";
+ const char * streamText0b = "{\\rtf1 TestSomeText\\par\\par}";
+
const char * streamText1 =
"{\\rtf1\\ansi\\ansicpg1252\\deff0\\deflang12298{\\fonttbl{\\f0\\fswiss\\fprq2\\fcharset0 System;}}\r\n" \
"\\viewkind4\\uc1\\pard\\f0\\fs17 TestSomeText\\par\r\n" \
@@ -2345,6 +2349,56 @@ static void test_EM_STREAMIN(void)
const char * streamText3 = "RichEdit1";
+ /* Minimal test without \par at the end */
+ es.dwCookie = (DWORD_PTR)&streamText0;
+ es.dwError = 0;
+ es.pfnCallback = test_EM_STREAMIN_esCallback;
+ SendMessage(hwndRichEdit, EM_STREAMIN,
+ (WPARAM)(SF_RTF), (LPARAM)&es);
+
+ result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ ok (result == 12,
+ "EM_STREAMIN: Test 0 returned %ld, expected 12\n", result);
+ result = strcmp (buffer,"TestSomeText");
+ ok (result == 0,
+ "EM_STREAMIN: Test 0 set wrong text: Result: %s\n",buffer);
+
+ /* Native richedit 2.0 ignores last \par */
+ es.dwCookie = (DWORD_PTR)&streamText0a;
+ es.dwError = 0;
+ es.pfnCallback = test_EM_STREAMIN_esCallback;
+ SendMessage(hwndRichEdit, EM_STREAMIN,
+ (WPARAM)(SF_RTF), (LPARAM)&es);
+
+ result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ todo_wine {
+ ok (result == 12,
+ "EM_STREAMIN: Test 0-a returned %ld, expected 12\n", result);
+ }
+ result = strcmp (buffer,"TestSomeText");
+ todo_wine {
+ ok (result == 0,
+ "EM_STREAMIN: Test 0-a set wrong text: Result: %s\n",buffer);
+ }
+
+ /* Native richedit 2.0 ignores last \par, next-to-last \par appears */
+ es.dwCookie = (DWORD_PTR)&streamText0b;
+ es.dwError = 0;
+ es.pfnCallback = test_EM_STREAMIN_esCallback;
+ SendMessage(hwndRichEdit, EM_STREAMIN,
+ (WPARAM)(SF_RTF), (LPARAM)&es);
+
+ result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+ todo_wine {
+ ok (result == 14,
+ "EM_STREAMIN: Test 0-b returned %ld, expected 14\n", result);
+ }
+ result = strcmp (buffer,"TestSomeText\r\n");
+ todo_wine {
+ ok (result == 0,
+ "EM_STREAMIN: Test 0-b set wrong text: Result: %s\n",buffer);
+ }
+
es.dwCookie = (DWORD_PTR)&streamText1;
es.dwError = 0;
es.pfnCallback = test_EM_STREAMIN_esCallback;
More information about the wine-cvs
mailing list