>># 
>># 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: ifevnt.m,v 1.10 92/06/11 17:22:10 rws Exp $
>># 
>>#
>>TITLE XIfEvent CH08
>>ASSERTION A XIfEvent-1
A call to XIfEvent 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 XIfEvent.
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 XIfEvent-2
When predicate returns True, then XIfEvent 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 XIfEvent.
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 XIfEvent-3
A call to XIfEvent removes the returned event 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 XIfEvent.
Call XPending to get the current event queue size.
Verify that size of the event queue has decreased by one.
Verify that the returned event was removed from the event queue.
>>ASSERTION A XIfEvent-4
When on a call to XIfEvent predicate has not returned True
after having been called once for each event in the event
queue, then XIfEvent 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 XIfEvent 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.
