richedit: Fixed simulated keyboard events on tests [try 3]

Dylan Smith dylan.ah.smith at
Wed Jul 2 09:44:01 CDT 2008

This fixes a valgrind error caused by a test using an uninitialised
value, and other errors on a test for sending keyboard events.  These
fixes are all in the same patch because they were all due to keyboard
event issues.

I factored out the keyboard event sending to pressKey and
pressKeyWithModifier functions, because this was done in multiple
places, and incorrectly in some places.  SetFocus was also needed to
ensure that the key presses got sent to the richedit control.

I also needed to send a WM_SETREDRAW message at the end of
test_EM_REPLACESEL, because sometimes it prevents keyboard events
from being processed.

The valgrind error were resolved from the above changes, since the root
cause of the error was the fact that a keyboard event quietly failed to
be simulated in test_EM_AUTOURLDETECT.  This led to a memory access
outside the buffer because the keyboard event was expected to add
characters to the text, and increase the size of the buffer.
 dlls/riched20/tests/editor.c |  162 +++++++++++++++++++-----------------------
 1 files changed, 73 insertions(+), 89 deletions(-)
-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: 0001-richedit-Fixed-simulated-keyboard-events-on-test.diff.txt

More information about the wine-patches mailing list