>># 
>># 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: chckifevnt.m,v 1.10 92/06/11 17:18:33 rws Exp $
>># 
>>#
>>TITLE XCheckIfEvent CH08
>>ASSERTION A XCheckIfEvent-1
A call to XCheckIfEvent calls predicate once for each event
in the event queue until predicate returns True.
>>STRATEGY
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Set up predicate procedure.
Call XCheckIfEvent.
Verify that predicate was called the correct number of times.
Verify that predicate returned True at most recent invocation.
Verify that XCheckIfEvent did not continue to call predicate
after predicate returned True.
>>ASSERTION A XCheckIfEvent-2
When a call to XCheckIfEvent finds a matching event, then
XCheckIfEvent True.
>>STRATEGY
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Set up predicate procedure.
Call XCheckIfEvent.
Verify that predicate found a matching event.
Verify that XCheckIfEvent returned True.
>>ASSERTION A XCheckIfEvent-3
A call to XCheckIfEvent removes the returned event from the
event queue.
>>STRATEGY
>>ASSERTION A XCheckIfEvent-4
When on a call to XCheckIfEvent predicate returns True,
then XCheckIfEvent returns the event passed to predicate in
event_return.
>>STRATEGY
>>ASSERTION A XCheckIfEvent-5
When on a call to XCheckIfEvent predicate has not returned
True after having been called once for each event in the
event queue, then XCheckIfEvent returns False.
>>STRATEGY
>>ASSERTION A XCheckIfEvent-6
When on a call to XCheckIfEvent predicate has not returned
True after having been called once for each event in the
event queue, then XCheckIfEvent flushes the output buffer.
>>STRATEGY
Create client2.
Discard all events on the event queue.
Create pixmap.
Call XPutBackEvent to put events on the event queue.
Call XPending to get the current event queue size.
Set up predicate procedure.
Call XCheckIfEvent.
Empty the buffer.
Ensure the server has dealt with anything flushed to it: do XSync()
Verify that the output buffer was flushed by effect on server.
Verify that predicate never returned True.
Verify that XCheckIfEvent returned False.
Verify that XCheckIfEvent called predicate once for
each event in the event queue.
