>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: slctinpt.m,v 1.12 92/06/11 17:24:49 rws Exp $
>># 
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#
>>TITLE XSelectInput CH08
>>ASSERTION A XSelectInput-1
A call to XSelectInput requests that the X server report
the events for window w matching event_mask.
>>STRATEGY
Create client1.
Create window with client1.
Select no events with client1 on this window.
Create client2.
Select MapNotify events with client2 on this window.
Map window.
XSync(.., False) on both clients to ensure generated events have come in.
Verify that client1 received no events.
Verify that client2 received a single MapNotify event for this window.
Verify that client2 received no other events.
>>ASSERTION A XSelectInput-2
A call to XSelectInput overrides the event mask attribute
set during any previous call to XSelectInput,
XChangeWindowAttributes, or XCreateWindow.
>>STRATEGY
Create window with no events selected.
Call XGetWindowAttributes to get event mask for this window.
Verify event mask is as expected.
Call XSelectInput to change event mask to StructureNotifyMask.
Call XGetWindowAttributes to get new event mask for this window.
Verify event mask changed as expected.
Call XChangeWindowAttributes to change event mask to NoEventMask.
Call XGetWindowAttributes to get event mask for this window.
Verify event mask is as expected.
Call XSelectInput to change event mask to ALLEVENTS.
Call XGetWindowAttributes to get new event mask for this window.
Verify event mask changed as expected.
Call XSelectInput to change event mask to StructureNotifyMask.
Call XGetWindowAttributes to get new event mask for this window.
Verify event mask changed as expected.
>>ASSERTION A XSelectInput-3
A call to XSelectInput does not change the event mask
attribute for other clients.
>>STRATEGY
Create client1.
Create window with client1.
Select NoEventMask events with client1 on this window.
Call XGetWindowAttributes to get event mask for client1 for window.
Verify event mask is as expected.
Create client2.
Select ALLEVENTS events with client2 on this window.
Call XGetWindowAttributes to get event mask for client2 for window.
Verify event mask is as expected.
Call XGetWindowAttributes to get event mask for client1 for window.
Verify event mask has not changed.
Select KeyPressMask events with client1 on this window.
Call XGetWindowAttributes to get event mask for client1 for window.
Verify event mask is as expected.
Call XGetWindowAttributes to get event mask for client2 for window.
Verify event mask has not changed.
>>ASSERTION A XSelectInput-4
When multiple clients make a call to XSelectInput
requesting the same event on the same window and that window
is the event window for the requested event, then the event
is reported to each client.
>>STRATEGY
Create client1.
Create window with client1.
Select MapNotify events with client1 on this window.
Create client2.
Select MapNotify events with client2 on this window.
Map window.
XSync(.., False) on both clients to ensure generated events have come in.
Verify that client1 received a single MapNotify event for this window.
Verify that client1 received no other events.
Verify that client2 received a single MapNotify event for this window.
Verify that client2 received no other events.
>>ASSERTION A XSelectInput-5
When another client has selected with an event mask
SubstructureRedirectMask, then on a call to XSelectInput
with SubstructureRedirectMask bits set in event_mask a
BadAccess error occurs.
>>STRATEGY
Create client1.
Create window with client1.
Select SubstructureRedirectMask event mask with client1 on this window.
Create client2.
Select SubstructureRedirectMask event mask with client2 on this window.
Verify that a BadAccess error was generated.
>>ASSERTION A XSelectInput-6
When another client has selected with an event mask
ResizeRedirectMask, then on a call to XSelectInput with
ResizeRedirectMask bits set in event_mask a BadAccess error
occurs.
>>STRATEGY
Create client1.
Create window with client1.
Select ResizeRedirectMask event mask with client1 on this window.
Create client2.
Select ResizeRedirectMask event mask with client2 on this window.
Verify that a BadAccess error was generated.
>>ASSERTION A XSelectInput-7
When another client has selected with an event mask
ButtonPressMask, then on a call to XSelectInput with
ButtonPressMask bits set in event_mask a BadAccess error
occurs.
>>STRATEGY
Create client1.
Create window with client1.
Select ButtonPressMask event mask with client1 on this window.
Create client2.
Select ButtonPressMask event mask with client2 on this window.
Verify that a BadAccess error was generated.
>>ASSERTION A XSelectInput-8
When a window argument does not name a valid Window, then a
BadWindow error occurs.
>>STRATEGY
Create a bad window by creating and destroying a window.
Call test function using bad window as the window argument.
Verify that a BadWindow error occurs.
