>># 
>># 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: cpyclrmpan.m,v 1.11 92/06/11 16:15:11 rws Exp $
>># 
>>#      SCCS:  @(#)  EAll.mc Rel 1.5	    (3/12/92)
>>#      SCCS:  @(#)  ECol.mc Rel 1.4	    (7/31/91)
>>#
>>TITLE XCopyColormapAndFree CH05
>>ASSERTION A XCopyColormapAndFree-1
A call to XCopyColormapAndFree creates a colourmap of the
same visual type and for the same screen as the colormap
argument and returns the new colourmap ID.
>>STRATEGY
For each supported visual:
   Create a colourmap using XCreateColormap with alloc set to AllocNone.
   Allocate one r/o cell, get it's actual rgb values
   Allocate the rest of the cmap as r/w and store known values, read them back.
   Create a new colourmap with XCopyColormapAndFree.
   Check that it contains the values we know we had in the original.
   Verify that no error occurred.

>>ASSERTION C XCopyColormapAndFree-2
When the colormap argument was created by the client with
alloc set to AllocAll, then all entries from the argument
colormap are moved to the new colourmap with the same colour
values and are freed in colormap.
>>STRATEGY
For each supported visual class:
  Create a colormap with using XCreateColormap with alloc set to AllocAll.
  Fill with recognisable values.
  For each of the colour cells, record the rgb value with XQueryColors.
  Create a new colourmap with XCopyColormapAndFree.
  Verify that colourmap entries are identical with XQueryColors.
  Verify that all the previous cells in the original colormap are freed (i.e.
	that they can all be reallocated again).
>>ASSERTION C XCopyColormapAndFree-3
If any of the visual classes PseudoColor, GrayScale, or
DirectColor are supported: When the colormap argument was
created by the client with AllocNone, then all of the
entries from the colormap argument that have been allocated
by the client using XAllocColor, XAllocNamedColor,
XAllocColorCells, or XAllocColorPlanes and not freed since
they were allocated are moved to the new colourmap with the
same colour values and the same read-only or writable
characteristics and are freed in colormap.
>>STRATEGY
For each of the visual classes DirectColor, PseudoColor and GrayScale:
  Create a colormap with XCreateColormap and AllocNone.
  Create a  new client with XOpenDisplay.
  Allocate two ro cells for First client with XAllocColor.
  Record their rgb values.
  Allocate two rw cells for First client with XAllocColorCells.
  Set their rgb values and record their rgb values.
  Allocate the rest of the colormap for Second client  with XAllocColorCells.
  First client copies the colormap and free owned cells with with XCopyColormapAndFree.
  Verify that the Second clients cells in copy are not allocated with XAllocColorCells.
  Verify that the First clients four cells in copy are still there with correct rgb values.
  Verify that the four allocated cells are freed, can be reallocated, in old cmap.
  Verify r/o and r/w behaviour of these 4 in copy, with XStoreColors.
  
>>ASSERTION B XCopyColormapAndFree-4
When the server fails to allocate a required resource, then
a BadAlloc error occurs.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XCopyColormapAndFree-5
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.
