[PATCH test/xts] Fix XSendEvent tests

Jeremy Huddleston Sequoia jeremyhu at apple.com
Fri Aug 3 14:17:39 PDT 2012


For the series of 3 patches:

Reviewed-by: Jeremy Huddleston Sequoia <jeremyhu at apple.com>

On Aug 1, 2012, at 08:01, Peter Harris <pharris at opentext.com> wrote:

> XSendEvent of GenericEvent will return a Value error if the extension
> field isn't an extension that supports GenericEvent. Even before then,
> Xlib suppresses the XSendEvent. Instead of trying to find such an
> extension, just skip testing this event.
> 
> Leave GenericEvent in the list, so that notmember doesn't generate
> GenericEvent.
> 
> Signed-off-by: Peter Harris <pharris at opentext.com>
> ---
> xts5/Xlib12/XSendEvent.m |    8 ++++----
> 1 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/xts5/Xlib12/XSendEvent.m b/xts5/Xlib12/XSendEvent.m
> index 26eb5a1..48eec0e 100644
> --- a/xts5/Xlib12/XSendEvent.m
> +++ b/xts5/Xlib12/XSendEvent.m
> @@ -180,7 +180,7 @@ int	return_value;
> 	propagate = False;
> 	event_mask = NoEventMask;
> 	event = (XAnyEvent *) &event_return;
> -	for (i = 0; i < NELEM(event_types); i++) {
> +	for (i = 0; i < NELEM(event_types) - 1; i++) {
> 
> /* Discard all events in the event queue. */
> 		XSync(display, True);
> @@ -219,7 +219,7 @@ int	return_value;
> 
> /* Repeat for each event-type. */
> 	}
> -	CHECKPASS(3*NELEM(event_types));
> +	CHECKPASS(3*(NELEM(event_types)-1));
>>> ASSERTION Good A
> When
> .A w
> @@ -1878,7 +1878,7 @@ int	return_value;
> 	propagate = False;
> 	event_mask = NoEventMask;
> 	event = (XAnyEvent *) &event_return;
> -	for (i = 0; i < NELEM(event_types); i++) {
> +	for (i = 0; i < NELEM(event_types) - 1; i++) {
> 		char *en = eventname(event_types[i]);
> 
> /* Set type member of event to KeyPress. */
> @@ -1973,7 +1973,7 @@ int	return_value;
> 
> /* Repeat for each event-type. */
> 	}
> -	CHECKPASS(8*NELEM(event_types));
> +	CHECKPASS(8*(NELEM(event_types)-1));
>>> ASSERTION def
> On a call to xname
> the
> -- 
> 1.7.2.5
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 



More information about the xorg-devel mailing list