>># 
>># 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: prsclr.m,v 1.7 92/06/11 17:38:22 rws Exp $
>># 
>>#      SCCS:  @(#)  ECol.mc Rel 1.4	    (7/31/91)
>>#
>>TITLE XParseColor CH10
>>ASSERTION B XParseColor-1
When the first character of the spec argument is not #,
then a call to XParseColor returns in the exact_def_return
argument the rgb values for the colour named by the spec
argument on the screen associated with the colormap argument
and returns non-zero.
>>STRATEGY
Parse the color XT_GOOD_COLORNAME using XParseColor.
Verify that the call returns non-zero.
>>ASSERTION A XParseColor-2
When the first character of the spec argument is a #, and
the remainder of the string comprises 3 hexadecimal digits,
then a call to XParseColor sets the exact_def_return
argument to have red component equal to the value of the
first digit << 12, to have green component equal to the
value of the second digit << 12, to have blue component
equal to the value of the third digit << 12 and returns
non-zero.
>>STRATEGY
Parse the string "#18f" using XParseColor.
Verify that the returned XColor structure had red 0x1 green 0x8 blue 0xf.
>>ASSERTION A XParseColor-3
When the first character of the spec argument is a #, and
the remainder of the string comprises 6 hexadecimal digits,
then a call to XParseColor sets the exact_def_return
argument to have red component equal to the value of the
first two digits << 8, to have green component equal to the
value of the second two digits << 8, to have blue component
equal to the value of the third two digits << 8 and returns
non-zero.
>>STRATEGY
Parse the string "#f1f8ff" using XParseColor.
Verify that the returned XColor structure had red 0xf1 green 0xf8 blue 0xff.
>>ASSERTION A XParseColor-4
When the first character of the spec argument is a #, and
the remainder of the string comprises 9 hexadecimal digits,
then a call to XParseColor sets the exact_def_return
argument to have red component equal to the value of the
first three digits << 4, to have green component equal to
the value of the second three digits << 4, to have blue
component equal to the value of the third three digits << 4
and returns non-zero.
>>STRATEGY
Parse the string "#af1bf8cff" using XParseColor.
Verify that the returned XColor structure had red 0xaf1 green 0xbf8 blue 0xcff.
>>ASSERTION A XParseColor-5
When the first character of the spec argument is a #, and
the remainder of the string comprises 12 hexadecimal digits,
then a call to XParseColor sets the exact_def_return
argument to have red component equal to the value of the
first four digits, to have green component equal to the
value of the second four digits, to have blue component
equal to the value of the third four digits and returns
non-zero.
>>STRATEGY
Parse the string "#faf01bf81cff" using XParseColor.
Verify that the returned XColor structure had red 0xfaf0 green 0x1bf8 blue 0x1cff.
>>ASSERTION A XParseColor-6
Upper and lower case characters in the spec argument refer
to the same colour.
>>STRATEGY
Parse the string XT_GOOD_COLORNAME using XParseColor.
Verify that the call did not return zero.
Parse the string obtained by inverting each character of XT_GOOD_COLORNAME using XParseColor.
Verify that the call did not return zero.
Verify that the returned red, green and blue values are the same.
Parse the string #feAAc1 using XParseColor.
Verify that the call did not return zero.
Parse the string #FEAaC1 using XParseColor.
Verify that the call did not return zero.
Verify that the returned red, green and blue values are the same.
>>ASSERTION A XParseColor-7
A call to XParseColor sets the flags component of the
exact_def_return argument to DoRed|DoGreen|DoBlue.
>>STRATEGY
Parse the string "#000" using XParseColor.
Verify that the flags component of the returned XColor structure was DoRed|DoGreen|DoBlue.
>>ASSERTION A XParseColor-8
When the first character of the spec argument is a # and
the remainder of the string does not comprise 3, 6, 9 or 12
hexadecimal digits, then a call to XParseColor returns zero.
>>STRATEGY
Parse the string "#f0" using XParseColor.
Verify that the call returns zero.
Parse the string "#1010" using XParseColor.
Verify that the call returns zero.
Parse the string "##ffeeffeeffe" using XParseColor.
Verify that the call returns zero.
Parse the string "##0011223344556" using XParseColor.
Verify that the call returns zero.
>>ASSERTION A XParseColor-9
When the first character of the spec argument is not a #
and the colour named by the spec argument is not in the
colour database, then a call to XParseColor returns zero.
>>STRATEGY
Parse the string XT_BAD_COLORNAME using XParseColor.
Verify that the call returns zero.
>>ASSERTION A XParseColor-10
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.
