>># 
>># 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: stclpmsk.m,v 1.8 92/06/11 16:17:40 rws Exp $
>># 
>>#      SCCS:  @(#)  EAll.mc Rel 1.5	    (3/12/92)
>>#      SCCS:  @(#)  EGC.mc Rel 1.5	    (10/25/91)
>>#      SCCS:  @(#)  EPix.mc Rel 1.3	    (7/19/91)
>>#
>>TITLE XSetClipMask CH05
>>ASSERTION A XSetClipMask-1
A call to XSetClipMask sets the clip_mask component of the
specified GC to the value of the pixmap argument.
>>STRATEGY
Create window, size W_STDWIDTHxW_STDHEIGHT (>=1x1), with
	bg = background_pixel = W_BG.
Create 1x1 pixmap.
Set pixel at (0,0) in pixmap to 0.
Create GC with fg = W_FG.
Set clip_mask = pixmap with XSetClipMask
	(Note, no drawing in pixmap after XSetClipMask() call as effect on
	 subsequent clipping is undefined).
Set pixel at (0,0) to fg with XDrawPoint.
Verify pixel at (0,0) is bg using XGetImage and XGetPixel.
Create another 1x1 pixmap.
Set pixel at (0,0) in pixmap to 1.
Set clip_mask = pixmap with XSetClipMask.
Set pixel at (0,0) to fg with XDrawPoint.
Verify pixel at (0,0) is fg using XGetImage and XGetPixel.
>>ASSERTION A XSetClipMask-2
When the pixmap argument is None, then the clip_mask
component of the specified gc has no effect on any
subsequent graphics operation.
>>STRATEGY
Create window.
Create pixmap of window dimensions.
Create GC with clip_mask = pixmap.
Fill part of pixmap with {1,} using XFillRectangle.
Fill window using XFillRectangle.
Verify that pixels inside/outside clipping region are set to fg/bg.
Set the clip_mask to None with XSetClipMask.
Fill window using XFillRectangle.
Verify that pixels are set to fg.
>>ASSERTION B XSetClipMask-3
When the server fails to allocate a required resource, then
a BadAlloc error occurs.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XSetClipMask-4
When the GC argument does not name a defined GC, then a
BadGC error occurs.
>>STRATEGY
Create a GC.
Set GC id to -1 using XTestSetGContextOfGC.
Call test function using bad GC as the GC argument.
Verify that a BadGC error occurs.
>>ASSERTION A XSetClipMask-5
When the pixmap argument is a pixmap and the gc and pixmap
arguments were not created for the same root, then a
BadMatch error occurs.
>>STRATEGY
If alternate root window is supported:
	Create a pixmap(#1) of depth 1 for one root.
	Create a pixmap(#2) of depth 1 for alternate root.
	Created a gc for alternate root using pixmap #2.
	Verify that a call to XSetClipMask generates a BadMatch error
		when attempting to set gc's clip_mask to pixmap #1.
>>ASSERTION A XSetClipMask-6
When the pixmap argument does not have depth 1, then a
BadMatch error occurs.
>>STRATEGY
If pixmap with depth other than one is supported:
	Create pixmap with depth other than one.
	Created gc using same root as pixmap.
	Verify that a call to XSetClipMask generates a BadMatch error.
>>ASSERTION A XSetClipMask-7
When a pixmap argument does not name a valid Pixmap, then a
BadPixmap error occurs.
>>STRATEGY
Create a bad pixmap by creating and freeing a pixmap.
Call test function using bad pixmap as the pixmap argument.
Verify that a BadPixmap error occurs.
