>># 
>># 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: crtgc.m,v 1.14 92/06/11 16:15:35 rws Exp $
>># 
>>#      SCCS:  @(#)  EAll.mc Rel 1.5	    (3/12/92)
>>#      SCCS:  @(#)  EDra.mc Rel 1.5	    (10/25/91)
>>#
>>TITLE XCreateGC CH05
>>ASSERTION A XCreateGC-1
A call to XCreateGC creates a graphics context and returns
a GC which may be used with any destination drawable having
the same root and depth as the drawable d.
>>STRATEGY
For pixmaps and windows:
   Create a gc for the drawable using XCreateGC.
   Set pixel (0,0) of the drawable.
   Verify that the pixel was set.
>>ASSERTION A XCreateGC-2
A call to XCreateGC initialises the components specified by
the valuemask argument in the newly created GC to the values
in the values argument.
>>STRATEGY
Create a window.
Initialise XGCValues structure with fg W_FG, fn GXxor.
Create a gc for the window with a valuemask of GCFunction | GCForeground.
Plot point (0,0) with XDrawPoint.
Verify that pixel at (0,0) is W_FG.
Initialise XGCValues structure with fg W_FG ^ W_BG, fn GXxor.
Create a gc for the window with a valuemask of GCFunction | GCForeground.
Plot point (0,0) with XDrawPoint.
Verify that pixel at (0,0) is W_BG.
>>ASSERTION A XCreateGC-3
When the tile pixmap is not set and the fill_style is
FillTiled, then a call to XCreateGC creates a GC in which a
pixel set to the foreground value of GC is used for tiling.
>>STRATEGY
Create a gc with the fill_style FillTiled, foreground set to W_FG, tile set to NULL.
Create a window.
Tile entire window with XFillRectangle.
Verify that all the window pixels were W_FG.
Plot point (0,0) with XDrawPoint.
Set fg to W_FG ^ W_BG.
Plot point (0,0) with XDrawPoint.
Verify that pixel at (0,0) is W_BG.
>>ASSERTION B XCreateGC-4
When the server fails to allocate a required resource, then
a BadAlloc error occurs.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XCreateGC-5
When a drawable argument does not name a valid Drawable,
then a BadDrawable error occurs.
>>STRATEGY
Create a window and destroy the window.
Create a GC with window as the drawable.
Verify that a BadDrawable error occurs. 
>>ASSERTION A XCreateGC-6
When the font does not name a valid font, and the GCFont
bit is set in valuemask, then a BadFont error occurs.
>>STRATEGY
Create a font for the default screen and free font with XFreeFont.
Create a GC with root window as the drawable and bad font as the font component.
Verify that a BadFont error occurs. 
>>ASSERTION A XCreateGC-7
When the tile does not name a valid pixmap, and the GCTile
bit is set in valuemask, then a BadPixmap error occurs.
>>STRATEGY
Create a bad pixmap for the root window and free pixmap with XFreePixmap.
Create a GC with window as the drawable and pixmap as the tile.
Verify that a BadPixmap error occurs. 
>>ASSERTION A XCreateGC-8
When the stipple does not name a valid pixmap, and the
GCStipple bit is set in valuemask, then a BadPixmap error
occurs.
>>STRATEGY
Create a bad pixmap for the root window and free pixmap with XFreePixmap.
Create a GC with window as the drawable and pixmap as the stipple.
Verify that a BadPixmap error occurs. 
>>ASSERTION A XCreateGC-9
When the clip-mask does not name a valid pixmap, or None,
and the GCClipMask bit is set in valuemask, then a
BadPixmap error occurs.
>>STRATEGY
Create a bad pixmap for the root window and free pixmap with XFreePixmap.
Create a GC with window as the drawable and pixmap as the clip_mask.
Verify that a BadPixmap error occurs. 
>>ASSERTION C XCreateGC-10
When the graphics context and the tile pixmap do not have
the same depth, and the GCTile bit is set in valuemask,
then a BadMatch error occurs.
>>STRATEGY
For all non-depth1 drawables:
	Created such a drawable.
	Create a depth 1 pixmap.
	Create a GC with window as the drawable and pixmap as the tile.
	Verify that a BadMatch error occurs. 
>>ASSERTION A XCreateGC-11
When the graphics context and the tile pixmap were not
created for the same root, and the GCTile bit is set in
valuemask, then a BadMatch error occurs.
>>STRATEGY
If multiple roots are supported:
	Create a pixmap for one root.
	Create a GC for another root with pixmap as the tile component.
	Verify that a BadMatch error occurs.
>>ASSERTION C XCreateGC-12
When the stipple pixmap does not have depth one, and the
GCStipple bit is set in valuemask, then a BadMatch error
occurs.
>>STRATEGY
If pixmaps with depth other than one are supported:
	Create a pixmap with depth other than one.
  	Create a GC with the pixmap as the stipple component.
  	Verify that a BadMatch error occurs.
>>ASSERTION C XCreateGC-13
When the graphics context and the stipple pixmap were not
created for the same root, and the GCStipple bit is set in
valuemask, then a BadMatch error occurs.
>>STRATEGY
If multiple roots are supported:
	Create a pixmap for one root.
	Create a GC for another root with pixmap as the stipple component.
  	Verify that a BadMatch error occurs.
>>ASSERTION C XCreateGC-14
When the clip-mask is set to a pixmap, and the clip-mask
does not have depth one, and the GCClipMask bit is set in
valuemask, then a BadMatch error occurs.
>>STRATEGY
If pixmaps with depth other than one are supported:
	Create a pixmap with depth other than one.
  	Create a GC with the pixmap as the clip_mask component.
  	Verify that a BadMatch error occurs.
>>ASSERTION C XCreateGC-15
When the clip-mask is set to a pixmap, and the graphics
context and the clip-mask were not created for the same
root, and the GCClipMask bit is set in valuemask, then a
BadMatch error occurs.
>>STRATEGY
If multiple roots are supported:
	Create a pixmap for one root.
	Create a GC for another root with the pixmap as the clip_mask component.
  	Verify that a BadMatch error occurs.
>>ASSERTION A XCreateGC-16
When the valuemask argument is other than a bitwise OR of
none or any of GCFunction, GCPlaneMask, GCForeground,
GCBackground, GCLineWidth, GCLineStyle, GCCapStyle,
GCJoinStyle, GCFillStyle, GCFillRule, GCTile, GCStipple,
GCTileStipXOrigin, GCTileStipYOrigin, GCFont,
GCSubwindowMode, GCGraphicsExposures, GCClipXOrigin,
GCClipYOrigin, GCClipMask, GCDashOffset, GCDashList, or
GCArcMode, then a BadValue error occurs.
>>STRATEGY
Create a GC with valuemask = GCFunction | GCForeground | 
	 ~(GCFunction | GCPlaneMask | GCForeground | GCBackground |
	  GCLineWidth | GCLineStyle | GCCapStyle | GCJoinStyle |
	  GCFillStyle | GCFillRule | GCTile | GCStipple |
	  GCTileStipXOrigin | GCTileStipYOrigin | GCFont | GCSubwindowMode |
	  GCGraphicsExposures | GCClipXOrigin | GCClipYOrigin | GCClipMask |
	  GCDashOffset | GCDashList | GCArcMode.
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-17
When the function is other than GXclear, GXand,
GXandReverse, GXcopy, GXandInverted, GXnoop, GXxor,
GXor, GXnor, GXequiv, GXinvert, GXorReverse,
GXcopyInverted, GXorInverted, GXnand or GXset, and the
GCFunction bit is set in valuemask, then a BadValue error
occurs.
>>STRATEGY
Create a GC with function = GXclear + GXand + GXandReverse + GXcopy + 
	GXandInverted + GXnoop + GXxor + GXor + GXnor + GXequiv + GXinvert +
	GXorReverse + GXcopyInverted + GXorInverted + GXnand + GXset + 1
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-18
When the line_style is other than LineSolid,
LineDoubleDash or LineOnOffDash, and the GCLineStyle bit is
set in valuemask, then a BadValue error occurs.
>>STRATEGY
Create a GC with line_style = LineSolid + LineDoubleDash + LineOnOffDash + 1;
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-19
When the cap_style is other than CapNotLast, CapButt,
CapRound or CapProjecting, and the GCCapStyle bit is set in
valuemask, then a BadValue error occurs.
>>STRATEGY
Create a GC with cap_style = CapNotLast + CapButt + CapRound + CapProjecting + 1
Verify that a BadValue error occurred
>>ASSERTION A XCreateGC-20
When the join_style is other than JoinMiter, JoinRound or
JoinBevel, and the GCJoinStyle bit is set in valuemask,
then a BadValue error occurs.
>>STRATEGY
Create a GC with join_style = JoinMiter + JoinRound + JoinBevel + 1
Verify that a BadValue error occurs
>>ASSERTION A XCreateGC-21
When the fill_style is other than FillSolid, FillTiled,
FillStippled or FillOpaqueStippled, and the GCFillStyle bit
is set in valuemask, then a BadValue error occurs.
>>STRATEGY
Create a GC with fill_style = FillSolid + FillTiled + FillStippled + FillOpaqueStippled + 1
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-22
When the fill_rule is other than EvenOddRule or WindingRule,
and the GCFillRule bit is set in valuemask, then a BadValue
error occurs.
>>STRATEGY
Create a gc with fill_rule = EvenOddRule + WindingRule + 1
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-23
When arc_mode is other than ArcChord or ArcPieSlice, and
the GCArcMode bit is set in valuemask, then a BadValue
error occurs.
>>STRATEGY
Create a gc with arc_mode = ArcChord + ArcPieSlice + 1.
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-24
When the subwindow_mode is other than ClipByChildren or
IncludeInferiors, and the GCSubwindowMode bit is set in
valuemask, then a BadValue error occurs.
>>STRATEGY
Create a GC with subwindow_mode = ClipByChildren + IncludeInferiors + 1
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-25
When graphics_exposure is other than True or False, and
the GCGraphicsExposures bit is set in valuemask, then a
BadValue error occurs.
>>STRATEGY
Create a GC with graphics_exposures component set to  
	(int) False + (int) True + 1
Verify that a BadValue error occurred.
>>ASSERTION A XCreateGC-26
When dashes is set to zero, and the GCDashList bit is set
in valuemask, then a BadValue error occurs.
>>STRATEGY
Create a GC with dashes component = 0
Verify that a BadValue error occurs.
