>># 
>># 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: crtclrmp.m,v 1.12 92/06/11 16:15:27 rws Exp $
>># 
>>#      SCCS:  @(#)  EVal.mc Rel 1.5	    (10/10/91)
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#      SCCS:  @(#)  EAll.mc Rel 1.5	    (3/12/92)
>>#
>>TITLE XCreateColormap CH05
>>ASSERTION A XCreateColormap-1
A call to XCreateColormap creates a colourmap of the type
visual on the screen for which the window argument was
created and returns a colourmap ID.
>>STRATEGY
For each visual type
  Create a colourmap for that visual.
  Verify that the colourpmap is usable by  Installing it.
>>ASSERTION D XCreateColormap-2
If any of the visual classes StaticGray, StaticColor or
TrueColor are supported: When XCreateColormap is called with
a visual class that is one of StaticGray, StaticColor or
TrueColor and alloc is AllocNone, then the entries have
defined values specific to the visual that are
implementation defined.
>>STRATEGY
For the visual classes TrueColor, StaticColor and StaticGray:
  Verify that a colormap of that class can be created with XCreateColormap.
>>ASSERTION C XCreateColormap-3
If any of the visual classes PseudoColor, GrayScale or
DirectColor are supported: When XCreateColormap is called
with a visual class that is one of PseudoColor, GrayScale
or DirectColor and alloc is AllocNone, then the colourmap
has no allocated entries.
>>STRATEGY
For each visual class PseudoColor, GrayScale and DirectColor:
  Create a colourmap with alloc set to AllocNone.
  Verify that no cells were allocated by Allocating all the colourmap cells
   with XAllocColorCells.
>>ASSERTION A XCreateColormap-4
If any of the visual classes PseudoColor, GrayScale or
DirectColor are supported: When XCreateColormap is called
with a visual class that is one of PseudoColor, GrayScale
or DirectColor and the argument alloc is AllocAll, then the
entire colourmap is allocated read-write.
>>STRATEGY
For each of the visual classes DirectColor, PseudoColor and GrayScale:
  Create a colormap with alloc set to AllocAll.
  Verify that the allocation of another r/w cell fails with XAllocColorCells.
>>ASSERTION C XCreateColormap-5
If either of the visual classes GrayScale or PseudoColor
are supported: When the visual class is GrayScale or
PseudoColor, and the argument alloc is AllocAll, then a
call to XCreateColormap allocates N read-write colourmap
entries with pixel values from zero to N - 1, where N is the
number of colourmap entries value in the specified visual.
>>STRATEGY
For each of the visuals GrayScale and PseudoColor:
  Create a colormap with alloc set to AllocAll.
  For each of the 0..N-1 allocated cells:
    Write value r 31<<8, g 63<<8, b 127<<8 with XStoreColor.
>>ASSERTION C XCreateColormap-6
If the visual class DirectColor is supported: When the
visual class is DirectColor and the argument alloc is
AllocAll, then a call to XCreateColormap allocates
2pow(nred+ngreen+nblue) read-write colourmap entries with
pixel values obtained by ORing zero or more of the planes
obtained by ORing the red_mask, green_mask and blue_mask
values in the visual argument, where nreds, ngreens and
nblues are the number of bits in the respective masks.
>>STRATEGY
For the visual Directcolor:
  Create a colormap with alloc set to AllocAll.
  For each of the 0..N-1 allocated cells:
    Write value r 31<<8, g 63<<8, b 127<<8 with XStoreColor.
>>ASSERTION C XCreateColormap-7
If any of the visual classes PseudoColor, GrayScale or
DirectColor are supported: When XCreateColormap is called
with a visual class that is one of PseudoColor, GrayScale
or DirectColor and the alloc argument is AllocAll, then
none of the entries can be freed with XFreeColors().
>>STRATEGY
For the visual classes DirectColor, PseudoColor and GrayScale:
  Create a colourmap with XCreateColormap with alloc set to AllocAll.
  Deallocate a colorcell with XFreeColor.
  Allocate a colorcell with XAllocColorCell.
  Verify that the allocation failed.
>>ASSERTION C XCreateColormap-8
If any of the visual classes StaticGray, StaticColor or
TrueColor are supported: When XCreateColormap is called with
a visual that is one of StaticGray, StaticColor or
TrueColor, and the argument alloc is other than AllocNone,
then a BadMatch error occurs.
>>STRATEGY
For each visual class in TrueColor, StaticColor and StaticGray:
  Call XCreateColormap with Alloc set to AllocAll.
  Verify that a BadMatch error occurred.
>>ASSERTION D XCreateColormap-9
If there is a visual class that is not supported on the
screen: When XCreateColormap is called with a visual that is
not supported on the screen for which the window argument
was created, then a BadMatch error occurs.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XCreateColormap-10
When the value of alloc is other than AllocNone or AllocAll,
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.
>>ASSERTION A XCreateColormap-11
When XCreateColormap is called with an invalid visual, then
a BadValue error occurs.
>>STRATEGY
Make a visual structure invalid using badvis.
Create a colourmap for this visual with XCreateColorMap.
Verify that a BadValue error occurred.
>>ASSERTION A XCreateColormap-12
When a window argument does not name a valid Window, then a
BadWindow error occurs.
>>STRATEGY
Create a bad window by creating and destroying a window.
Call test function using bad window as the window argument.
Verify that a BadWindow error occurs.
>>ASSERTION B XCreateColormap-13
When the server fails to allocate a required resource, then
a BadAlloc error occurs.
>>STRATEGY
Report UNTESTED
