>># 
>># 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: ststt.m,v 1.8 92/06/11 16:19:54 rws Exp $
>># 
>>#      SCCS:  @(#)  EAll.mc Rel 1.5	    (3/12/92)
>>#      SCCS:  @(#)  EGC.mc Rel 1.5	    (10/25/91)
>>#      SCCS:  @(#)  EVal.mc Rel 1.5	    (10/10/91)
>>#
>>TITLE XSetState CH05
>>ASSERTION A XSetState-1
A call to XSetState sets the foreground, background,
plane_mask and function components of the specified GC to
the values of the foreground, background, plane_mask and
function arguments.
>>STRATEGY
*Test background.
Create window.
Create GC with LineStyle = LineDoubleDash, bg = BlackPixel , fg = WhitePixel, fn = GXcopy, line_width = 1
Draw a horizonal line (sufficiently long for even and odd dashes) 
Verify pixel at (1, 0) is bg with XGetImage and XGetPixel.
Set gc bg component to fg value using XSetState.
Redraw same line (should fill in the gaps exactly)
Verify pixel at (1, 0) is fg with XGetImage and XGetPixel.

*Test foreground.
Create window.
Create GC with bg = BlackPixel, fg = WhitePixel, fn = GXcopy.
Set pixel at (0, 0) with XDrawPoint.
Verify pixel at (0, 0) is fg with XGetImage and XGetPixel.
Set fg component of GC to bg with XSetState.
Set pixel at (0, 0) with XDrawPoint.
Verify pixel at (0, 0) is bg with XGetImage and XGetPixel.

*Test plane_mask.
Create window.
Create GC with bg = BlackPixel, fg = WhitePixel, plane_mask = 0.
Verify pixel at (0, 0) is bg with XGetImage and XGetPixel.
Set pixel at (0, 0) with XDrawPoint.
Verify pixel at (0, 0) is bg with XGetImage and XGetPixel.
Set plane_mask component of GC to AllPlanes with XSetState.
Set pixel at (0, 0) with XDrawPoint.
Verify pixel at (0, 0) is fg with XGetImage and XGetPixel.

*Test function.
Create window.
Create GC with bg = BlackPixel, fg = WhitePixel, fn = GXcopy.
Set pixel at (0, 0) to WhitePixel with XDrawPoint.
Verify pixel at (0, 0) is WhitePixel with XGetImage and XGetPixel.
Set fg to (BlackPixel xor WhitePixel)
Set fn component of GC to GXxor with XSetState.
Set pixel at (0, 0) to  fg with XDrawPoint.
Verify pixel at (0, 0) is BlackPixel with XGetImage and XGetPixel.
>>ASSERTION B XSetState-2
When the server fails to allocate a required resource, then
a BadAlloc error occurs.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XSetState-3
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 XSetState-4
When the value of function is other than GXclear, GXand,
GXandReverse, GXcopy, GXandInverted, GXnoop, GXxor,
GXor, GXnor, GXequiv, GXinvert, GXorReverse,
GXcopyInverted, GXorInverted, GXnand or GXset, then a
BadValue error occurs.
>>STRATEGY
Obtain a sequence of values which are not in the list specified by VALUE_LIST.
For each value:
  Call test function with this value in the VALUE_ARG argument.
  Verify that a BadValue error occurs.
