>># 
>># 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: sterrrhndl.m,v 1.12 92/06/11 17:25:43 rws Exp $
>># 
>>#
>>TITLE XSetErrorHandler CH08
>>ASSERTION A XSetErrorHandler-1
A call to XSetErrorHandler sets the error handler to
handler.
>>STRATEGY
Call XSetErrorHandler to set error handler to errorhandler.
Generate an error.
Verify that errorhandler was called.
>>ASSERTION A XSetErrorHandler-2
A call to XSetErrorHandler returns the previous error
handler.
>>STRATEGY
Call XSetErrorHandler to set error handler to errorhandler.
Call XSetErrorHandler to set error handler to _errorhandler.
Verify that errorhandler was returned.
Call XSetErrorHandler to set error handler to errorhandler.
Verify that _errorhandler was returned.
>>ASSERTION B XSetErrorHandler-3
A call to XSetErrorHandler with handler set to NULL sets
the error handler to the default error handler.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XSetErrorHandler-4
The default error handler prints a message and exits.
>>STRATEGY
Get default error handler.
Create child process.
Child calls default error handler and loops forever.
Parent sleeps for 10 seconds.
Parent verifies that child no longer exists.
>>ASSERTION B XSetErrorHandler-5
There is no limit to the number of times XSetErrorHandler
may be called.
>>STRATEGY
Set handler to errorhandler.
Call XSetErrorHandler 1000 times.
Report untested.
>>ASSERTION A XSetErrorHandler-6
When a BadName error occurs from a call to XLoadQueryFont,
XLookupColor, or XAllocNamedColor, then handler is not
called.
>>STRATEGY
Set error handler to errorhandler.
Generate a BadName error through a call to XLoadQueryFont.
Verify that XLoadQueryFont returned NULL.
Verify that errorhandler was not called.
Generate a BadName error through a call to XLookupColor.
Verify that XLookupColor returned 0.
Verify that errorhandler was not called.
Generate a BadName error through a call to XAllocNamedColor.
Verify that XAllocNamedColor returned 0.
Verify that errorhandler was not called.
>>ASSERTION A XSetErrorHandler-7
When a BadFont error occurs from a QueryFont protocol
request, then handler is not called.
>>STRATEGY
Set error handler to errorhandler.
Create a bad font ID.
Call XQueryFont to generate a BadFont error.
Verify that XQueryFont returned NULL.
Verify that errorhandler was not called.
>>ASSERTION A XSetErrorHandler-8
On a call to handler, the serial member in the XErrorEvent
structure is set to the number that was the value of
NextRequest immediately before the protocol request was
sent.
>>STRATEGY
Call XSetErrorHandler to set error handler to errorhandler.
Create window.
Destroy window.
Call NextRequest to get the serial number to be used in the next request.
Call XDestroyWindow to generate a BadWindow error.
Verify that errorhandler was called.
Verify that the serial member in the XErrorEvent structure
was set correctly.
>>ASSERTION A XSetErrorHandler-9
On a call to handler, the request_code member in the
XErrorEvent structure is set to the protocol request of the
procedure that failed.
>>STRATEGY
Call XSetErrorHandler to set error handler to errorhandler.
Create window.
Destroy window.
Call XDestroyWindow to generate a BadWindow error.
Verify that errorhandler was called.
Verify that the request_code member in the XErrorEvent structure
was set correctly.
