>># 
>># 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: strclrs.m,v 1.12 92/06/11 16:19:23 rws Exp $
>># 
>>#      SCCS:  @(#)  EAcc3.mc Rel 1.5	    (10/2/91)
>>#      SCCS:  @(#)  ECol.mc Rel 1.4	    (7/31/91)
>>#
>>TITLE XStoreColors CH05
>>ASSERTION C XStoreColors-1
If any of the visual classes DirectColor, PseudoColor or
Grayscale is supported: A call to XStoreColors obtains the
closest available RGB values for the colormap argument to
those specified in the red, green and blue components of
the XColor structures named by the color argument, and
stores those values in the read-write colourmap entries
specified by the pixel components of the XColor structures.
>>STRATEGY
For each visual class DirectColor, PseudoColor and GrayScale:
  Create a colourmap with alloc set to AllocAll;
  Store the color r = 0xffff g = 0xf1f0 b = 0x0ff8 in each cell of the colourmap with XStoreColors.
  Obtain the stored r,g b values with XQueryColors.  
  Store the obtained r,g b values in each cell with XStoreColors.
  Obtain the stored r, g, b values with XQueryColors.
  Verify that these values are identical to those originally obtained.
>>ASSERTION C XStoreColors-2
If any of the visual classes DirectColor, PseudoColor or
Grayscale is supported: A call to XStoreColors changes the
red, green and blue values in each of the ncolors read-write
colourmap entries in accordance with the flags components of
the XColor structures named by the color argument.
>>STRATEGY
For each supported visual class DirectColor, PseudoColor and GrayScale:
  Create a colormap with XCreateColormap.
  Obtain two distinct colormap values using XStoreColors and XQueryColors.
  For each possible combination DoRed, DoGreen and DoBlue in flags:
    Set all colormap cells to the first value with flags = DoRed|DoGreen|DoBlue
    Set all colormap cells to the second value with rbg components selected by the flag combination with XStoreColors.
    Verify that only the components of the colourcell specified by the flags were altered with XQueryColor.
>>ASSERTION D XStoreColors-3
When the colormap is an installed colourmap for its screen,
then any changes made by a call to XStoreColors are visible
immediately.
>>STRATEGY
Report UNTESTED
>>ASSERTION C XStoreColors-4
If any of the visual classes DirectColor, PseudoColor or
GrayScale is supported: When one or more colourmap entries
cannot be changed, then all the specified colourmap entries
that are allocated writable by any client are changed.
>>STRATEGY
If visual class is DirectColor, PseudoColor or GrayScale:
   Create a colormap with AllocNone
   Check >= 2 cells in colormap
   Allocate first cell as r/o, second as read write
   Update r/w cell to known value with XStoreColor.
   Discover what it was really set to, and remember.
   Update both cells, the r/w one to an opposite value, with XStoreColors
   Verify BadAccess occurred, will have Failed if not -- see CODE arg.
   Check that despite error the 2nd, r/w, cell was changed in value
   Repeat for next matching visual.
>>ASSERTION C XStoreColors-5
If any of the visual classes DirectColor, PseudoColor or
GrayScale is supported: When the pixel component in more
than one of the XColor structures named by the color
argument is not a valid entry in the colormap argument, then
a BadValue error occurs which will report any one of the
invalid pixel values.
>>STRATEGY
For each visual class DirectColor, PseudoColor and GrayScale:
  Create a colormap with alloc set to AllocAll.
  Store an array of 3 colorvalues with pixel values -1, 0, -2.
  Verify that a BadValue error occurs.
  Verify that the erroneous pixel was reported as either -1 or -2.
>>ASSERTION A XStoreColors-6
When an attempt to store into a read-only or an unallocated
colormap entry is made, then a BadAccess error occurs.
>>STRATEGY
For all visuals:
  Create a colormap with alloc set to AllocNone. (Unallocated for visual
	classes DirectColor, PseudoColor and GrayScale; R/O for visual
	classes TrueColor, StaticColor and StaticGray: all should
	provoke BadAccess)
  If visual class is not one of DirectColor, PseudoColor or GrayScale;
    Store distinct colors into all of the (already r/o) cells using XStoreColors.
    Verify that a BadAccess error is generated.
  Create a new client with XOpenDisplay.
  Allocate a readonly cell for the new client with XAllocColor.
  Store a value in the cell with XStoreColors.
  Verify that a BadAccess error occurred.
  Allocate a readonly cell with XAllocColor.
  Store a value in the cell with XStoreColors.
  Verify that a BadAccess error occurred.
>>ASSERTION A XStoreColors-7
When a colourmap argument does not name a valid colourmap,
then a BadColor error occurs.
>>STRATEGY
Create a bad colourmap by creating and freeing a colourmap.
Call test function using bad colourmap as the colourmap argument.
Verify that a BadColor error occurs.
>>ASSERTION D XStoreColors-8
When rmask_return, gmask_return and bmask_return have been
returned by a previous call to XAllocColorPlanes and a
read-write colourmap entry for a pixel value is changed by a
call to XStoreColors, then the pixel value is decomposed
into three components using the masks and the independent
colourmap entries are updated.
>>STRATEGY
Report UNTESTED
>>ASSERTION C XStoreColors-9
If the visual class DirectColor is supported: When the
colormap argument was created with visual type DirectColor
and with alloc set to AllocAll, and a read-write colourmap
entry for a pixel value is changed by a call to XStoreColors,
then the pixel value is decomposed into three components
using the red_mask, green_mask and blue_mask in the visual
and the independent colourmap entries are updated.
>>STRATEGY
If visual class DirectColor is supported:
   Create a colourmap using makecolmap and AlocAll
   Allocate an array of XColor's and one for each of reds, greens & blues
   Set up each of reds, greens & blues to have a distinguishable value,
     using XStoreColors, and make sure that's what's in the equivalent colourmaps.
   Read back some suitably "random" triples and check their components
   Verify that each component is the same as the corresponding entry in
     reds, greens & blues.
   Free the allocated storage: colors, reds, greens & blues.
