>># 
>># 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: allcclrcll.m,v 1.10 92/06/11 16:14:35 rws Exp $
>># 
>>#      SCCS:  @(#)  ECol.mc Rel 1.4	    (7/31/91)
>>#      SCCS:  @(#)  EVal.mc Rel 1.5	    (10/10/91)
>>#
>>TITLE XAllocColorCells CH05
>>ASSERTION C XAllocColorCells-1
If any of the visual classes DirectColor, PseudoColor, or
GrayScale is supported: A call to XAllocColorCells allocates
npixels*2pow(nplanes) read/write colourmap entries whose
indices in the colourmap are obtained by ORing each pixel
value returned in the pixels_return argument with zero or
more of the planes returned in the plane_mask argument.
>>STRATEGY
For each visual class DirectColor, PseudoColor and GrayScale:
  Create a colormap.
  Allocate all colors and no planemasks with XAllocColorCells.
  Verify the correct number of cells have been allocated by initialising 
    them with XStoreColors, and reading them with XQueryColors.
  Allocate planes and masks such that lg(colors) + planes = lg(colormap_size)
  Verify the correct number of cells have been allocated by initialising 
    them with XStoreColors, and reading them with XQueryColors.
>>ASSERTION C XAllocColorCells-2
If any of the visual classes DirectColor, PseudoColor, or
GrayScale is supported: A call to XAllocColorCells returns
nplanes plane masks in the plane_mask_return argument and
npixels pixel values in the pixels_return argument such that
no plane mask has a bit set in common with any other plane
mask or with any of the pixels.
>>STRATEGY
For each supported visual with r/w colour cells:
  Create a colourmap with alloc set to AllocNone.
  Allocate planes and masks such that lg(colors) + planes = lg(colormap_size)
  Form the bitwise OR of all the pixels.
  For each planemask:
    Verify that the bitwise AND of every other planemask is 0.
    Verify that the bitwise AND of the planemask and the OR of the colours is 0.
>>ASSERTION A XAllocColorCells-3
If either of the visual classes PseudoColor or GrayScale
are supported: When the visual type of the colormap argument
is PseudoColor or GrayScale, then a call to
XAllocColorCells sets exactly one bit in each plane mask in
plane_mask_return.
>>STRATEGY
For the visuals PseudoColor and GrayScale:
  Create a colourmap with alloc set to AllocNone.
  Allocate 1 color and all planemasks with XAllocColorCells.
  Verify that the number of bits set in each planemask is exactly 1.
>>ASSERTION A XAllocColorCells-4
If the visual class DirectColor is supported: When the
visual type of the colormap argument is DirectColor, then a
call to XAllocColorCells sets exactly three bits in each
plane mask in plane_mask_return.
>>STRATEGY
For the visual class DirectColor:
  Create a colormap.
  Allocate 1 color and all planemasks with XAllocColorCells.
  Verify that for each planemask exactly three bits are set.
>>ASSERTION A XAllocColorCells-5
If either of the visual classes PseudoColor or GrayScale
are supported: When the contig argument is True, and the
visual type of the colormap argument is GrayScale or
PseudoColor, then the mask formed by ORing the plane masks
in plane_mask_return contains one set of contiguous bits.
>>STRATEGY
For the visual types PseudoColor and GreyScale:
  Create a colourmap.
  Allocate 1 color and some planemasks using XAllocColorCells and contig = True.
  Form the bitwise OR of all the planemasks.
  Verify that the returned planemasks were contiguous.
>>ASSERTION A XAllocColorCells-6
If the visual class DirectColor is supported: When the
contig argument is True, and the visual type of the
colormap argument is DirectColor, then the mask formed by
ORing the plane masks in plane_mask_return contains three
sets of contiguous bits set to one, one lying in each of the
red, green and blue pixel subfields.
>>STRATEGY
For the visual class DirectColor:
  Create a colormap.
  Allocate 1 color and some planemasks using XAllocColorCells and contig = True.
  Form the bitwise OR of all the planemasks per bit set.
  Verify that the returned planemasks in the red, green and blue subfields 
    were contiguous and distinct.
>>ASSERTION A XAllocColorCells-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 A XAllocColorCells-8
When the npixels argument is zero, then a BadValue error
occurs.
>>STRATEGY
Verify that with npixels = 0, nplanes = 0, with the DefaultColormap, 
  XAllocColorCells generates a BadValue error.
>>ASSERTION A XAllocColorCells-9
When the value of contig is other than True or False, 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.
