>># 
>># 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: evntsqd.m,v 1.11 92/06/11 17:20:46 rws Exp $
>># 
>>#
>>TITLE XEventsQueued CH08
>>ASSERTION A XEventsQueued-1
When the number of events already in the event queue is
non-zero, then a call to XEventsQueued returns the number of
events in the event queue.
>>STRATEGY
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Call XEventsQueued with mode QueuedAlready.
Verify that XEventsQueued returned the correct number of events.
Call XEventsQueued with mode QueuedAfterFlush.
Verify that XEventsQueued returned the correct number of events.
Call XEventsQueued with mode QueuedAfterReading.
Verify that XEventsQueued returned the correct number of events.
>>ASSERTION A XEventsQueued-2
When the number of events already in the event queue is
non-zero, then a call to XEventsQueued does not block.
>>STRATEGY
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Call XEventsQueued with mode QueuedAlready
and verify that blocking did not occur.
Verify that XEventsQueued returned the expected number of events.
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Call XEventsQueued with mode QueuedAfterFlush
and verify that blocking did not occur.
Verify that XEventsQueued returned the expected number of events.
Discard all events on the event queue.
Call XPutBackEvent to put events on the event queue.
Call XEventsQueued with mode QueuedAfterReading
and verify that blocking did not occur.
Verify that XEventsQueued returned the expected number of events.
>>ASSERTION A XEventsQueued-3
When the number of events already in the event queue is
non-zero, then a call to XEventsQueued does not flush 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 XEventsQueued with mode QueuedAlready.
Empty the buffer.
Ensure the server has dealt with anything flushed to it: do XSync()
Verify that the output buffer was not flushed by effect on server.
Discard all events on the event queue.
Create pixmap.
Call XPutBackEvent to put events on the event queue.
Call XEventsQueued with mode QueuedAfterFlush.
Empty the buffer.
Ensure the server has dealt with anything flushed to it: do XSync()
Verify that the output buffer was not flushed by effect on server.
Discard all events on the event queue.
Create pixmap.
Call XPutBackEvent to put events on the event queue.
Call XEventsQueued with mode QueuedAfterReading.
Empty the buffer.
Ensure the server has dealt with anything flushed to it: do XSync()
Verify that the output buffer was not flushed by effect on server.
Discard all left-over events in the event queue.
>>ASSERTION A XEventsQueued-4
When there are no events in the event queue, then a call to
XEventsQueued with mode set to QueuedAlready returns zero.
>>STRATEGY
Discard all events on the event queue.
Call XEventsQueued with mode QueuedAlready.
Verify that XEventsQueued returned the correct number of events.
>>ASSERTION A XEventsQueued-5
When there are no events in the event queue, then a call to
XEventsQueued with mode set to QueuedAfterFlush flushes the
output buffer.
>>STRATEGY
Create client2.
Discard all events on the event queue.
Create pixmap.
Call XEventsQueued with mode QueuedAfterFlush.
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 XEventsQueued returned the correct number of events.
Verify that errors did not occur after call to XEventsQueued.
>>ASSERTION A XEventsQueued-6
When there are no events in the event queue, then a call to
XEventsQueued with mode set to QueuedAfterFlush or
QueuedAfterReading attempts to read more events out of the
client's connection without blocking and returns the number
read.
>>STRATEGY
Discard all events on the event queue.
Call XEventsQueued with mode QueuedAfterFlush
and verify that blocking did not occur.
Discard all events on the event queue.
Call XEventsQueued with mode QueuedAfterReading
and verify that blocking did not occur.
