79312: [2/2] richedit: Return number of chars inserted for EM_STREAMIN with SF_RTF.

buildbot at kegel.com buildbot at kegel.com
Mon Sep 26 00:32:10 CDT 2011


This is an experimental automated build and test service.
Please feel free to ignore this email while we work the kinks out.

For more info about this message, see http://wiki.winehq.org/BuildBot

The Buildbot has detected a failed build on builder runtests-default while building Wine.
Full details are available at: http://buildbot.kegel.com/builders/runtests-default/builds/54 (though maybe not for long, as I'm still reinstalling the buildbot periodically while experimenting)
BUILD FAILED: failed shell_3

Errors:
* Call to xpconnect wrapped JSObject produced this error:  *
* Call to xpconnect wrapped JSObject produced this error:  *
alarum: failed command was ../../../wine oleaut32_test.exe.so olepicture.c 
fixme:ole:OleLoadPictureEx (0x11ff10,60,1,{7bf80980-bf32-101a-8bbb-00aa00300cab},x=100,y=100,f=0,0x33fcac), partially implemented.
fixme:ole:OleLoadPictureEx (0x11ff10,50,1,{7bf80980-bf32-101a-8bbb-00aa00300cab},x=100,y=100,f=0,0x33fcd8), partially implemented.
fixme:ole:OLEPictureImpl_Load Unknown magic 0001, 50 read bytes:
01 00 09 00 00 03 19 00 01 00 
09 00 00 03 19 00 00 00 00 00 
0d 00 00 00 00 00 0d 00 00 00 
32 0a 16 00 0b 00 04 00 00 00 
54 65 73 74 03 00 05 00 08 00 
0c 00 03 00 00 00 00 00 
err:ole:OleLoadPictureEx IPersistStream_Load failed
fixme:ole:OleLoadPictureEx (0x11ff10,244,1,{7bf80980-bf32-101a-8bbb-00aa00300cab},x=10,y=10,f=0,0x33fcb0), partially implemented.
err:ole:OLEPictureImpl_Invoke riid was {7bf80981-bf32-101a-8bbb-00aa00300cab} instead of IID_NULL
err:ole:OLEPictureImpl_Invoke riid was {00000000-0000-0000-c000-000000000046} instead of IID_NULL
err:ole:OLEPictureImpl_Invoke param count for DISPATCH_PROPERTYPUT was 0 instead of 1
err:ole:OLEPictureImpl_Invoke null pDispParams not allowed
err:ole:OLEPictureImpl_Invoke null pDispParams not allowed
err:ole:OLEPictureImpl_Invoke null pDispParams not allowed
err:ole:OLEPictureImpl_Invoke invalid dispid 0x2 or wFlags 0x1
err:ole:OLEPictureImpl_Invoke invalid dispid 0xdeadbeef or wFlags 0x2
err:ole:OLEPictureImpl_Invoke param count for DISPATCH_PROPERTYGET was 1 instead of 0
err:ole:OLEPictureImpl_Invoke param count for DISPATCH_PROPERTYGET was 1 instead of 0
fixme:ole:OLEPictureImpl_Render Not quite correct implementation of rendering icons...
olepicture.c:696: Test failed: Color at 5,5 should have changed, but still was 0xF04634
make: *** [olepicture.ok] Error 1

-------------- next part --------------
From: Dylan Smith <dylan.ah.smith at gmail.com>
Subject: [1/2] richedit: Return number of bytes read for EM_STREAMIN with SF_TEXT.
Message-Id: <alpine.DEB.2.02.1109252217120.31932 at antec>
Date: Sun, 25 Sep 2011 22:17:19 -0400 (EDT)

See http://bugs.winehq.org/show_bug.cgi?id=27332
---
 dlls/riched20/editor.c       |   17 +++++++++------
 dlls/riched20/tests/editor.c |   46 ++++++++++++++++++++++++++++++++---------
 2 files changed, 46 insertions(+), 17 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 3c409e4..8051889 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -285,9 +285,10 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea
 {
   WCHAR wszText[STREAMIN_BUFFER_SIZE+1];
   WCHAR *pText;
-  
+  LRESULT total_bytes_read = 0;
+
   TRACE("%08x %p\n", dwFormat, stream);
-  
+
   do {
     LONG nWideChars = 0;
 
@@ -298,8 +299,9 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea
         break;
       if (!stream->dwSize)
         break;
+      total_bytes_read += stream->dwSize;
     }
-      
+
     if (!(dwFormat & SF_UNICODE))
     {
       /* FIXME? this is doomed to fail on true MBCS like UTF-8, luckily they're unlikely to be used as CP_ACP */
@@ -311,13 +313,13 @@ static LRESULT ME_StreamInText(ME_TextEditor *editor, DWORD dwFormat, ME_InStrea
       nWideChars = stream->dwSize >> 1;
       pText = (WCHAR *)stream->buffer;
     }
-    
+
     ME_InsertTextFromCursor(editor, 0, pText, nWideChars, style);
     if (stream->dwSize == 0)
       break;
     stream->dwSize = 0;
   } while(1);
-  return 0;
+  return total_bytes_read;
 }
 
 static void ME_ApplyBorderProperties(RTF_Info *info,
@@ -1390,6 +1392,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
   ME_InStream inStream;
   BOOL invalidRTF = FALSE;
   ME_Cursor *selStart, *selEnd;
+  LRESULT num_read = 0; /* bytes read for SF_TEXT, non-control chars inserted for SF_RTF */
 
   TRACE("stream==%p editor==%p format==0x%X\n", stream, editor, format);
   editor->nEventMask = 0;
@@ -1564,7 +1567,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
       style = parser.style;
     }
     else if (format & SF_TEXT)
-      ME_StreamInText(editor, format, &inStream, style);
+      num_read = ME_StreamInText(editor, format, &inStream, style);
     else
       ERR("EM_STREAMIN without SF_TEXT or SF_RTF\n");
     /* put the cursor at the top */
@@ -1594,7 +1597,7 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
   ME_SendSelChange(editor);
   ME_SendRequestResize(editor, FALSE);
 
-  return 0;
+  return num_read;
 }
 
 
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 77ce09e..5058b7a 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -5040,20 +5040,29 @@ static void test_EM_STREAMIN(void)
 
   const char * streamText3 = "RichEdit1";
 
-  struct StringWithLength cookieForStream4;
   const char * streamText4 =
       "This text just needs to be long enough to cause run to be split onto "
       "two separate lines and make sure the null terminating character is "
       "handled properly.\0";
   int length4 = strlen(streamText4) + 1;
-  cookieForStream4.buffer = (char *)streamText4;
-  cookieForStream4.length = length4;
+  struct StringWithLength cookieForStream4 = {
+      length4,
+      (char *)streamText4,
+  };
+
+  const WCHAR streamText5[] = { 'T', 'e', 's', 't', 'S', 'o', 'm', 'e', 'T', 'e', 'x', 't' };
+  int length5 = sizeof(streamText5) / sizeof(WCHAR);
+  struct StringWithLength cookieForStream5 = {
+      sizeof(streamText5),
+      (char *)streamText5,
+  };
 
   /* 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, SF_RTF, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  todo_wine ok(result == 12, "got %ld, expected %d\n", result, 12);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 12,
@@ -5067,7 +5076,8 @@ static void test_EM_STREAMIN(void)
   es.dwCookie = (DWORD_PTR)&streamText0a;
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
-  SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  todo_wine ok(result == 12, "got %ld, expected %d\n", result, 12);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 12,
@@ -5081,7 +5091,8 @@ static void test_EM_STREAMIN(void)
   es.dwCookie = (DWORD_PTR)&streamText0b;
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
-  SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  todo_wine ok(result == 13, "got %ld, expected %d\n", result, 13);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 14,
@@ -5094,7 +5105,8 @@ static void test_EM_STREAMIN(void)
   es.dwCookie = (DWORD_PTR)&streamText1;
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
-  SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  todo_wine ok(result == 12, "got %ld, expected %d\n", result, 12);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 12,
@@ -5106,7 +5118,8 @@ static void test_EM_STREAMIN(void)
 
   es.dwCookie = (DWORD_PTR)&streamText2;
   es.dwError = 0;
-  SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  ok(result == 0, "got %ld, expected %d\n", result, 0);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 0,
@@ -5117,7 +5130,8 @@ static void test_EM_STREAMIN(void)
 
   es.dwCookie = (DWORD_PTR)&streamText3;
   es.dwError = 0;
-  SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
+  ok(result == 0, "got %ld, expected %d\n", result, 0);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 0,
@@ -5129,13 +5143,25 @@ static void test_EM_STREAMIN(void)
   es.dwCookie = (DWORD_PTR)&cookieForStream4;
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback2;
-  SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT, (LPARAM)&es);
+  ok(result == length4, "got %ld, expected %d\n", result, length4);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == length4,
       "EM_STREAMIN: Test 4 returned %ld, expected %d\n", result, length4);
   ok(es.dwError == 0, "EM_STREAMIN: Test 4 set error %d, expected %d\n", es.dwError, 0);
 
+  es.dwCookie = (DWORD_PTR)&cookieForStream5;
+  es.dwError = 0;
+  es.pfnCallback = test_EM_STREAMIN_esCallback2;
+  result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_TEXT | SF_UNICODE, (LPARAM)&es);
+  ok(result == sizeof(streamText5), "got %ld, expected %u\n", result, (UINT)sizeof(streamText5));
+
+  result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
+  ok (result  == length5,
+      "EM_STREAMIN: Test 4 returned %ld, expected %d\n", result, length5);
+  ok(es.dwError == 0, "EM_STREAMIN: Test 5 set error %d, expected %d\n", es.dwError, 0);
+
   DestroyWindow(hwndRichEdit);
 }
 
-- 
1.7.4.1

From: Dylan Smith <dylan.ah.smith at gmail.com>
Subject: [2/2] richedit: Return number of chars inserted for EM_STREAMIN with SF_RTF.
Message-Id: <alpine.DEB.2.02.1109252217240.31932 at antec>
Date: Sun, 25 Sep 2011 22:17:28 -0400 (EDT)

---
 dlls/riched20/editor.c       |    4 ++++
 dlls/riched20/tests/editor.c |    8 ++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/dlls/riched20/editor.c b/dlls/riched20/editor.c
index 8051889..5dda1ea 100644
--- a/dlls/riched20/editor.c
+++ b/dlls/riched20/editor.c
@@ -1470,6 +1470,8 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
   if (!invalidRTF && !inStream.editstream->dwError)
   {
     if (format & SF_RTF) {
+      from = ME_GetCursorOfs(&editor->pCursors[0]);
+
       /* setup the RTF parser */
       memset(&parser, 0, sizeof parser);
       RTFSetEditStream(&parser, &inStream);
@@ -1563,6 +1565,8 @@ static LRESULT ME_StreamIn(ME_TextEditor *editor, DWORD format, EDITSTREAM *stre
           }
         }
       }
+      to = ME_GetCursorOfs(&editor->pCursors[0]);
+      num_read = to - from;
 
       style = parser.style;
     }
diff --git a/dlls/riched20/tests/editor.c b/dlls/riched20/tests/editor.c
index 5058b7a..c8d8e0d 100644
--- a/dlls/riched20/tests/editor.c
+++ b/dlls/riched20/tests/editor.c
@@ -5062,7 +5062,7 @@ static void test_EM_STREAMIN(void)
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
   result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
-  todo_wine ok(result == 12, "got %ld, expected %d\n", result, 12);
+  ok(result == 12, "got %ld, expected %d\n", result, 12);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 12,
@@ -5077,7 +5077,7 @@ static void test_EM_STREAMIN(void)
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
   result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
-  todo_wine ok(result == 12, "got %ld, expected %d\n", result, 12);
+  ok(result == 12, "got %ld, expected %d\n", result, 12);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 12,
@@ -5092,7 +5092,7 @@ static void test_EM_STREAMIN(void)
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
   result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
-  todo_wine ok(result == 13, "got %ld, expected %d\n", result, 13);
+  ok(result == 13, "got %ld, expected %d\n", result, 13);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 14,
@@ -5106,7 +5106,7 @@ static void test_EM_STREAMIN(void)
   es.dwError = 0;
   es.pfnCallback = test_EM_STREAMIN_esCallback;
   result = SendMessage(hwndRichEdit, EM_STREAMIN, SF_RTF, (LPARAM)&es);
-  todo_wine ok(result == 12, "got %ld, expected %d\n", result, 12);
+  ok(result == 12, "got %ld, expected %d\n", result, 12);
 
   result = SendMessage(hwndRichEdit, WM_GETTEXT, 1024, (LPARAM) buffer);
   ok (result  == 12,
-- 
1.7.4.1



More information about the wine-tests-results mailing list