>># 
>># 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: pkifevnt.m,v 1.8 92/06/11 17:23:58 rws Exp $
>># 
>>#
>>TITLE XPeekIfEvent CH08
>>ASSERTION A XPeekIfEvent-1
A call to XPeekIfEvent 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 XPeekIfEvent.
Verify that predicate was called the correct number of times.
Verify that predicate returned True at most recent invocation.
Verify that XIfEvent did not continue to call predicate
after predicate returned True.
>>ASSERTION A XPeekIfEvent-2
When predicate returns True, then XPeekIfEvent returns the
event passed to predicate in event_return.
>>STRATEGY
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Set up predicate procedure.
Call XPeekIfEvent.
Verify that predicate returned True at most recent invocation.
Verify that event_return is the same as the event passed to predicate.
Verify that event_return is the expected event.
Verify that XIfEvent did not continue to call predicate
after predicate returned True.
>>ASSERTION A XPeekIfEvent-3
A call to XPeekIfEvent does not remove event_return from
the event queue.
>>STRATEGY
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Call XPending to get the current event queue size.
Set up predicate procedure.
Call XPeekIfEvent.
Call XPending to get the current event queue size.
Verify that size of the event queue has not changed.
Verify that the returned event was not removed from the event queue.
>>ASSERTION A XPeekIfEvent-4
When on a call to XPeekIfEvent predicate has not returned
True after having been called once for each event in the
event queue, then XPeekIfEvent flushes the output buffer and
blocks until a matching event is received.
>>STRATEGY
Create client2.
Discard all events on the event queue.
Create pixmap.
Call XPutBackEvent to put an event on the event queue.
Set up predicate procedure.
Call XPeekIfEvent and verify that blocking did occur.
Verify that the output buffer was flushed.
Verify that predicate was called the correct number of times.
Verify that predicate returned True at most recent invocation.
