From 81e754dfd0fbed32efe8f3cc89675e0ff4f3b86d Mon Sep 17 00:00:00 2001 From: Dan Nicholson Date: Tue, 29 Sep 2009 06:11:54 -0700 Subject: xts5: Flatten Xopen directory more --- xts5/Xopen/.gitignore | 8 +- xts5/Xopen/Makefile.am | 8 +- xts5/Xopen/XAllocNamedColor.m | 1007 ++++++++++++++++++++++ xts5/Xopen/XAllocNamedColor/XAllocNamedColor.m | 1007 ---------------------- xts5/Xopen/XCreateFontCursor.m | 767 ++++++++++++++++ xts5/Xopen/XCreateFontCursor/XCreateFontCursor.m | 767 ---------------- xts5/Xopen/XLookupColor.m | 974 +++++++++++++++++++++ xts5/Xopen/XLookupColor/XLookupColor.m | 974 --------------------- xts5/Xopen/cursorfont.m | 879 +++++++++++++++++++ xts5/Xopen/cursorfont/cursorfont.m | 879 ------------------- xts5/scenarios/Xopen_scen | 8 +- xts5/tet_scen | 8 +- 12 files changed, 3643 insertions(+), 3643 deletions(-) create mode 100644 xts5/Xopen/XAllocNamedColor.m delete mode 100644 xts5/Xopen/XAllocNamedColor/XAllocNamedColor.m create mode 100644 xts5/Xopen/XCreateFontCursor.m delete mode 100644 xts5/Xopen/XCreateFontCursor/XCreateFontCursor.m create mode 100644 xts5/Xopen/XLookupColor.m delete mode 100644 xts5/Xopen/XLookupColor/XLookupColor.m create mode 100644 xts5/Xopen/cursorfont.m delete mode 100644 xts5/Xopen/cursorfont/cursorfont.m (limited to 'xts5') diff --git a/xts5/Xopen/.gitignore b/xts5/Xopen/.gitignore index 7754bef0..9c50c431 100644 --- a/xts5/Xopen/.gitignore +++ b/xts5/Xopen/.gitignore @@ -1,8 +1,8 @@ -XAllocNamedColor/XAllocNamedColor -cursorfont/cursorfont -XCreateFontCursor/XCreateFontCursor +XAllocNamedColor +cursorfont +XCreateFontCursor keysym/keysym keysymdef/keysymdef XKeysymToKeycode/XKeysymToKeycode -XLookupColor/XLookupColor +XLookupColor XStringToKeysym/XStringToKeysym diff --git a/xts5/Xopen/Makefile.am b/xts5/Xopen/Makefile.am index 34f29a7c..ce1dcf16 100644 --- a/xts5/Xopen/Makefile.am +++ b/xts5/Xopen/Makefile.am @@ -9,13 +9,13 @@ BUILT_SOURCES = $(tprogs:$(EXEEXT)=.c) CLEANFILES = $(BUILT_SOURCES) tprogs = \ - XAllocNamedColor/XAllocNamedColor \ - cursorfont/cursorfont \ - XCreateFontCursor/XCreateFontCursor \ + XAllocNamedColor \ + cursorfont \ + XCreateFontCursor \ keysym/keysym \ keysymdef/keysymdef \ XKeysymToKeycode/XKeysymToKeycode \ - XLookupColor/XLookupColor \ + XLookupColor \ XStringToKeysym/XStringToKeysym keysym_keysym_SOURCES = \ diff --git a/xts5/Xopen/XAllocNamedColor.m b/xts5/Xopen/XAllocNamedColor.m new file mode 100644 index 00000000..174d10fb --- /dev/null +++ b/xts5/Xopen/XAllocNamedColor.m @@ -0,0 +1,1007 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +>># Project: VSW5 +>># +>># File: xts5/Xopen/XAllocNamedColor.m +>># +>># Description: +>># Tests for XAllocNamedColor() +>># +>># Modifications: +>># $Log: allcnmdclr.m,v $ +>># Revision 1.2 2005-11-03 08:44:00 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:39 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:36:01 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:58:47 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:27:14 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:23:47 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:14:55 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:18:22 andy +>># Prepare for GA Release +>># + +/* + * SCCS: @(#) allcnmdclr.m Rel 1.10 (12/10/91) + * + * UniSoft Ltd., London, England + * + * (C) Copyright 1991 X/Open Company Limited + * + * All rights reserved. No part of this source code may be reproduced, + * stored in a retrieval system, or transmitted, in any form or by any + * means, electronic, mechanical, photocopying, recording or otherwise, + * except as stated in the end-user licence agreement, without the prior + * permission of the copyright owners. + * + * X/Open and the 'X' symbol are trademarks of X/Open Company Limited in + * the UK and other countries. + */ +>>TITLE XAllocNamedColor Xopen +Status +XAllocNamedColor(display, colormap, color_name, screen_def_return, exact_def_return) +Display *display = Dsp; +Colormap colormap = DefaultColormap(display, DefaultScreen(display)); +char *color_name = ""; +XColor *screen_def_return = &dummycol; +XColor *exact_def_return = &dummycol; +>>EXTERN + +XColor dummycol; + +static char *convertname(s) +char *s; +{ + char *res; + char *rp; + char *cp = s; + int len = strlen(s); + + if(s == (char *) NULL) + return((char *) NULL); + + if((res = rp = (char*) malloc(len + 1)) == (char *) NULL) { + delete("Malloc returned NULL."); + return((char *) NULL); + } + + while(*cp == ' ') + cp++; + + *rp++ = toupper(*cp++); + while(*cp) { + if(*cp == ' ') { + while(*cp == ' ') + cp++; + if(*cp) + *rp++ = toupper(*cp++); + } else + *rp++ = *cp++; + } + + *rp = '\0'; + return(res); +} + +>>ASSERTION Good A +When a colour name in the table is recognised on a call to xname, +then all other colour names on the same line of the table +are also recognised on another call to xname +using the same +.A display +and +.A colormap , +and the same values are returned by each call to xname in the +.M red , +.M green +and +.M blue +components of the +.S XColor +structures named by the +.A exact_def_return +argument and +.A screen_def_return +arguments. +.tL "Set" "Color name(s)" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +>>STRATEGY +For each supported visual type: + Create a colourmap of that type using XCreateColormap. + For each equivalent colour name: + Obtain the rgb values for the colour. + Verify that the exact rgb values are identical. + Verify that the supported rbg values are identical. + Free the allocated colourmap cell using XFreeColors. +>>CODE +int i; +int firstunsupported; +int secondunsupported; +XVisualInfo *vp; +Status status; +XColor exactcol, screencol; +XColor exactcol2, screencol2; +unsigned long vmask; +static char *p[5][2] = + {{ "gray", "grey"}, + { "dark gray", "dark grey"}, + { "dark slate gray", "dark slate grey"}, + { "dim gray", "dim grey"}, + { "light gray", "light grey"}}; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + for(i=0; i< NELEM(p); i++) { + + firstunsupported = secondunsupported = 0; + trace("Compare \"%s\" against \"%s\".", p[i][0], p[i][1]); + + exact_def_return = &exactcol; + screen_def_return = &screencol; + color_name= p[i][0]; + + status = XCALL; + + + if( status == (Status) 0) { + trace("Colour \"%s\" is not supported.", color_name); + firstunsupported = 1; + } else + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + + exact_def_return = &exactcol2; + screen_def_return = &screencol2; + color_name= p[i][1]; + + status = XCALL; + + if( status == (Status) 0) { + trace("Colour \"%s\" is not supported.", color_name); + secondunsupported = 1; + } else + XFreeColors(display, colormap, &(exactcol2.pixel), 1, (unsigned long)0); + + if(firstunsupported && secondunsupported) { + CHECK; + CHECK; + CHECK; + continue; + } + + if(firstunsupported && !secondunsupported) { + report("Colour %s is unsupported.", p[i][0]); + report("Colour %s is supported.", p[i][1]); + FAIL; + } else if(!firstunsupported && secondunsupported) { + report("Colour %s is unsupported.", p[i][1]); + report("Colour %s is supported.", p[i][0]); + FAIL; + } else { + CHECK; + + if((exactcol2.red != exactcol.red) || + (exactcol2.green != exactcol.green) || + (exactcol2.blue != exactcol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", + p[i][0], p[i][1]); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + exactcol.red, exactcol.green, exactcol.blue, + exactcol2.red, exactcol2.green, exactcol2.blue); + FAIL; + } else + CHECK; + + if((screencol2.red != screencol.red) || + (screencol2.green != screencol.green) || + (screencol2.blue != screencol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", + p[i][0], p[i][1]); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + screencol.red, screencol.green, screencol.blue, + screencol2.red, screencol2.green, screencol2.blue); + FAIL; + } else + CHECK; + } + + } + } + + CHECKPASS(1 + 3 * nsupvis() * NELEM(p) ); + +>>ASSERTION Good A +When a colour name in the table is recognised on a call to xname, +and a colour name on a different line of the table +is also recognised on another call to xname +using the same +.A display +and +.A colormap , +then distinct values are returned by each call to xname in the +.M red , +.M green +and +.M blue +components of the +.S XColor +structures named by the +.A exact_def_return +argument and +.A screen_def_return +arguments. +.tL "Set" "Color name(s)" +.tL "A" "black" +.tL "A" "white" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "V" "dark blue" +.tL "V" "brown" +.tL "V" "dark cyan" +.tL "V" "dark green" +.tL "V" "dark magenta" +.tL "V" "dark red" +.tL "X" "medium blue" +.tL "X" "midnight blue" +.tL "X" "navy blue" +.tL "X" "sky blue" +.tL "X" "coral" +.tL "X" "gold" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +.tL "X" "light green" +.tL "X" "forest green" +.tL "X" "lime green" +.tL "X" "pale green" +.tL "X" "spring green" +.tL "X" "maroon" +.tL "X" "orange" +.tL "X" "pink" +.tL "X" "indian red" +.tL "X" "orange red" +.tL "X" "violet red" +.tL "X" "salmon" +.tL "X" "sienna" +.tL "X" "tan" +.tL "X" "turquoise" +.tL "X" "violet" +.tL "X" "blue violet" +.tL "X" "wheat" +>>STRATEGY +For each supported visual: + Create a colourmap of that type using XCreateColormap. + For each pair of colour names in the table: + Obtain the rgb values corresponding to the name using xname. + Verify that the rgb triples are different. + Free the allocated colourmap cell using XFreeColors. +>>EXTERN +static int +compare(col1, col2, name1, name2, eflag) +XColor *col1; +XColor *col2; +char *name1; +char *name2; +int eflag; +{ + + if((col2->red == col1->red) && + (col2->green == col1->green) && + (col2->blue == col1->blue) ) { + report("Colour names \"%s\" and \"%s\" yield the same %s rgb values.", + name1, name2, eflag ? "exact" : "supported"); + trace("%s = r %u g %u b %u, %s = r %u g %u b %u", + name1, col1->red, col1->green, col1->blue, + name2, col2->red, col2->green, col2->blue); + return(0); + } + return(1); +} +>>CODE +XColor scols[43]; +XColor ecols[43]; +XColor scols2[5]; +XColor ecols2[5]; +Status status; +int i, j; +unsigned long vmask; +XVisualInfo *vp; +static char *list[43] = { + "gray", + "dark gray", + "dark slate gray", + "dim gray", + "light gray", + "black", + "white", + "blue", + "cyan", + "green", + "magenta", + "red", + "yellow", + "dark blue", + "brown", + "dark cyan", + "dark green", + "dark magenta", + "dark red", + "medium blue", + "midnight blue", + "navy blue", + "sky blue", + "coral", + "gold", + "light green", + "forest green", + "lime green", + "pale green", + "spring green", + "maroon", + "orange", + "pink", + "indian red", + "orange red", + "violet red", + "salmon", + "sienna", + "tan", + "turquoise", + "violet", + "blue violet", + "wheat"}; +static char *list2[5] = { + "grey", + "dark grey", + "dark slate grey", + "dim grey", + "light grey"}; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + for(i=0; i>ASSERTION Good A +When a colour name in the table is recognised on a call to xname, +then the colour name with the first letter of each word in upper-case +and with no spaces between words +is also recognised on another call to xname +using the same +.A display +and +.A colormap , +and the same values are returned by each call to xname in the +.M red , +.M green +and +.M blue +components of the +.S XColor +structures named by the +.A exact_def_return +argument and +.A screen_def_return +arguments. +.tL "Set" "Color name(s)" +.tL "A" "black" +.tL "A" "white" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "V" "dark blue" +.tL "V" "brown" +.tL "V" "dark cyan" +.tL "V" "dark green" +.tL "V" "dark magenta" +.tL "V" "dark red" +.tL "X" "medium blue" +.tL "X" "midnight blue" +.tL "X" "navy blue" +.tL "X" "sky blue" +.tL "X" "coral" +.tL "X" "gold" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +.tL "X" "light green" +.tL "X" "forest green" +.tL "X" "lime green" +.tL "X" "pale green" +.tL "X" "spring green" +.tL "X" "maroon" +.tL "X" "orange" +.tL "X" "pink" +.tL "X" "indian red" +.tL "X" "orange red" +.tL "X" "violet red" +.tL "X" "salmon" +.tL "X" "sienna" +.tL "X" "tan" +.tL "X" "turquoise" +.tL "X" "violet" +.tL "X" "blue violet" +.tL "X" "wheat" +>>STRATEGY +For each supported visual type: + Create a colourmap of that type using XCreateColormap. + For each equivalent colour name: + Obtain the rgb values for the colour. + Verify that the exact rgb values are identical. + Verify that the supported rbg values are identical. + Free the allocated colourmap cell using XFreeColors. +>>CODE +int i; +XVisualInfo *vp; +Status status; +XColor exactcol, screencol; +XColor exactcol2, screencol2; +unsigned long vmask; +static char *list[] = { + "black", + "white", + "blue", + "cyan", + "green", + "magenta", + "red", + "yellow", + "gray", + "grey", + "dark gray", + "dark grey", + "dark blue", + "brown", + "dark cyan", + "dark green", + "dark magenta", + "dark red", + "medium blue", + "midnight blue", + "navy blue", + "sky blue", + "coral", + "gold", + "dark slate gray", + "dark slate grey", + "dim gray", + "dim grey", + "light gray", + "light grey", + "light green", + "forest green", + "lime green", + "pale green", + "spring green", + "maroon", + "orange", + "pink", + "indian red", + "orange red", + "violet red", + "salmon", + "sienna", + "tan", + "turquoise", + "violet", + "blue violet", + "wheat" }; + + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + colormap = makecolmap(display, vp->visual, AllocNone); + exact_def_return = &exactcol; + screen_def_return = &screencol; + status = XCALL; + + if(status == (Status) 0) { + trace("Colour name \"%s\" is not supported.", color_name); + CHECK; CHECK;CHECK; + } else { + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + + color_name = convertname(list[i]); + exact_def_return = &exactcol2; + screen_def_return = &screencol2; + status = XCALL; + + if(status == 0) { + report("Colour name \"%s\" is supported but \"%s\" is not.", list[i], color_name); + FAIL; + } else { + + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + CHECK; + + if((exactcol2.red != exactcol.red) || + (exactcol2.green != exactcol.green) || + (exactcol2.blue != exactcol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", + list[i], color_name); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + exactcol.red, exactcol.green, exactcol.blue, + exactcol2.red, exactcol2.green, exactcol2.blue); + FAIL; + } else + CHECK; + + if((screencol2.red != screencol.red) || + (screencol2.green != screencol.green) || + (screencol2.blue != screencol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", + list[i], color_name); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + screencol.red, screencol.green, screencol.blue, + screencol2.red, screencol2.green, screencol2.blue); + FAIL; + } else + CHECK; + + + } + + if(!isdeleted()) + free(color_name); + + } + } + + } + + CHECKPASS(nsupvis() * 3 * NELEM(list)); + +>>ASSERTION Good A +All colour names in the table which are in set A are recognised +on a call to xname. +.tL "Set" "Color name(s)" +.tL "A" "black" +.tL "A" "white" +>>STRATEGY +For each supported visual type: + Create a colourmap of that type using XCreateColormap. + For the colournames in the table: + Obtain the rgb values for the colour using xname. + Verify that the call did not return 0. + Free the allocated colourmap cell using XFreeColors. +>>CODE +int i; +Status status; +XVisualInfo *vp; +XColor exactcol; +unsigned long vmask; +static char *list[] = { "black", "white" }; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + exact_def_return = &exactcol; + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + status = XCALL; + + if(status == 0) { + report("Colour name \"%s\" is not supported.", list[i]); + FAIL; + } else { + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + CHECK; + } + } + } + + CHECKPASS(1 + nsupvis() * NELEM(list)); + +>>ASSERTION Good C +If any of the visual classes +.S GrayScale +or +.S StaticGray +support colourmaps with at least four colour cells: +When the visual type of the +.A colormap +argument is +.S GrayScale +or +.S StaticGray , +and +.A colormap +has at least four colour cells, +then all colour names in the table which are in set M are recognised +on a call to xname. +.tL "Set" "Color name(s)" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +>>STRATEGY +If the server supports GrayScale or StaticGray with colourmap size greater than 4: + For those supported visuals: + Create a colourmap using XCreateColormap. + For each colour name in the table: + Obtain the rgb values for the for the colour using xname. + Verify that the call did not return 0. + Free the allocated colourmap cell using XFreeColors. +>>CODE +int i; +Status status; +XVisualInfo *vp; +XColor exactcol; +unsigned long vmask; +static char *list[] = { "gray", "grey", "dark gray", "dark grey" }; + + + if( (vmask = visualsupported(display, 1L<colormap_size < 4) + vmask = 0L; + } + + + if( (vmask |= visualsupported(display, 1L<colormap_size < 4) + vmask &= ~(1L<visual, AllocNone); + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + status = XCALL; + + if(status == 0L) { + report("Colour name \"%s\" is not supported.", color_name); + FAIL; + } else { + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + CHECK; + } + } + } + + CHECKPASS(1 + nsupvis()* NELEM(list)); + +>>ASSERTION Good C +If any of the visual classes +.S PseudoColor , +.S StaticColor , +.S TrueColor , +or +.S DirectColor +are supported: +When the visual type of the +.A colormap +argument is +.S PseudoColor , +.S StaticColor , +.S TrueColor , +or +.S DirectColor , +then all colour names in the table which are in set C are recognised +on a call to xname. +.tL "Set" "Color name(s)" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +>>STRATEGY +For each supported visual type from PseudoColor, StaticColor, TrueColor and DirectColor: + Create a colourmap of that type using XCreateColormap. + For the colournames in the table: + Obtain the rgb values for the colour using xname. + Verify that the call did not return 0. + Free the allocated colourmap cell using XFreeColors. +>>CODE +int i; +unsigned long vmask = (1L<visual, AllocNone); + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + status = XCALL; + + if(status == 0L) { + report("Colour name \"%s\" is not supported.", color_name); + FAIL; + } else { + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + CHECK; + } + } + } + + CHECKPASS(nsupvis() * NELEM(list) + 1); + +>>ASSERTION Good A +When a colour name in the table which is in set M, V or X +is recognised on a call to xname, +then all other colour names in the table which are in set C, M, or V +are also recognised on another call to xname. +.tL "Set" "Color name(s)" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "V" "dark blue" +.tL "V" "brown" +.tL "V" "dark cyan" +.tL "V" "dark green" +.tL "V" "dark magenta" +.tL "V" "dark red" +.tL "X" "medium blue" +.tL "X" "midnight blue" +.tL "X" "navy blue" +.tL "X" "sky blue" +.tL "X" "coral" +.tL "X" "gold" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +.tL "X" "light green" +.tL "X" "forest green" +.tL "X" "lime green" +.tL "X" "pale green" +.tL "X" "spring green" +.tL "X" "maroon" +.tL "X" "orange" +.tL "X" "pink" +.tL "X" "indian red" +.tL "X" "orange red" +.tL "X" "violet red" +.tL "X" "salmon" +.tL "X" "sienna" +.tL "X" "tan" +.tL "X" "turquoise" +.tL "X" "violet" +.tL "X" "blue violet" +.tL "X" "wheat" +>>STRATEGY +If a colourname in sets M, V or X causes xname to return non-zero: + For each supported visual: + Verify that all the colour names in C, M and V also cause xname to return non-zero: + Free the allocated colourmap cell using XFreeColors. +>>CODE +XVisualInfo *vp; +unsigned long vmask; +int i; +int j; +int supported = 0; +int unsupported = 0; +Status status; +XColor exactcol; +static char *MVX[] = { "gray", "grey", "dark gray","dark grey","dark blue","brown","dark cyan","dark green","dark magenta", + "dark red","medium blue","midnight blue","navy blue","sky blue","coral","gold","dark slate gray", + "dark slate grey","dim gray","dim grey","light gray","light grey", "light green", "forest green", + "lime green","pale green","spring green","maroon","orange","pink","indian red","orange red", + "violet red","salmon","sienna","tan","turquoise","violet","blue violet","wheat" }; +static char *CMV[] = { "blue","cyan","green","magenta","red","yellow","gray","grey","dark gray","dark grey", + "dark blue","brown","dark cyan","dark green","dark magenta","dark red"}; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + exact_def_return = &exactcol; + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + i = 0; + supported = 0; + color_name = MVX[i]; + status = XCALL; + + if(status != 0) { + supported++; + XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); + break; + } else + unsupported++; + } + + if(unsupported == NELEM(MVX) && supported == 0) { + PASS; + return; + } + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + colormap = makecolmap(display, vp->visual, AllocNone); + for(j=0; j># Project: VSW5 ->># ->># File: xts5/Xopen/XAllocNamedColor/XAllocNamedColor.m ->># ->># Description: ->># Tests for XAllocNamedColor() ->># ->># Modifications: ->># $Log: allcnmdclr.m,v $ ->># Revision 1.2 2005-11-03 08:44:00 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:39 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:36:01 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:58:47 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:27:14 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:23:47 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 09:14:55 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 01:18:22 andy ->># Prepare for GA Release ->># - -/* - * SCCS: @(#) allcnmdclr.m Rel 1.10 (12/10/91) - * - * UniSoft Ltd., London, England - * - * (C) Copyright 1991 X/Open Company Limited - * - * All rights reserved. No part of this source code may be reproduced, - * stored in a retrieval system, or transmitted, in any form or by any - * means, electronic, mechanical, photocopying, recording or otherwise, - * except as stated in the end-user licence agreement, without the prior - * permission of the copyright owners. - * - * X/Open and the 'X' symbol are trademarks of X/Open Company Limited in - * the UK and other countries. - */ ->>TITLE XAllocNamedColor Xopen -Status -XAllocNamedColor(display, colormap, color_name, screen_def_return, exact_def_return) -Display *display = Dsp; -Colormap colormap = DefaultColormap(display, DefaultScreen(display)); -char *color_name = ""; -XColor *screen_def_return = &dummycol; -XColor *exact_def_return = &dummycol; ->>EXTERN - -XColor dummycol; - -static char *convertname(s) -char *s; -{ - char *res; - char *rp; - char *cp = s; - int len = strlen(s); - - if(s == (char *) NULL) - return((char *) NULL); - - if((res = rp = (char*) malloc(len + 1)) == (char *) NULL) { - delete("Malloc returned NULL."); - return((char *) NULL); - } - - while(*cp == ' ') - cp++; - - *rp++ = toupper(*cp++); - while(*cp) { - if(*cp == ' ') { - while(*cp == ' ') - cp++; - if(*cp) - *rp++ = toupper(*cp++); - } else - *rp++ = *cp++; - } - - *rp = '\0'; - return(res); -} - ->>ASSERTION Good A -When a colour name in the table is recognised on a call to xname, -then all other colour names on the same line of the table -are also recognised on another call to xname -using the same -.A display -and -.A colormap , -and the same values are returned by each call to xname in the -.M red , -.M green -and -.M blue -components of the -.S XColor -structures named by the -.A exact_def_return -argument and -.A screen_def_return -arguments. -.tL "Set" "Color name(s)" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" ->>STRATEGY -For each supported visual type: - Create a colourmap of that type using XCreateColormap. - For each equivalent colour name: - Obtain the rgb values for the colour. - Verify that the exact rgb values are identical. - Verify that the supported rbg values are identical. - Free the allocated colourmap cell using XFreeColors. ->>CODE -int i; -int firstunsupported; -int secondunsupported; -XVisualInfo *vp; -Status status; -XColor exactcol, screencol; -XColor exactcol2, screencol2; -unsigned long vmask; -static char *p[5][2] = - {{ "gray", "grey"}, - { "dark gray", "dark grey"}, - { "dark slate gray", "dark slate grey"}, - { "dim gray", "dim grey"}, - { "light gray", "light grey"}}; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - for(i=0; i< NELEM(p); i++) { - - firstunsupported = secondunsupported = 0; - trace("Compare \"%s\" against \"%s\".", p[i][0], p[i][1]); - - exact_def_return = &exactcol; - screen_def_return = &screencol; - color_name= p[i][0]; - - status = XCALL; - - - if( status == (Status) 0) { - trace("Colour \"%s\" is not supported.", color_name); - firstunsupported = 1; - } else - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - - exact_def_return = &exactcol2; - screen_def_return = &screencol2; - color_name= p[i][1]; - - status = XCALL; - - if( status == (Status) 0) { - trace("Colour \"%s\" is not supported.", color_name); - secondunsupported = 1; - } else - XFreeColors(display, colormap, &(exactcol2.pixel), 1, (unsigned long)0); - - if(firstunsupported && secondunsupported) { - CHECK; - CHECK; - CHECK; - continue; - } - - if(firstunsupported && !secondunsupported) { - report("Colour %s is unsupported.", p[i][0]); - report("Colour %s is supported.", p[i][1]); - FAIL; - } else if(!firstunsupported && secondunsupported) { - report("Colour %s is unsupported.", p[i][1]); - report("Colour %s is supported.", p[i][0]); - FAIL; - } else { - CHECK; - - if((exactcol2.red != exactcol.red) || - (exactcol2.green != exactcol.green) || - (exactcol2.blue != exactcol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", - p[i][0], p[i][1]); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - exactcol.red, exactcol.green, exactcol.blue, - exactcol2.red, exactcol2.green, exactcol2.blue); - FAIL; - } else - CHECK; - - if((screencol2.red != screencol.red) || - (screencol2.green != screencol.green) || - (screencol2.blue != screencol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", - p[i][0], p[i][1]); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - screencol.red, screencol.green, screencol.blue, - screencol2.red, screencol2.green, screencol2.blue); - FAIL; - } else - CHECK; - } - - } - } - - CHECKPASS(1 + 3 * nsupvis() * NELEM(p) ); - ->>ASSERTION Good A -When a colour name in the table is recognised on a call to xname, -and a colour name on a different line of the table -is also recognised on another call to xname -using the same -.A display -and -.A colormap , -then distinct values are returned by each call to xname in the -.M red , -.M green -and -.M blue -components of the -.S XColor -structures named by the -.A exact_def_return -argument and -.A screen_def_return -arguments. -.tL "Set" "Color name(s)" -.tL "A" "black" -.tL "A" "white" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "V" "dark blue" -.tL "V" "brown" -.tL "V" "dark cyan" -.tL "V" "dark green" -.tL "V" "dark magenta" -.tL "V" "dark red" -.tL "X" "medium blue" -.tL "X" "midnight blue" -.tL "X" "navy blue" -.tL "X" "sky blue" -.tL "X" "coral" -.tL "X" "gold" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" -.tL "X" "light green" -.tL "X" "forest green" -.tL "X" "lime green" -.tL "X" "pale green" -.tL "X" "spring green" -.tL "X" "maroon" -.tL "X" "orange" -.tL "X" "pink" -.tL "X" "indian red" -.tL "X" "orange red" -.tL "X" "violet red" -.tL "X" "salmon" -.tL "X" "sienna" -.tL "X" "tan" -.tL "X" "turquoise" -.tL "X" "violet" -.tL "X" "blue violet" -.tL "X" "wheat" ->>STRATEGY -For each supported visual: - Create a colourmap of that type using XCreateColormap. - For each pair of colour names in the table: - Obtain the rgb values corresponding to the name using xname. - Verify that the rgb triples are different. - Free the allocated colourmap cell using XFreeColors. ->>EXTERN -static int -compare(col1, col2, name1, name2, eflag) -XColor *col1; -XColor *col2; -char *name1; -char *name2; -int eflag; -{ - - if((col2->red == col1->red) && - (col2->green == col1->green) && - (col2->blue == col1->blue) ) { - report("Colour names \"%s\" and \"%s\" yield the same %s rgb values.", - name1, name2, eflag ? "exact" : "supported"); - trace("%s = r %u g %u b %u, %s = r %u g %u b %u", - name1, col1->red, col1->green, col1->blue, - name2, col2->red, col2->green, col2->blue); - return(0); - } - return(1); -} ->>CODE -XColor scols[43]; -XColor ecols[43]; -XColor scols2[5]; -XColor ecols2[5]; -Status status; -int i, j; -unsigned long vmask; -XVisualInfo *vp; -static char *list[43] = { - "gray", - "dark gray", - "dark slate gray", - "dim gray", - "light gray", - "black", - "white", - "blue", - "cyan", - "green", - "magenta", - "red", - "yellow", - "dark blue", - "brown", - "dark cyan", - "dark green", - "dark magenta", - "dark red", - "medium blue", - "midnight blue", - "navy blue", - "sky blue", - "coral", - "gold", - "light green", - "forest green", - "lime green", - "pale green", - "spring green", - "maroon", - "orange", - "pink", - "indian red", - "orange red", - "violet red", - "salmon", - "sienna", - "tan", - "turquoise", - "violet", - "blue violet", - "wheat"}; -static char *list2[5] = { - "grey", - "dark grey", - "dark slate grey", - "dim grey", - "light grey"}; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - for(i=0; i>ASSERTION Good A -When a colour name in the table is recognised on a call to xname, -then the colour name with the first letter of each word in upper-case -and with no spaces between words -is also recognised on another call to xname -using the same -.A display -and -.A colormap , -and the same values are returned by each call to xname in the -.M red , -.M green -and -.M blue -components of the -.S XColor -structures named by the -.A exact_def_return -argument and -.A screen_def_return -arguments. -.tL "Set" "Color name(s)" -.tL "A" "black" -.tL "A" "white" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "V" "dark blue" -.tL "V" "brown" -.tL "V" "dark cyan" -.tL "V" "dark green" -.tL "V" "dark magenta" -.tL "V" "dark red" -.tL "X" "medium blue" -.tL "X" "midnight blue" -.tL "X" "navy blue" -.tL "X" "sky blue" -.tL "X" "coral" -.tL "X" "gold" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" -.tL "X" "light green" -.tL "X" "forest green" -.tL "X" "lime green" -.tL "X" "pale green" -.tL "X" "spring green" -.tL "X" "maroon" -.tL "X" "orange" -.tL "X" "pink" -.tL "X" "indian red" -.tL "X" "orange red" -.tL "X" "violet red" -.tL "X" "salmon" -.tL "X" "sienna" -.tL "X" "tan" -.tL "X" "turquoise" -.tL "X" "violet" -.tL "X" "blue violet" -.tL "X" "wheat" ->>STRATEGY -For each supported visual type: - Create a colourmap of that type using XCreateColormap. - For each equivalent colour name: - Obtain the rgb values for the colour. - Verify that the exact rgb values are identical. - Verify that the supported rbg values are identical. - Free the allocated colourmap cell using XFreeColors. ->>CODE -int i; -XVisualInfo *vp; -Status status; -XColor exactcol, screencol; -XColor exactcol2, screencol2; -unsigned long vmask; -static char *list[] = { - "black", - "white", - "blue", - "cyan", - "green", - "magenta", - "red", - "yellow", - "gray", - "grey", - "dark gray", - "dark grey", - "dark blue", - "brown", - "dark cyan", - "dark green", - "dark magenta", - "dark red", - "medium blue", - "midnight blue", - "navy blue", - "sky blue", - "coral", - "gold", - "dark slate gray", - "dark slate grey", - "dim gray", - "dim grey", - "light gray", - "light grey", - "light green", - "forest green", - "lime green", - "pale green", - "spring green", - "maroon", - "orange", - "pink", - "indian red", - "orange red", - "violet red", - "salmon", - "sienna", - "tan", - "turquoise", - "violet", - "blue violet", - "wheat" }; - - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - colormap = makecolmap(display, vp->visual, AllocNone); - exact_def_return = &exactcol; - screen_def_return = &screencol; - status = XCALL; - - if(status == (Status) 0) { - trace("Colour name \"%s\" is not supported.", color_name); - CHECK; CHECK;CHECK; - } else { - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - - color_name = convertname(list[i]); - exact_def_return = &exactcol2; - screen_def_return = &screencol2; - status = XCALL; - - if(status == 0) { - report("Colour name \"%s\" is supported but \"%s\" is not.", list[i], color_name); - FAIL; - } else { - - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - CHECK; - - if((exactcol2.red != exactcol.red) || - (exactcol2.green != exactcol.green) || - (exactcol2.blue != exactcol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", - list[i], color_name); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - exactcol.red, exactcol.green, exactcol.blue, - exactcol2.red, exactcol2.green, exactcol2.blue); - FAIL; - } else - CHECK; - - if((screencol2.red != screencol.red) || - (screencol2.green != screencol.green) || - (screencol2.blue != screencol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", - list[i], color_name); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - screencol.red, screencol.green, screencol.blue, - screencol2.red, screencol2.green, screencol2.blue); - FAIL; - } else - CHECK; - - - } - - if(!isdeleted()) - free(color_name); - - } - } - - } - - CHECKPASS(nsupvis() * 3 * NELEM(list)); - ->>ASSERTION Good A -All colour names in the table which are in set A are recognised -on a call to xname. -.tL "Set" "Color name(s)" -.tL "A" "black" -.tL "A" "white" ->>STRATEGY -For each supported visual type: - Create a colourmap of that type using XCreateColormap. - For the colournames in the table: - Obtain the rgb values for the colour using xname. - Verify that the call did not return 0. - Free the allocated colourmap cell using XFreeColors. ->>CODE -int i; -Status status; -XVisualInfo *vp; -XColor exactcol; -unsigned long vmask; -static char *list[] = { "black", "white" }; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - exact_def_return = &exactcol; - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - status = XCALL; - - if(status == 0) { - report("Colour name \"%s\" is not supported.", list[i]); - FAIL; - } else { - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - CHECK; - } - } - } - - CHECKPASS(1 + nsupvis() * NELEM(list)); - ->>ASSERTION Good C -If any of the visual classes -.S GrayScale -or -.S StaticGray -support colourmaps with at least four colour cells: -When the visual type of the -.A colormap -argument is -.S GrayScale -or -.S StaticGray , -and -.A colormap -has at least four colour cells, -then all colour names in the table which are in set M are recognised -on a call to xname. -.tL "Set" "Color name(s)" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" ->>STRATEGY -If the server supports GrayScale or StaticGray with colourmap size greater than 4: - For those supported visuals: - Create a colourmap using XCreateColormap. - For each colour name in the table: - Obtain the rgb values for the for the colour using xname. - Verify that the call did not return 0. - Free the allocated colourmap cell using XFreeColors. ->>CODE -int i; -Status status; -XVisualInfo *vp; -XColor exactcol; -unsigned long vmask; -static char *list[] = { "gray", "grey", "dark gray", "dark grey" }; - - - if( (vmask = visualsupported(display, 1L<colormap_size < 4) - vmask = 0L; - } - - - if( (vmask |= visualsupported(display, 1L<colormap_size < 4) - vmask &= ~(1L<visual, AllocNone); - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - status = XCALL; - - if(status == 0L) { - report("Colour name \"%s\" is not supported.", color_name); - FAIL; - } else { - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - CHECK; - } - } - } - - CHECKPASS(1 + nsupvis()* NELEM(list)); - ->>ASSERTION Good C -If any of the visual classes -.S PseudoColor , -.S StaticColor , -.S TrueColor , -or -.S DirectColor -are supported: -When the visual type of the -.A colormap -argument is -.S PseudoColor , -.S StaticColor , -.S TrueColor , -or -.S DirectColor , -then all colour names in the table which are in set C are recognised -on a call to xname. -.tL "Set" "Color name(s)" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" ->>STRATEGY -For each supported visual type from PseudoColor, StaticColor, TrueColor and DirectColor: - Create a colourmap of that type using XCreateColormap. - For the colournames in the table: - Obtain the rgb values for the colour using xname. - Verify that the call did not return 0. - Free the allocated colourmap cell using XFreeColors. ->>CODE -int i; -unsigned long vmask = (1L<visual, AllocNone); - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - status = XCALL; - - if(status == 0L) { - report("Colour name \"%s\" is not supported.", color_name); - FAIL; - } else { - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - CHECK; - } - } - } - - CHECKPASS(nsupvis() * NELEM(list) + 1); - ->>ASSERTION Good A -When a colour name in the table which is in set M, V or X -is recognised on a call to xname, -then all other colour names in the table which are in set C, M, or V -are also recognised on another call to xname. -.tL "Set" "Color name(s)" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "V" "dark blue" -.tL "V" "brown" -.tL "V" "dark cyan" -.tL "V" "dark green" -.tL "V" "dark magenta" -.tL "V" "dark red" -.tL "X" "medium blue" -.tL "X" "midnight blue" -.tL "X" "navy blue" -.tL "X" "sky blue" -.tL "X" "coral" -.tL "X" "gold" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" -.tL "X" "light green" -.tL "X" "forest green" -.tL "X" "lime green" -.tL "X" "pale green" -.tL "X" "spring green" -.tL "X" "maroon" -.tL "X" "orange" -.tL "X" "pink" -.tL "X" "indian red" -.tL "X" "orange red" -.tL "X" "violet red" -.tL "X" "salmon" -.tL "X" "sienna" -.tL "X" "tan" -.tL "X" "turquoise" -.tL "X" "violet" -.tL "X" "blue violet" -.tL "X" "wheat" ->>STRATEGY -If a colourname in sets M, V or X causes xname to return non-zero: - For each supported visual: - Verify that all the colour names in C, M and V also cause xname to return non-zero: - Free the allocated colourmap cell using XFreeColors. ->>CODE -XVisualInfo *vp; -unsigned long vmask; -int i; -int j; -int supported = 0; -int unsupported = 0; -Status status; -XColor exactcol; -static char *MVX[] = { "gray", "grey", "dark gray","dark grey","dark blue","brown","dark cyan","dark green","dark magenta", - "dark red","medium blue","midnight blue","navy blue","sky blue","coral","gold","dark slate gray", - "dark slate grey","dim gray","dim grey","light gray","light grey", "light green", "forest green", - "lime green","pale green","spring green","maroon","orange","pink","indian red","orange red", - "violet red","salmon","sienna","tan","turquoise","violet","blue violet","wheat" }; -static char *CMV[] = { "blue","cyan","green","magenta","red","yellow","gray","grey","dark gray","dark grey", - "dark blue","brown","dark cyan","dark green","dark magenta","dark red"}; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - exact_def_return = &exactcol; - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - i = 0; - supported = 0; - color_name = MVX[i]; - status = XCALL; - - if(status != 0) { - supported++; - XFreeColors(display, colormap, &exactcol.pixel, 1, (unsigned long)0); - break; - } else - unsupported++; - } - - if(unsupported == NELEM(MVX) && supported == 0) { - PASS; - return; - } - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - colormap = makecolmap(display, vp->visual, AllocNone); - for(j=0; j># Project: VSW5 +>># +>># File: xts5/XOPEN/XCreateFontCursor/XCreateFontCursor.m +>># +>># Description: +>># Tests for XCreateFontCursor() +>># +>># Modifications: +>># $Log: crtfntcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:44:00 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:40 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:35:30 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:57:58 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:26:44 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:23:17 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:13:22 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:16:38 andy +>># Prepare for GA Release +>># +/* + SCCS: @(#) crtfntcrsr.m Rel 1.5 (11/25/91) + + UniSoft Ltd., London, England + +(C) Copyright 1991 X/Open Company Limited + +All rights reserved. No part of this source code may be reproduced, +stored in a retrieval system, or transmitted, in any form or by any +means, electronic, mechanical, photocopying, recording or otherwise, +except as stated in the end-user licence agreement, without the prior +permission of the copyright owners. + +X/Open and the 'X' symbol are trademarks of X/Open Company Limited in +the UK and other countries. +*/ +>>TITLE XCreateFontCursor XOPEN +Cursor +XCreateFontCursor(display, shape) +Display *display = Dsp; +unsigned int shape; +>>SET startup fontstartup +>>SET cleanup fontcleanup +>>EXTERN +#include + +/* + * mkcolor() - return a pointer to a color structure. + * flag indicates whether or not color is foreground + * (Copied from rclrcrs.m.) + */ +static XColor * +mkcolor(flag) +{ + static XColor fore; + static XColor back; + static int first = 1; + + if (first) + { + first = 0; + + fore.pixel = BlackPixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); + back.pixel = WhitePixel(display, DefaultScreen(display)); + XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); + } + return(flag ? &fore : &back); +} + +static +void +test_font(symbol) +int symbol; +{ +Cursor qstat; +Window w; +XVisualInfo *vp; +int pass = 0, fail = 0; + +/* Create windows. */ + for (resetvinf(VI_WIN); nextvinf(&vp); ) { + w = makewin(display, vp); + + shape = symbol; + + trace("Shape used is %x", shape); +/* Call XCreateFontCursor with specified shape. */ + + qstat = XCALL; + +/* Verify that XCreateFontCursor returns non-zero. */ + if (qstat == 0) { + report("On a call to XCreateFontCursor,"); + report("wrong value %ld was returned", (long) qstat); + FAIL; + } else + CHECK; + +/* Call XDefineCursor and verify that no error occurs. */ + startcall(display); + if (isdeleted()) + return; + XDefineCursor(display, w, qstat); + endcall(display); + if (geterr() != Success) { + report("On a call to XDefineCursor,"); + report("Got %s, Expecting Success", errorname(geterr())); + FAIL; + } + else + CHECK; + +/* Call XRecolorCursor and verify that no error occurs. */ + startcall(display); + if (isdeleted()) + return; + XRecolorCursor(display, qstat, mkcolor(1), mkcolor(0)); + endcall(display); + if (geterr() != Success) { + report("On a call to XRecolorCursor,"); + report("Got %s, Expecting Success", errorname(geterr())); + FAIL; + } + else + CHECK; + +/* Call XFreeCursor and verify that no error occurs. */ + startcall(display); + if (isdeleted()) + return; + XFreeCursor(display, qstat); + endcall(display); + if (geterr() != Success) { + report("On a call to XFreeCursor,"); + report("Got %s, Expecting Success", errorname(geterr())); + FAIL; + } + else + CHECK; + } + + CHECKPASS(4*nvinf()); +} + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_X_cursor , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_X_cursor. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_X_cursor); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_bottom_left_corner , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_bottom_left_corner. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_bottom_left_corner); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_bottom_right_corner , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_bottom_right_corner. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_bottom_right_corner); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_top_left_corner , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_top_left_corner. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_top_left_corner); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_top_right_corner , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_top_right_corner. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_top_right_corner); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_arrow , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_arrow. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_arrow); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_based_arrow_down , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_based_arrow_down. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_based_arrow_down); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_based_arrow_up , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_based_arrow_up. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_based_arrow_up); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_double_arrow , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_double_arrow. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_double_arrow); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_question_arrow , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_question_arrow. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_question_arrow); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_sb_h_double_arrow , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_sb_h_double_arrow. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_sb_h_double_arrow); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_sb_v_double_arrow , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_sb_v_double_arrow. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_sb_v_double_arrow); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_top_left_arrow , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_top_left_arrow. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_top_left_arrow); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_bottom_tee , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_bottom_tee. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_bottom_tee); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_left_tee , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_left_tee. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_left_tee); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_right_tee , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_right_tee. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_right_tee); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_top_tee , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_top_tee. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_top_tee); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_bottom_side , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_bottom_side. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_bottom_side); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_left_side , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_left_side. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_left_side); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_right_side , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_right_side. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_right_side); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_top_side , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_top_side. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_top_side); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_ll_angle , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_ll_angle. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_ll_angle); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_lr_angle , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_lr_angle. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_lr_angle); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_ul_angle , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_ul_angle. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_ul_angle); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_ur_angle , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_ur_angle. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_ur_angle); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_circle , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_circle. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_circle); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_cross , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_cross. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_cross); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_crosshair , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_crosshair. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_crosshair); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_center_ptr , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_center_ptr. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_center_ptr); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_left_ptr , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_left_ptr. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_left_ptr); + +>>ASSERTION Good A +When the +.A shape +argument is +.S XC_right_ptr , +then a call to xname creates a +.S Cursor +and returns the cursor ID. +>>STRATEGY +Create windows. +Call XCreateFontCursor with shape XC_right_ptr. +Verify that XCreateFontCursor returns non-zero. +Call XDefineCursor and verify that no error occurs. +Call XRecolorCursor and verify that no error occurs. +Call XFreeCursor and verify that no error occurs. +>>CODE + + test_font(XC_right_ptr); + diff --git a/xts5/Xopen/XCreateFontCursor/XCreateFontCursor.m b/xts5/Xopen/XCreateFontCursor/XCreateFontCursor.m deleted file mode 100644 index 37a2f60f..00000000 --- a/xts5/Xopen/XCreateFontCursor/XCreateFontCursor.m +++ /dev/null @@ -1,767 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - ->># Project: VSW5 ->># ->># File: xts5/XOPEN/XCreateFontCursor/XCreateFontCursor.m ->># ->># Description: ->># Tests for XCreateFontCursor() ->># ->># Modifications: ->># $Log: crtfntcrsr.m,v $ ->># Revision 1.2 2005-11-03 08:44:00 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:40 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:35:30 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:57:58 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:26:44 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:23:17 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 09:13:22 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 01:16:38 andy ->># Prepare for GA Release ->># -/* - SCCS: @(#) crtfntcrsr.m Rel 1.5 (11/25/91) - - UniSoft Ltd., London, England - -(C) Copyright 1991 X/Open Company Limited - -All rights reserved. No part of this source code may be reproduced, -stored in a retrieval system, or transmitted, in any form or by any -means, electronic, mechanical, photocopying, recording or otherwise, -except as stated in the end-user licence agreement, without the prior -permission of the copyright owners. - -X/Open and the 'X' symbol are trademarks of X/Open Company Limited in -the UK and other countries. -*/ ->>TITLE XCreateFontCursor XOPEN -Cursor -XCreateFontCursor(display, shape) -Display *display = Dsp; -unsigned int shape; ->>SET startup fontstartup ->>SET cleanup fontcleanup ->>EXTERN -#include - -/* - * mkcolor() - return a pointer to a color structure. - * flag indicates whether or not color is foreground - * (Copied from rclrcrs.m.) - */ -static XColor * -mkcolor(flag) -{ - static XColor fore; - static XColor back; - static int first = 1; - - if (first) - { - first = 0; - - fore.pixel = BlackPixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &fore); - back.pixel = WhitePixel(display, DefaultScreen(display)); - XQueryColor(display, DefaultColormap(display, DefaultScreen(display)), &back); - } - return(flag ? &fore : &back); -} - -static -void -test_font(symbol) -int symbol; -{ -Cursor qstat; -Window w; -XVisualInfo *vp; -int pass = 0, fail = 0; - -/* Create windows. */ - for (resetvinf(VI_WIN); nextvinf(&vp); ) { - w = makewin(display, vp); - - shape = symbol; - - trace("Shape used is %x", shape); -/* Call XCreateFontCursor with specified shape. */ - - qstat = XCALL; - -/* Verify that XCreateFontCursor returns non-zero. */ - if (qstat == 0) { - report("On a call to XCreateFontCursor,"); - report("wrong value %ld was returned", (long) qstat); - FAIL; - } else - CHECK; - -/* Call XDefineCursor and verify that no error occurs. */ - startcall(display); - if (isdeleted()) - return; - XDefineCursor(display, w, qstat); - endcall(display); - if (geterr() != Success) { - report("On a call to XDefineCursor,"); - report("Got %s, Expecting Success", errorname(geterr())); - FAIL; - } - else - CHECK; - -/* Call XRecolorCursor and verify that no error occurs. */ - startcall(display); - if (isdeleted()) - return; - XRecolorCursor(display, qstat, mkcolor(1), mkcolor(0)); - endcall(display); - if (geterr() != Success) { - report("On a call to XRecolorCursor,"); - report("Got %s, Expecting Success", errorname(geterr())); - FAIL; - } - else - CHECK; - -/* Call XFreeCursor and verify that no error occurs. */ - startcall(display); - if (isdeleted()) - return; - XFreeCursor(display, qstat); - endcall(display); - if (geterr() != Success) { - report("On a call to XFreeCursor,"); - report("Got %s, Expecting Success", errorname(geterr())); - FAIL; - } - else - CHECK; - } - - CHECKPASS(4*nvinf()); -} - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_X_cursor , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_X_cursor. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_X_cursor); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_bottom_left_corner , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_bottom_left_corner. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_bottom_left_corner); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_bottom_right_corner , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_bottom_right_corner. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_bottom_right_corner); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_top_left_corner , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_top_left_corner. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_top_left_corner); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_top_right_corner , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_top_right_corner. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_top_right_corner); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_arrow , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_arrow. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_arrow); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_based_arrow_down , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_based_arrow_down. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_based_arrow_down); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_based_arrow_up , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_based_arrow_up. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_based_arrow_up); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_double_arrow , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_double_arrow. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_double_arrow); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_question_arrow , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_question_arrow. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_question_arrow); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_sb_h_double_arrow , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_sb_h_double_arrow. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_sb_h_double_arrow); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_sb_v_double_arrow , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_sb_v_double_arrow. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_sb_v_double_arrow); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_top_left_arrow , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_top_left_arrow. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_top_left_arrow); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_bottom_tee , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_bottom_tee. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_bottom_tee); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_left_tee , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_left_tee. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_left_tee); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_right_tee , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_right_tee. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_right_tee); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_top_tee , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_top_tee. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_top_tee); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_bottom_side , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_bottom_side. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_bottom_side); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_left_side , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_left_side. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_left_side); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_right_side , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_right_side. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_right_side); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_top_side , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_top_side. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_top_side); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_ll_angle , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_ll_angle. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_ll_angle); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_lr_angle , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_lr_angle. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_lr_angle); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_ul_angle , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_ul_angle. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_ul_angle); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_ur_angle , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_ur_angle. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_ur_angle); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_circle , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_circle. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_circle); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_cross , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_cross. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_cross); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_crosshair , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_crosshair. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_crosshair); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_center_ptr , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_center_ptr. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_center_ptr); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_left_ptr , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_left_ptr. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_left_ptr); - ->>ASSERTION Good A -When the -.A shape -argument is -.S XC_right_ptr , -then a call to xname creates a -.S Cursor -and returns the cursor ID. ->>STRATEGY -Create windows. -Call XCreateFontCursor with shape XC_right_ptr. -Verify that XCreateFontCursor returns non-zero. -Call XDefineCursor and verify that no error occurs. -Call XRecolorCursor and verify that no error occurs. -Call XFreeCursor and verify that no error occurs. ->>CODE - - test_font(XC_right_ptr); - diff --git a/xts5/Xopen/XLookupColor.m b/xts5/Xopen/XLookupColor.m new file mode 100644 index 00000000..ed870d6d --- /dev/null +++ b/xts5/Xopen/XLookupColor.m @@ -0,0 +1,974 @@ +Copyright (c) 2005 X.Org Foundation L.L.C. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies +of the Software, and to permit persons to whom the Software is furnished to do +so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. + +>># Project: VSW5 +>># +>># File: xts5/Xopen/XLookupColor.m +>># +>># Description: +>># Tests for XLookupColor() +>># +>># Modifications: +>># $Log: lkpclr.m,v $ +>># Revision 1.2 2005-11-03 08:44:00 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:40 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:35:52 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:58:34 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:27:05 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:23:39 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:14:27 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:17:52 andy +>># Prepare for GA Release +>># +/* + * SCCS: @(#) lkpclr.m Rel 1.10 (12/10/91) + * + * UniSoft Ltd., London, England + * + * (C) Copyright 1991 X/Open Company Limited + * + * All rights reserved. No part of this source code may be reproduced, + * stored in a retrieval system, or transmitted, in any form or by any + * means, electronic, mechanical, photocopying, recording or otherwise, + * except as stated in the end-user licence agreement, without the prior + * permission of the copyright owners. + * + * X/Open and the 'X' symbol are trademarks of X/Open Company Limited in + * the UK and other countries. + */ +>>TITLE XLookupColor Xopen +Status +LookupColor(display, colormap, color_name, exact_def_return, screen_def_return) +Display *display = Dsp; +Colormap colormap = DefaultColormap(display, DefaultScreen(display)); +char *color_name = ""; +XColor *exact_def_return = &dummycol; +XColor *screen_def_return = &dummycol; +>>EXTERN + +XColor dummycol; + +static char *convertname(s) +char *s; +{ + char *res; + char *rp; + char *cp = s; + int len = strlen(s); + + if(s == (char *) NULL) + return((char *) NULL); + + if((res = rp = (char*) malloc(len + 1)) == (char *) NULL) { + delete("Malloc returned NULL."); + return((char *) NULL); + } + + while(*cp == ' ') + cp++; + + *rp++ = toupper(*cp++); + while(*cp) { + if(*cp == ' ') { + while(*cp == ' ') + cp++; + if(*cp) + *rp++ = toupper(*cp++); + } else + *rp++ = *cp++; + } + + *rp = '\0'; + return(res); +} + +>>ASSERTION Good A +When a colour name in the table is recognised on a call to xname, +then all other colour names on the same line of the table +are also recognised on another call to xname +using the same +.A display +and +.A colormap , +and the same values are returned by each call to xname in the +.M red , +.M green +and +.M blue +components of the +.S XColor +structures named by the +.A exact_def_return +argument and +.A screen_def_return +arguments. +.tL "Set" "Color name(s)" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +>>STRATEGY +For each supported visual type: + Create a colourmap of that type using XCreateColormap. + For each equivalent colour name: + Obtain the rgb values for the colour. + Verify that the exact rgb values are identical. + Verify that the supported rbg values are identical. +>>CODE +int i; +int firstunsupported; +int secondunsupported; +XVisualInfo *vp; +Status status; +XColor exactcol, screencol; +XColor exactcol2, screencol2; +unsigned long vmask; +static char *p[5][2] = + {{ "gray", "grey"}, + { "dark gray", "dark grey"}, + { "dark slate gray", "dark slate grey"}, + { "dim gray", "dim grey"}, + { "light gray", "light grey"}}; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + for(i=0; i< NELEM(p); i++) { + + firstunsupported = secondunsupported = 0; + trace("Compare \"%s\" against \"%s\".", p[i][0], p[i][1]); + + exact_def_return = &exactcol; + screen_def_return = &screencol; + color_name= p[i][0]; + + status = XCALL; + + if( status == (Status) 0) { + trace("Colour \"%s\" is not supported.", color_name); + firstunsupported = 1; + } + + exact_def_return = &exactcol2; + screen_def_return = &screencol2; + color_name= p[i][1]; + + status = XCALL; + + if( status == (Status) 0) { + trace("Colour \"%s\" is not supported.", color_name); + secondunsupported = 1; + } + + if(firstunsupported && secondunsupported) { + CHECK; + CHECK; + CHECK; + continue; + } + + if(firstunsupported && !secondunsupported) { + report("Colour %s is unsupported.", p[i][0]); + report("Colour %s is supported.", p[i][1]); + FAIL; + } else if(!firstunsupported && secondunsupported) { + report("Colour %s is unsupported.", p[i][1]); + report("Colour %s is supported.", p[i][0]); + FAIL; + } else { + CHECK; + + if((exactcol2.red != exactcol.red) || + (exactcol2.green != exactcol.green) || + (exactcol2.blue != exactcol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", + p[i][0], p[i][1]); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + exactcol.red, exactcol.green, exactcol.blue, + exactcol2.red, exactcol2.green, exactcol2.blue); + FAIL; + } else + CHECK; + + if((screencol2.red != screencol.red) || + (screencol2.green != screencol.green) || + (screencol2.blue != screencol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", + p[i][0], p[i][1]); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + screencol.red, screencol.green, screencol.blue, + screencol2.red, screencol2.green, screencol2.blue); + FAIL; + } else + CHECK; + } + + } + } + + CHECKPASS(1 + 3 * nsupvis() * NELEM(p) ); + +>>ASSERTION Good A +When a colour name in the table is recognised on a call to xname, +and a colour name on a different line of the table +is also recognised on another call to xname +using the same +.A display +and +.A colormap , +then distinct values are returned by each call to xname in the +.M red , +.M green +and +.M blue +components of the +.S XColor +structures named by the +.A exact_def_return +argument and +.A screen_def_return +arguments. +.tL "Set" "Color name(s)" +.tL "A" "black" +.tL "A" "white" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "V" "dark blue" +.tL "V" "brown" +.tL "V" "dark cyan" +.tL "V" "dark green" +.tL "V" "dark magenta" +.tL "V" "dark red" +.tL "X" "medium blue" +.tL "X" "midnight blue" +.tL "X" "navy blue" +.tL "X" "sky blue" +.tL "X" "coral" +.tL "X" "gold" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +.tL "X" "light green" +.tL "X" "forest green" +.tL "X" "lime green" +.tL "X" "pale green" +.tL "X" "spring green" +.tL "X" "maroon" +.tL "X" "orange" +.tL "X" "pink" +.tL "X" "indian red" +.tL "X" "orange red" +.tL "X" "violet red" +.tL "X" "salmon" +.tL "X" "sienna" +.tL "X" "tan" +.tL "X" "turquoise" +.tL "X" "violet" +.tL "X" "blue violet" +.tL "X" "wheat" +>>STRATEGY +For each supported visual: + Create a colourmap of that type using XCreateColormap. + For each pair of colour names in the table: + Obtain the rgb values corresponding to the name using xname. + Verify that the rgb triples are different. +>>EXTERN +static int +compare(col1, col2, name1, name2, eflag) +XColor *col1; +XColor *col2; +char *name1; +char *name2; +int eflag; +{ + + if((col2->red == col1->red) && + (col2->green == col1->green) && + (col2->blue == col1->blue) ) { + report("Colour names \"%s\" and \"%s\" yield the same %s rgb values.", + name1, name2, eflag ? "exact" : "supported"); + trace("%s = r %u g %u b %u, %s = r %u g %u b %u", + name1, col1->red, col1->green, col1->blue, + name2, col2->red, col2->green, col2->blue); + return(0); + } + return(1); +} +>>CODE +XColor scols[43]; +XColor ecols[43]; +XColor scols2[5]; +XColor ecols2[5]; +Status status; +int i, j; +unsigned long vmask; +XVisualInfo *vp; +static char *list[43] = { + "gray", + "dark gray", + "dark slate gray", + "dim gray", + "light gray", + "black", + "white", + "blue", + "cyan", + "green", + "magenta", + "red", + "yellow", + "dark blue", + "brown", + "dark cyan", + "dark green", + "dark magenta", + "dark red", + "medium blue", + "midnight blue", + "navy blue", + "sky blue", + "coral", + "gold", + "light green", + "forest green", + "lime green", + "pale green", + "spring green", + "maroon", + "orange", + "pink", + "indian red", + "orange red", + "violet red", + "salmon", + "sienna", + "tan", + "turquoise", + "violet", + "blue violet", + "wheat"}; +static char *list2[5] = { + "grey", + "dark grey", + "dark slate grey", + "dim grey", + "light grey"}; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + for(i=0; i>ASSERTION Good A +When a colour name in the table is recognised on a call to xname, +then the colour name with the first letter of each word in upper-case +and with no spaces between words +is also recognised on another call to xname +using the same +.A display +and +.A colormap , +and the same values are returned by each call to xname in the +.M red , +.M green +and +.M blue +components of the +.S XColor +structures named by the +.A exact_def_return +argument and +.A screen_def_return +arguments. +.tL "Set" "Color name(s)" +.tL "A" "black" +.tL "A" "white" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "V" "dark blue" +.tL "V" "brown" +.tL "V" "dark cyan" +.tL "V" "dark green" +.tL "V" "dark magenta" +.tL "V" "dark red" +.tL "X" "medium blue" +.tL "X" "midnight blue" +.tL "X" "navy blue" +.tL "X" "sky blue" +.tL "X" "coral" +.tL "X" "gold" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +.tL "X" "light green" +.tL "X" "forest green" +.tL "X" "lime green" +.tL "X" "pale green" +.tL "X" "spring green" +.tL "X" "maroon" +.tL "X" "orange" +.tL "X" "pink" +.tL "X" "indian red" +.tL "X" "orange red" +.tL "X" "violet red" +.tL "X" "salmon" +.tL "X" "sienna" +.tL "X" "tan" +.tL "X" "turquoise" +.tL "X" "violet" +.tL "X" "blue violet" +.tL "X" "wheat" +>>STRATEGY +For each supported visual type: + Create a colourmap of that type using XCreateColormap. + For each equivalent colour name: + Obtain the rgb values for the colour. + Verify that the exact rgb values are identical. + Verify that the supported rbg values are identical. +>>CODE +int i; +XVisualInfo *vp; +Status status; +XColor exactcol, screencol; +XColor exactcol2, screencol2; +unsigned long vmask; +static char *list[] = { + "black", + "white", + "blue", + "cyan", + "green", + "magenta", + "red", + "yellow", + "gray", + "grey", + "dark gray", + "dark grey", + "dark blue", + "brown", + "dark cyan", + "dark green", + "dark magenta", + "dark red", + "medium blue", + "midnight blue", + "navy blue", + "sky blue", + "coral", + "gold", + "dark slate gray", + "dark slate grey", + "dim gray", + "dim grey", + "light gray", + "light grey", + "light green", + "forest green", + "lime green", + "pale green", + "spring green", + "maroon", + "orange", + "pink", + "indian red", + "orange red", + "violet red", + "salmon", + "sienna", + "tan", + "turquoise", + "violet", + "blue violet", + "wheat" }; + + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + colormap = makecolmap(display, vp->visual, AllocNone); + exact_def_return = &exactcol; + screen_def_return = &screencol; + status = XCALL; + + if(status == (Status) 0) { + trace("Colour name \"%s\" is not supported.", color_name); + CHECK; CHECK;CHECK; + } else { + + color_name = convertname(list[i]); + exact_def_return = &exactcol2; + screen_def_return = &screencol2; + status = XCALL; + + if(status == 0) { + report("Colour name \"%s\" is supported but \"%s\" is not.", list[i], color_name); + FAIL; + } else { + + CHECK; + + if((exactcol2.red != exactcol.red) || + (exactcol2.green != exactcol.green) || + (exactcol2.blue != exactcol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", + list[i], color_name); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + exactcol.red, exactcol.green, exactcol.blue, + exactcol2.red, exactcol2.green, exactcol2.blue); + FAIL; + } else + CHECK; + + if((screencol2.red != screencol.red) || + (screencol2.green != screencol.green) || + (screencol2.blue != screencol.blue) ) { + report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", + list[i], color_name); + report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", + screencol.red, screencol.green, screencol.blue, + screencol2.red, screencol2.green, screencol2.blue); + FAIL; + } else + CHECK; + + } + + if(!isdeleted()) + free(color_name); + } + + } + + } + + CHECKPASS(nsupvis() * 3 * NELEM(list)); + +>>ASSERTION Good A +All colour names in the table which are in set A are recognised +on a call to xname. +.tL "Set" "Color name(s)" +.tL "A" "black" +.tL "A" "white" +>>STRATEGY +For each supported visual type: + Create a colourmap of that type using XCreateColormap. + For the colournames in the table: + Obtain the rgb values for the colour using xname. + Verify that the call did not return 0. +>>CODE +int i; +Status status; +XVisualInfo *vp; +unsigned long vmask; +static char *list[] = { "black", "white" }; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + status = XCALL; + + if(status == 0) { + report("Colour name \"%s\" is not supported.", list[i]); + FAIL; + } else + CHECK; + } + } + + CHECKPASS(1 + nsupvis() * NELEM(list)); + +>>ASSERTION Good C +If any of the visual classes +.S GrayScale +or +.S StaticGray +support colourmaps with at least four colour cells: +When the visual type of the +.A colormap +argument is +.S GrayScale +or +.S StaticGray , +and +.A colormap +has at least four colour cells, +then all colour names in the table which are in set M are recognised +on a call to xname. +.tL "Set" "Color name(s)" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +>>STRATEGY +If the server supports GrayScale or StaticGray with colourmap size greater than 4: + For those supported visuals: + Create a colourmap using XCreateColormap. + For each colour name in the table: + Obtain the rgb values for the for the colour using xname. + Verify that the call did not return 0. +>>CODE +int i; +Status status; +XVisualInfo *vp; +unsigned long vmask; +static char *list[] = { "gray", "grey", "dark gray", "dark grey" }; + + + if( (vmask = visualsupported(display, 1L<colormap_size < 4) + vmask = 0L; + } + + + if( (vmask |= visualsupported(display, 1L<colormap_size < 4) + vmask &= ~(1L<visual, AllocNone); + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + status = XCALL; + + if(status == 0L) { + report("Colour name \"%s\" is not supported.", color_name); + FAIL; + } else + CHECK; + } + } + + CHECKPASS(1 + nsupvis()* NELEM(list)); + +>>ASSERTION Good C +If any of the visual classes +.S PseudoColor , +.S StaticColor , +.S TrueColor , +or +.S DirectColor +are supported: +When the visual type of the +.A colormap +argument is +.S PseudoColor , +.S StaticColor , +.S TrueColor , +or +.S DirectColor , +then all colour names in the table which are in set C are recognised +on a call to xname. +.tL "Set" "Color name(s)" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +>>STRATEGY +For each supported visual type from PseudoColor, StaticColor, TrueColor and DirectColor: + Create a colourmap of that type using XCreateColormap. + For the colournames in the table: + Obtain the rgb values for the colour using xname. + Verify that the call did not return 0. +>>CODE +int i; +unsigned long vmask = (1L<visual, AllocNone); + for(i=0; i< NELEM(list); i++) { + + color_name = list[i]; + status = XCALL; + + if(status == 0L) { + report("Colour name \"%s\" is not supported.", color_name); + FAIL; + } else + CHECK; + } + } + + CHECKPASS(nsupvis() * NELEM(list) + 1); + +>>ASSERTION Good A +When a colour name in the table which is in set M, V or X +is recognised on a call to xname, +then all other colour names in the table which are in set C, M, or V +are also recognised on another call to xname. +.tL "Set" "Color name(s)" +.tL "C" "blue" +.tL "C" "cyan" +.tL "C" "green" +.tL "C" "magenta" +.tL "C" "red" +.tL "C" "yellow" +.tL "M" "gray" "grey" +.tL "M" "dark gray" "dark grey" +.tL "V" "dark blue" +.tL "V" "brown" +.tL "V" "dark cyan" +.tL "V" "dark green" +.tL "V" "dark magenta" +.tL "V" "dark red" +.tL "X" "medium blue" +.tL "X" "midnight blue" +.tL "X" "navy blue" +.tL "X" "sky blue" +.tL "X" "coral" +.tL "X" "gold" +.tL "X" "dark slate gray" "dark slate grey" +.tL "X" "dim gray" "dim grey" +.tL "X" "light gray" "light grey" +.tL "X" "light green" +.tL "X" "forest green" +.tL "X" "lime green" +.tL "X" "pale green" +.tL "X" "spring green" +.tL "X" "maroon" +.tL "X" "orange" +.tL "X" "pink" +.tL "X" "indian red" +.tL "X" "orange red" +.tL "X" "violet red" +.tL "X" "salmon" +.tL "X" "sienna" +.tL "X" "tan" +.tL "X" "turquoise" +.tL "X" "violet" +.tL "X" "blue violet" +.tL "X" "wheat" +>>STRATEGY +If a colourname in sets M, V or X causes xname to return non-zero: + For each supported visual: + Verify that all the colour names in C, M and V also cause xname to return non-zero: +>>CODE +XVisualInfo *vp; +unsigned long vmask; +int i; +int j; +int supported = 0; +int unsupported = 0; +Status status; +static char *MVX[] = { "gray", "grey", "dark gray","dark grey","dark blue","brown","dark cyan","dark green","dark magenta", + "dark red","medium blue","midnight blue","navy blue","sky blue","coral","gold","dark slate gray", + "dark slate grey","dim gray","dim grey","light gray","light grey","light green","forest green", + "lime green","pale green","spring green","maroon","orange","pink","indian red","orange red", + "violet red","salmon","sienna","tan","turquoise","violet","blue violet","wheat" }; +static char *CMV[] = { "blue","cyan","green","magenta","red","yellow","gray","grey","dark gray","dark grey", + "dark blue","brown","dark cyan","dark green","dark magenta","dark red"}; + + if( (vmask = visualsupported(display, 0L)) == 0L) { + delete("No visuals reported as valid."); + return; + } else + CHECK; + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + + colormap = makecolmap(display, vp->visual, AllocNone); + i = 0; + supported = 0; + color_name = MVX[i]; + status = XCALL; + + if(status != 0) { + supported++; + break; + } else + unsupported++; + } + + if(unsupported == NELEM(MVX) && supported == 0) { + PASS; + return; + } + + for(resetsupvis(vmask); nextsupvis(&vp); ) { + colormap = makecolmap(display, vp->visual, AllocNone); + for(j=0; j># Project: VSW5 ->># ->># File: xts5/Xopen/XLookupColor/XLookupColor.m ->># ->># Description: ->># Tests for XLookupColor() ->># ->># Modifications: ->># $Log: lkpclr.m,v $ ->># Revision 1.2 2005-11-03 08:44:00 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:40 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:35:52 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:58:34 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:27:05 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:23:39 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 09:14:27 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 01:17:52 andy ->># Prepare for GA Release ->># -/* - * SCCS: @(#) lkpclr.m Rel 1.10 (12/10/91) - * - * UniSoft Ltd., London, England - * - * (C) Copyright 1991 X/Open Company Limited - * - * All rights reserved. No part of this source code may be reproduced, - * stored in a retrieval system, or transmitted, in any form or by any - * means, electronic, mechanical, photocopying, recording or otherwise, - * except as stated in the end-user licence agreement, without the prior - * permission of the copyright owners. - * - * X/Open and the 'X' symbol are trademarks of X/Open Company Limited in - * the UK and other countries. - */ ->>TITLE XLookupColor Xopen -Status -LookupColor(display, colormap, color_name, exact_def_return, screen_def_return) -Display *display = Dsp; -Colormap colormap = DefaultColormap(display, DefaultScreen(display)); -char *color_name = ""; -XColor *exact_def_return = &dummycol; -XColor *screen_def_return = &dummycol; ->>EXTERN - -XColor dummycol; - -static char *convertname(s) -char *s; -{ - char *res; - char *rp; - char *cp = s; - int len = strlen(s); - - if(s == (char *) NULL) - return((char *) NULL); - - if((res = rp = (char*) malloc(len + 1)) == (char *) NULL) { - delete("Malloc returned NULL."); - return((char *) NULL); - } - - while(*cp == ' ') - cp++; - - *rp++ = toupper(*cp++); - while(*cp) { - if(*cp == ' ') { - while(*cp == ' ') - cp++; - if(*cp) - *rp++ = toupper(*cp++); - } else - *rp++ = *cp++; - } - - *rp = '\0'; - return(res); -} - ->>ASSERTION Good A -When a colour name in the table is recognised on a call to xname, -then all other colour names on the same line of the table -are also recognised on another call to xname -using the same -.A display -and -.A colormap , -and the same values are returned by each call to xname in the -.M red , -.M green -and -.M blue -components of the -.S XColor -structures named by the -.A exact_def_return -argument and -.A screen_def_return -arguments. -.tL "Set" "Color name(s)" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" ->>STRATEGY -For each supported visual type: - Create a colourmap of that type using XCreateColormap. - For each equivalent colour name: - Obtain the rgb values for the colour. - Verify that the exact rgb values are identical. - Verify that the supported rbg values are identical. ->>CODE -int i; -int firstunsupported; -int secondunsupported; -XVisualInfo *vp; -Status status; -XColor exactcol, screencol; -XColor exactcol2, screencol2; -unsigned long vmask; -static char *p[5][2] = - {{ "gray", "grey"}, - { "dark gray", "dark grey"}, - { "dark slate gray", "dark slate grey"}, - { "dim gray", "dim grey"}, - { "light gray", "light grey"}}; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - for(i=0; i< NELEM(p); i++) { - - firstunsupported = secondunsupported = 0; - trace("Compare \"%s\" against \"%s\".", p[i][0], p[i][1]); - - exact_def_return = &exactcol; - screen_def_return = &screencol; - color_name= p[i][0]; - - status = XCALL; - - if( status == (Status) 0) { - trace("Colour \"%s\" is not supported.", color_name); - firstunsupported = 1; - } - - exact_def_return = &exactcol2; - screen_def_return = &screencol2; - color_name= p[i][1]; - - status = XCALL; - - if( status == (Status) 0) { - trace("Colour \"%s\" is not supported.", color_name); - secondunsupported = 1; - } - - if(firstunsupported && secondunsupported) { - CHECK; - CHECK; - CHECK; - continue; - } - - if(firstunsupported && !secondunsupported) { - report("Colour %s is unsupported.", p[i][0]); - report("Colour %s is supported.", p[i][1]); - FAIL; - } else if(!firstunsupported && secondunsupported) { - report("Colour %s is unsupported.", p[i][1]); - report("Colour %s is supported.", p[i][0]); - FAIL; - } else { - CHECK; - - if((exactcol2.red != exactcol.red) || - (exactcol2.green != exactcol.green) || - (exactcol2.blue != exactcol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", - p[i][0], p[i][1]); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - exactcol.red, exactcol.green, exactcol.blue, - exactcol2.red, exactcol2.green, exactcol2.blue); - FAIL; - } else - CHECK; - - if((screencol2.red != screencol.red) || - (screencol2.green != screencol.green) || - (screencol2.blue != screencol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", - p[i][0], p[i][1]); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - screencol.red, screencol.green, screencol.blue, - screencol2.red, screencol2.green, screencol2.blue); - FAIL; - } else - CHECK; - } - - } - } - - CHECKPASS(1 + 3 * nsupvis() * NELEM(p) ); - ->>ASSERTION Good A -When a colour name in the table is recognised on a call to xname, -and a colour name on a different line of the table -is also recognised on another call to xname -using the same -.A display -and -.A colormap , -then distinct values are returned by each call to xname in the -.M red , -.M green -and -.M blue -components of the -.S XColor -structures named by the -.A exact_def_return -argument and -.A screen_def_return -arguments. -.tL "Set" "Color name(s)" -.tL "A" "black" -.tL "A" "white" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "V" "dark blue" -.tL "V" "brown" -.tL "V" "dark cyan" -.tL "V" "dark green" -.tL "V" "dark magenta" -.tL "V" "dark red" -.tL "X" "medium blue" -.tL "X" "midnight blue" -.tL "X" "navy blue" -.tL "X" "sky blue" -.tL "X" "coral" -.tL "X" "gold" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" -.tL "X" "light green" -.tL "X" "forest green" -.tL "X" "lime green" -.tL "X" "pale green" -.tL "X" "spring green" -.tL "X" "maroon" -.tL "X" "orange" -.tL "X" "pink" -.tL "X" "indian red" -.tL "X" "orange red" -.tL "X" "violet red" -.tL "X" "salmon" -.tL "X" "sienna" -.tL "X" "tan" -.tL "X" "turquoise" -.tL "X" "violet" -.tL "X" "blue violet" -.tL "X" "wheat" ->>STRATEGY -For each supported visual: - Create a colourmap of that type using XCreateColormap. - For each pair of colour names in the table: - Obtain the rgb values corresponding to the name using xname. - Verify that the rgb triples are different. ->>EXTERN -static int -compare(col1, col2, name1, name2, eflag) -XColor *col1; -XColor *col2; -char *name1; -char *name2; -int eflag; -{ - - if((col2->red == col1->red) && - (col2->green == col1->green) && - (col2->blue == col1->blue) ) { - report("Colour names \"%s\" and \"%s\" yield the same %s rgb values.", - name1, name2, eflag ? "exact" : "supported"); - trace("%s = r %u g %u b %u, %s = r %u g %u b %u", - name1, col1->red, col1->green, col1->blue, - name2, col2->red, col2->green, col2->blue); - return(0); - } - return(1); -} ->>CODE -XColor scols[43]; -XColor ecols[43]; -XColor scols2[5]; -XColor ecols2[5]; -Status status; -int i, j; -unsigned long vmask; -XVisualInfo *vp; -static char *list[43] = { - "gray", - "dark gray", - "dark slate gray", - "dim gray", - "light gray", - "black", - "white", - "blue", - "cyan", - "green", - "magenta", - "red", - "yellow", - "dark blue", - "brown", - "dark cyan", - "dark green", - "dark magenta", - "dark red", - "medium blue", - "midnight blue", - "navy blue", - "sky blue", - "coral", - "gold", - "light green", - "forest green", - "lime green", - "pale green", - "spring green", - "maroon", - "orange", - "pink", - "indian red", - "orange red", - "violet red", - "salmon", - "sienna", - "tan", - "turquoise", - "violet", - "blue violet", - "wheat"}; -static char *list2[5] = { - "grey", - "dark grey", - "dark slate grey", - "dim grey", - "light grey"}; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - for(i=0; i>ASSERTION Good A -When a colour name in the table is recognised on a call to xname, -then the colour name with the first letter of each word in upper-case -and with no spaces between words -is also recognised on another call to xname -using the same -.A display -and -.A colormap , -and the same values are returned by each call to xname in the -.M red , -.M green -and -.M blue -components of the -.S XColor -structures named by the -.A exact_def_return -argument and -.A screen_def_return -arguments. -.tL "Set" "Color name(s)" -.tL "A" "black" -.tL "A" "white" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "V" "dark blue" -.tL "V" "brown" -.tL "V" "dark cyan" -.tL "V" "dark green" -.tL "V" "dark magenta" -.tL "V" "dark red" -.tL "X" "medium blue" -.tL "X" "midnight blue" -.tL "X" "navy blue" -.tL "X" "sky blue" -.tL "X" "coral" -.tL "X" "gold" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" -.tL "X" "light green" -.tL "X" "forest green" -.tL "X" "lime green" -.tL "X" "pale green" -.tL "X" "spring green" -.tL "X" "maroon" -.tL "X" "orange" -.tL "X" "pink" -.tL "X" "indian red" -.tL "X" "orange red" -.tL "X" "violet red" -.tL "X" "salmon" -.tL "X" "sienna" -.tL "X" "tan" -.tL "X" "turquoise" -.tL "X" "violet" -.tL "X" "blue violet" -.tL "X" "wheat" ->>STRATEGY -For each supported visual type: - Create a colourmap of that type using XCreateColormap. - For each equivalent colour name: - Obtain the rgb values for the colour. - Verify that the exact rgb values are identical. - Verify that the supported rbg values are identical. ->>CODE -int i; -XVisualInfo *vp; -Status status; -XColor exactcol, screencol; -XColor exactcol2, screencol2; -unsigned long vmask; -static char *list[] = { - "black", - "white", - "blue", - "cyan", - "green", - "magenta", - "red", - "yellow", - "gray", - "grey", - "dark gray", - "dark grey", - "dark blue", - "brown", - "dark cyan", - "dark green", - "dark magenta", - "dark red", - "medium blue", - "midnight blue", - "navy blue", - "sky blue", - "coral", - "gold", - "dark slate gray", - "dark slate grey", - "dim gray", - "dim grey", - "light gray", - "light grey", - "light green", - "forest green", - "lime green", - "pale green", - "spring green", - "maroon", - "orange", - "pink", - "indian red", - "orange red", - "violet red", - "salmon", - "sienna", - "tan", - "turquoise", - "violet", - "blue violet", - "wheat" }; - - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - colormap = makecolmap(display, vp->visual, AllocNone); - exact_def_return = &exactcol; - screen_def_return = &screencol; - status = XCALL; - - if(status == (Status) 0) { - trace("Colour name \"%s\" is not supported.", color_name); - CHECK; CHECK;CHECK; - } else { - - color_name = convertname(list[i]); - exact_def_return = &exactcol2; - screen_def_return = &screencol2; - status = XCALL; - - if(status == 0) { - report("Colour name \"%s\" is supported but \"%s\" is not.", list[i], color_name); - FAIL; - } else { - - CHECK; - - if((exactcol2.red != exactcol.red) || - (exactcol2.green != exactcol.green) || - (exactcol2.blue != exactcol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same exact rgb values.", - list[i], color_name); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - exactcol.red, exactcol.green, exactcol.blue, - exactcol2.red, exactcol2.green, exactcol2.blue); - FAIL; - } else - CHECK; - - if((screencol2.red != screencol.red) || - (screencol2.green != screencol.green) || - (screencol2.blue != screencol.blue) ) { - report("Colour names \"%s\" and \"%s\" do not yield the same supported rgb values.", - list[i], color_name); - report("( r %u g %u b %u instead of r %u g %u b %u respectively.)", - screencol.red, screencol.green, screencol.blue, - screencol2.red, screencol2.green, screencol2.blue); - FAIL; - } else - CHECK; - - } - - if(!isdeleted()) - free(color_name); - } - - } - - } - - CHECKPASS(nsupvis() * 3 * NELEM(list)); - ->>ASSERTION Good A -All colour names in the table which are in set A are recognised -on a call to xname. -.tL "Set" "Color name(s)" -.tL "A" "black" -.tL "A" "white" ->>STRATEGY -For each supported visual type: - Create a colourmap of that type using XCreateColormap. - For the colournames in the table: - Obtain the rgb values for the colour using xname. - Verify that the call did not return 0. ->>CODE -int i; -Status status; -XVisualInfo *vp; -unsigned long vmask; -static char *list[] = { "black", "white" }; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - status = XCALL; - - if(status == 0) { - report("Colour name \"%s\" is not supported.", list[i]); - FAIL; - } else - CHECK; - } - } - - CHECKPASS(1 + nsupvis() * NELEM(list)); - ->>ASSERTION Good C -If any of the visual classes -.S GrayScale -or -.S StaticGray -support colourmaps with at least four colour cells: -When the visual type of the -.A colormap -argument is -.S GrayScale -or -.S StaticGray , -and -.A colormap -has at least four colour cells, -then all colour names in the table which are in set M are recognised -on a call to xname. -.tL "Set" "Color name(s)" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" ->>STRATEGY -If the server supports GrayScale or StaticGray with colourmap size greater than 4: - For those supported visuals: - Create a colourmap using XCreateColormap. - For each colour name in the table: - Obtain the rgb values for the for the colour using xname. - Verify that the call did not return 0. ->>CODE -int i; -Status status; -XVisualInfo *vp; -unsigned long vmask; -static char *list[] = { "gray", "grey", "dark gray", "dark grey" }; - - - if( (vmask = visualsupported(display, 1L<colormap_size < 4) - vmask = 0L; - } - - - if( (vmask |= visualsupported(display, 1L<colormap_size < 4) - vmask &= ~(1L<visual, AllocNone); - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - status = XCALL; - - if(status == 0L) { - report("Colour name \"%s\" is not supported.", color_name); - FAIL; - } else - CHECK; - } - } - - CHECKPASS(1 + nsupvis()* NELEM(list)); - ->>ASSERTION Good C -If any of the visual classes -.S PseudoColor , -.S StaticColor , -.S TrueColor , -or -.S DirectColor -are supported: -When the visual type of the -.A colormap -argument is -.S PseudoColor , -.S StaticColor , -.S TrueColor , -or -.S DirectColor , -then all colour names in the table which are in set C are recognised -on a call to xname. -.tL "Set" "Color name(s)" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" ->>STRATEGY -For each supported visual type from PseudoColor, StaticColor, TrueColor and DirectColor: - Create a colourmap of that type using XCreateColormap. - For the colournames in the table: - Obtain the rgb values for the colour using xname. - Verify that the call did not return 0. ->>CODE -int i; -unsigned long vmask = (1L<visual, AllocNone); - for(i=0; i< NELEM(list); i++) { - - color_name = list[i]; - status = XCALL; - - if(status == 0L) { - report("Colour name \"%s\" is not supported.", color_name); - FAIL; - } else - CHECK; - } - } - - CHECKPASS(nsupvis() * NELEM(list) + 1); - ->>ASSERTION Good A -When a colour name in the table which is in set M, V or X -is recognised on a call to xname, -then all other colour names in the table which are in set C, M, or V -are also recognised on another call to xname. -.tL "Set" "Color name(s)" -.tL "C" "blue" -.tL "C" "cyan" -.tL "C" "green" -.tL "C" "magenta" -.tL "C" "red" -.tL "C" "yellow" -.tL "M" "gray" "grey" -.tL "M" "dark gray" "dark grey" -.tL "V" "dark blue" -.tL "V" "brown" -.tL "V" "dark cyan" -.tL "V" "dark green" -.tL "V" "dark magenta" -.tL "V" "dark red" -.tL "X" "medium blue" -.tL "X" "midnight blue" -.tL "X" "navy blue" -.tL "X" "sky blue" -.tL "X" "coral" -.tL "X" "gold" -.tL "X" "dark slate gray" "dark slate grey" -.tL "X" "dim gray" "dim grey" -.tL "X" "light gray" "light grey" -.tL "X" "light green" -.tL "X" "forest green" -.tL "X" "lime green" -.tL "X" "pale green" -.tL "X" "spring green" -.tL "X" "maroon" -.tL "X" "orange" -.tL "X" "pink" -.tL "X" "indian red" -.tL "X" "orange red" -.tL "X" "violet red" -.tL "X" "salmon" -.tL "X" "sienna" -.tL "X" "tan" -.tL "X" "turquoise" -.tL "X" "violet" -.tL "X" "blue violet" -.tL "X" "wheat" ->>STRATEGY -If a colourname in sets M, V or X causes xname to return non-zero: - For each supported visual: - Verify that all the colour names in C, M and V also cause xname to return non-zero: ->>CODE -XVisualInfo *vp; -unsigned long vmask; -int i; -int j; -int supported = 0; -int unsupported = 0; -Status status; -static char *MVX[] = { "gray", "grey", "dark gray","dark grey","dark blue","brown","dark cyan","dark green","dark magenta", - "dark red","medium blue","midnight blue","navy blue","sky blue","coral","gold","dark slate gray", - "dark slate grey","dim gray","dim grey","light gray","light grey","light green","forest green", - "lime green","pale green","spring green","maroon","orange","pink","indian red","orange red", - "violet red","salmon","sienna","tan","turquoise","violet","blue violet","wheat" }; -static char *CMV[] = { "blue","cyan","green","magenta","red","yellow","gray","grey","dark gray","dark grey", - "dark blue","brown","dark cyan","dark green","dark magenta","dark red"}; - - if( (vmask = visualsupported(display, 0L)) == 0L) { - delete("No visuals reported as valid."); - return; - } else - CHECK; - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - - colormap = makecolmap(display, vp->visual, AllocNone); - i = 0; - supported = 0; - color_name = MVX[i]; - status = XCALL; - - if(status != 0) { - supported++; - break; - } else - unsupported++; - } - - if(unsupported == NELEM(MVX) && supported == 0) { - PASS; - return; - } - - for(resetsupvis(vmask); nextsupvis(&vp); ) { - colormap = makecolmap(display, vp->visual, AllocNone); - for(j=0; j># Project: VSW5 +>># +>># File: xts5/XOPEN/cursorfont/cursorfont.m +>># +>># Description: +>># Tests for cursorfont() +>># +>># Modifications: +>># $Log: crsrfnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:00 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:39 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:35:28 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:57:57 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:26:43 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:23:16 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:13:18 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:16:33 andy +>># Prepare for GA Release +>># +/* + SCCS: @(#) crsrfnt.m Rel 1.6 (11/25/91) + + UniSoft Ltd., London, England + +(C) Copyright 1991 X/Open Company Limited + +All rights reserved. No part of this source code may be reproduced, +stored in a retrieval system, or transmitted, in any form or by any +means, electronic, mechanical, photocopying, recording or otherwise, +except as stated in the end-user licence agreement, without the prior +permission of the copyright owners. + +X/Open and the 'X' symbol are trademarks of X/Open Company Limited in +the UK and other countries. +*/ +>>TITLE cursorfont XOPEN +>>EXTERN +#include +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_X_cursor +is defined with the value 0. +>>STRATEGY +Include the file +Verify that the symbol XC_X_cursor is defined. +Verify that the symbol is defined to have value 0. +>>CODE + +#ifdef XC_X_cursor + +# if (XC_X_cursor == 0) + PASS; +# else + report("XC_X_cursor was defined to have value %ld instead of 0.", (long) XC_X_cursor); + FAIL; +# endif + +#else + report("XC_X_cursor is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_bottom_left_corner +is defined with the value 12. +>>STRATEGY +Include the file +Verify that the symbol XC_bottom_left_corner is defined. +Verify that the symbol is defined to have value 12. +>>CODE + +#ifdef XC_bottom_left_corner + +# if (XC_bottom_left_corner == 12) + PASS; +# else + report("XC_bottom_left_corner was defined to have value %ld instead of 12.", (long) XC_bottom_left_corner); + FAIL; +# endif + +#else + report("XC_bottom_left_corner is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_bottom_right_corner +is defined with the value 14. +>>STRATEGY +Include the file +Verify that the symbol XC_bottom_right_corner is defined. +Verify that the symbol is defined to have value 14. +>>CODE + +#ifdef XC_bottom_right_corner + +# if (XC_bottom_right_corner == 14) + PASS; +# else + report("XC_bottom_right_corner was defined to have value %ld instead of 14.", (long) XC_bottom_right_corner); + FAIL; +# endif + +#else + report("XC_bottom_right_corner is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_top_left_corner +is defined with the value 134. +>>STRATEGY +Include the file +Verify that the symbol XC_top_left_corner is defined. +Verify that the symbol is defined to have value 134. +>>CODE + +#ifdef XC_top_left_corner + +# if (XC_top_left_corner == 134) + PASS; +# else + report("XC_top_left_corner was defined to have value %ld instead of 134.", (long) XC_top_left_corner); + FAIL; +# endif + +#else + report("XC_top_left_corner is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_top_right_corner +is defined with the value 136. +>>STRATEGY +Include the file +Verify that the symbol XC_top_right_corner is defined. +Verify that the symbol is defined to have value 136. +>>CODE + +#ifdef XC_top_right_corner + +# if (XC_top_right_corner == 136) + PASS; +# else + report("XC_top_right_corner was defined to have value %ld instead of 136.", (long) XC_top_right_corner); + FAIL; +# endif + +#else + report("XC_top_right_corner is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_arrow +is defined with the value 2. +>>STRATEGY +Include the file +Verify that the symbol XC_arrow is defined. +Verify that the symbol is defined to have value 2. +>>CODE + +#ifdef XC_arrow + +# if (XC_arrow == 2) + PASS; +# else + report("XC_arrow was defined to have value %ld instead of 2.", (long) XC_arrow); + FAIL; +# endif + +#else + report("XC_arrow is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_based_arrow_down +is defined with the value 4. +>>STRATEGY +Include the file +Verify that the symbol XC_based_arrow_down is defined. +Verify that the symbol is defined to have value 4. +>>CODE + +#ifdef XC_based_arrow_down + +# if (XC_based_arrow_down == 4) + PASS; +# else + report("XC_based_arrow_down was defined to have value %ld instead of 4.", (long) XC_based_arrow_down); + FAIL; +# endif + +#else + report("XC_based_arrow_down is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_based_arrow_up +is defined with the value 6. +>>STRATEGY +Include the file +Verify that the symbol XC_based_arrow_up is defined. +Verify that the symbol is defined to have value 6. +>>CODE + +#ifdef XC_based_arrow_up + +# if (XC_based_arrow_up == 6) + PASS; +# else + report("XC_based_arrow_up was defined to have value %ld instead of 6.", (long) XC_based_arrow_up); + FAIL; +# endif + +#else + report("XC_based_arrow_up is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_double_arrow +is defined with the value 42. +>>STRATEGY +Include the file +Verify that the symbol XC_double_arrow is defined. +Verify that the symbol is defined to have value 42. +>>CODE + +#ifdef XC_double_arrow + +# if (XC_double_arrow == 42) + PASS; +# else + report("XC_double_arrow was defined to have value %ld instead of 42.", (long) XC_double_arrow); + FAIL; +# endif + +#else + report("XC_double_arrow is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_question_arrow +is defined with the value 92. +>>STRATEGY +Include the file +Verify that the symbol XC_question_arrow is defined. +Verify that the symbol is defined to have value 92. +>>CODE + +#ifdef XC_question_arrow + +# if (XC_question_arrow == 92) + PASS; +# else + report("XC_question_arrow was defined to have value %ld instead of 92.", (long) XC_question_arrow); + FAIL; +# endif + +#else + report("XC_question_arrow is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_sb_h_double_arrow +is defined with the value 108. +>>STRATEGY +Include the file +Verify that the symbol XC_sb_h_double_arrow is defined. +Verify that the symbol is defined to have value 108. +>>CODE + +#ifdef XC_sb_h_double_arrow + +# if (XC_sb_h_double_arrow == 108) + PASS; +# else + report("XC_sb_h_double_arrow was defined to have value %ld instead of 108.", (long) XC_sb_h_double_arrow); + FAIL; +# endif + +#else + report("XC_sb_h_double_arrow is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_sb_v_double_arrow +is defined with the value 116. +>>STRATEGY +Include the file +Verify that the symbol XC_sb_v_double_arrow is defined. +Verify that the symbol is defined to have value 116. +>>CODE + +#ifdef XC_sb_v_double_arrow + +# if (XC_sb_v_double_arrow == 116) + PASS; +# else + report("XC_sb_v_double_arrow was defined to have value %ld instead of 116.", (long) XC_sb_v_double_arrow); + FAIL; +# endif + +#else + report("XC_sb_v_double_arrow is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_top_left_arrow +is defined with the value 132. +>>STRATEGY +Include the file +Verify that the symbol XC_top_left_arrow is defined. +Verify that the symbol is defined to have value 132. +>>CODE + +#ifdef XC_top_left_arrow + +# if (XC_top_left_arrow == 132) + PASS; +# else + report("XC_top_left_arrow was defined to have value %ld instead of 132.", (long) XC_top_left_arrow); + FAIL; +# endif + +#else + report("XC_top_left_arrow is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_bottom_tee +is defined with the value 18. +>>STRATEGY +Include the file +Verify that the symbol XC_bottom_tee is defined. +Verify that the symbol is defined to have value 18. +>>CODE + +#ifdef XC_bottom_tee + +# if (XC_bottom_tee == 18) + PASS; +# else + report("XC_bottom_tee was defined to have value %ld instead of 18.", (long) XC_bottom_tee); + FAIL; +# endif + +#else + report("XC_bottom_tee is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_left_tee +is defined with the value 72. +>>STRATEGY +Include the file +Verify that the symbol XC_left_tee is defined. +Verify that the symbol is defined to have value 72. +>>CODE + +#ifdef XC_left_tee + +# if (XC_left_tee == 72) + PASS; +# else + report("XC_left_tee was defined to have value %ld instead of 72.", (long) XC_left_tee); + FAIL; +# endif + +#else + report("XC_left_tee is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_right_tee +is defined with the value 98. +>>STRATEGY +Include the file +Verify that the symbol XC_right_tee is defined. +Verify that the symbol is defined to have value 98. +>>CODE + +#ifdef XC_right_tee + +# if (XC_right_tee == 98) + PASS; +# else + report("XC_right_tee was defined to have value %ld instead of 98.", (long) XC_right_tee); + FAIL; +# endif + +#else + report("XC_right_tee is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_top_tee +is defined with the value 140. +>>STRATEGY +Include the file +Verify that the symbol XC_top_tee is defined. +Verify that the symbol is defined to have value 140. +>>CODE + +#ifdef XC_top_tee + +# if (XC_top_tee == 140) + PASS; +# else + report("XC_top_tee was defined to have value %ld instead of 140.", (long) XC_top_tee); + FAIL; +# endif + +#else + report("XC_top_tee is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_bottom_side +is defined with the value 16. +>>STRATEGY +Include the file +Verify that the symbol XC_bottom_side is defined. +Verify that the symbol is defined to have value 16. +>>CODE + +#ifdef XC_bottom_side + +# if (XC_bottom_side == 16) + PASS; +# else + report("XC_bottom_side was defined to have value %ld instead of 16.", (long) XC_bottom_side); + FAIL; +# endif + +#else + report("XC_bottom_side is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_left_side +is defined with the value 70. +>>STRATEGY +Include the file +Verify that the symbol XC_left_side is defined. +Verify that the symbol is defined to have value 70. +>>CODE + +#ifdef XC_left_side + +# if (XC_left_side == 70) + PASS; +# else + report("XC_left_side was defined to have value %ld instead of 70.", (long) XC_left_side); + FAIL; +# endif + +#else + report("XC_left_side is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_right_side +is defined with the value 96. +>>STRATEGY +Include the file +Verify that the symbol XC_right_side is defined. +Verify that the symbol is defined to have value 96. +>>CODE + +#ifdef XC_right_side + +# if (XC_right_side == 96) + PASS; +# else + report("XC_right_side was defined to have value %ld instead of 96.", (long) XC_right_side); + FAIL; +# endif + +#else + report("XC_right_side is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_top_side +is defined with the value 138. +>>STRATEGY +Include the file +Verify that the symbol XC_top_side is defined. +Verify that the symbol is defined to have value 138. +>>CODE + +#ifdef XC_top_side + +# if (XC_top_side == 138) + PASS; +# else + report("XC_top_side was defined to have value %ld instead of 138.", (long) XC_top_side); + FAIL; +# endif + +#else + report("XC_top_side is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_ll_angle +is defined with the value 76. +>>STRATEGY +Include the file +Verify that the symbol XC_ll_angle is defined. +Verify that the symbol is defined to have value 76. +>>CODE + +#ifdef XC_ll_angle + +# if (XC_ll_angle == 76) + PASS; +# else + report("XC_ll_angle was defined to have value %ld instead of 76.", (long) XC_ll_angle); + FAIL; +# endif + +#else + report("XC_ll_angle is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_lr_angle +is defined with the value 78. +>>STRATEGY +Include the file +Verify that the symbol XC_lr_angle is defined. +Verify that the symbol is defined to have value 78. +>>CODE + +#ifdef XC_lr_angle + +# if (XC_lr_angle == 78) + PASS; +# else + report("XC_lr_angle was defined to have value %ld instead of 78.", (long) XC_lr_angle); + FAIL; +# endif + +#else + report("XC_lr_angle is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_ul_angle +is defined with the value 144. +>>STRATEGY +Include the file +Verify that the symbol XC_ul_angle is defined. +Verify that the symbol is defined to have value 144. +>>CODE + +#ifdef XC_ul_angle + +# if (XC_ul_angle == 144) + PASS; +# else + report("XC_ul_angle was defined to have value %ld instead of 144.", (long) XC_ul_angle); + FAIL; +# endif + +#else + report("XC_ul_angle is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_ur_angle +is defined with the value 148. +>>STRATEGY +Include the file +Verify that the symbol XC_ur_angle is defined. +Verify that the symbol is defined to have value 148. +>>CODE + +#ifdef XC_ur_angle + +# if (XC_ur_angle == 148) + PASS; +# else + report("XC_ur_angle was defined to have value %ld instead of 148.", (long) XC_ur_angle); + FAIL; +# endif + +#else + report("XC_ur_angle is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_circle +is defined with the value 24. +>>STRATEGY +Include the file +Verify that the symbol XC_circle is defined. +Verify that the symbol is defined to have value 24. +>>CODE + +#ifdef XC_circle + +# if (XC_circle == 24) + PASS; +# else + report("XC_circle was defined to have value %ld instead of 24.", (long) XC_circle); + FAIL; +# endif + +#else + report("XC_circle is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_cross +is defined with the value 30. +>>STRATEGY +Include the file +Verify that the symbol XC_cross is defined. +Verify that the symbol is defined to have value 30. +>>CODE + +#ifdef XC_cross + +# if (XC_cross == 30) + PASS; +# else + report("XC_cross was defined to have value %ld instead of 30.", (long) XC_cross); + FAIL; +# endif + +#else + report("XC_cross is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_crosshair +is defined with the value 34. +>>STRATEGY +Include the file +Verify that the symbol XC_crosshair is defined. +Verify that the symbol is defined to have value 34. +>>CODE + +#ifdef XC_crosshair + +# if (XC_crosshair == 34) + PASS; +# else + report("XC_crosshair was defined to have value %ld instead of 34.", (long) XC_crosshair); + FAIL; +# endif + +#else + report("XC_crosshair is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_center_ptr +is defined with the value 22. +>>STRATEGY +Include the file +Verify that the symbol XC_center_ptr is defined. +Verify that the symbol is defined to have value 22. +>>CODE + +#ifdef XC_center_ptr + +# if (XC_center_ptr == 22) + PASS; +# else + report("XC_center_ptr was defined to have value %ld instead of 22.", (long) XC_center_ptr); + FAIL; +# endif + +#else + report("XC_center_ptr is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_left_ptr +is defined with the value 68. +>>STRATEGY +Include the file +Verify that the symbol XC_left_ptr is defined. +Verify that the symbol is defined to have value 68. +>>CODE + +#ifdef XC_left_ptr + +# if (XC_left_ptr == 68) + PASS; +# else + report("XC_left_ptr was defined to have value %ld instead of 68.", (long) XC_left_ptr); + FAIL; +# endif + +#else + report("XC_left_ptr is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_right_ptr +is defined with the value 94. +>>STRATEGY +Include the file +Verify that the symbol XC_right_ptr is defined. +Verify that the symbol is defined to have value 94. +>>CODE + +#ifdef XC_right_ptr + +# if (XC_right_ptr == 94) + PASS; +# else + report("XC_right_ptr was defined to have value %ld instead of 94.", (long) XC_right_ptr); + FAIL; +# endif + +#else + report("XC_right_ptr is not defined."); + FAIL; +#endif + +>>ASSERTION Good A +When the header file is included, +then the symbol +.S XC_num_glyphs +is defined with a value which is even and is not less than 150. +>>STRATEGY +Include the file +Verify that the symbol XC_num_glyphs is defined. +Verify that the sumbol value is even. +Verify that the symbol is defined to have value not less than 150. +>>CODE + +#ifdef XC_num_glyphs + + if(XC_num_glyphs < 150) { + report("XC_num_glyphs (value %ld) is less than 150.", (long) XC_num_glyphs); + FAIL; + } else + CHECK; + + if(XC_num_glyphs % 2 != 0) { + report("XC_num_glyphs (value %ld) is not even.", (long) XC_num_glyphs); + FAIL; + } else + CHECK; + + CHECKPASS(2); +#else + report("XC_num_glyphs is not defined."); + FAIL; +#endif + diff --git a/xts5/Xopen/cursorfont/cursorfont.m b/xts5/Xopen/cursorfont/cursorfont.m deleted file mode 100644 index 8fc8803a..00000000 --- a/xts5/Xopen/cursorfont/cursorfont.m +++ /dev/null @@ -1,879 +0,0 @@ -Copyright (c) 2005 X.Org Foundation L.L.C. - -Permission is hereby granted, free of charge, to any person obtaining a copy of -this software and associated documentation files (the "Software"), to deal in -the Software without restriction, including without limitation the rights to -use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies -of the Software, and to permit persons to whom the Software is furnished to do -so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. - ->># Project: VSW5 ->># ->># File: xts5/XOPEN/cursorfont/cursorfont.m ->># ->># Description: ->># Tests for cursorfont() ->># ->># Modifications: ->># $Log: crsrfnt.m,v $ ->># Revision 1.2 2005-11-03 08:44:00 jmichael ->># clean up all vsw5 paths to use xts5 instead. ->># ->># Revision 1.1.1.2 2005/04/15 14:05:39 anderson ->># Reimport of the base with the legal name in the copyright fixed. ->># ->># Revision 8.0 1998/12/23 23:35:28 mar ->># Branch point for Release 5.0.2 ->># ->># Revision 7.0 1998/10/30 22:57:57 mar ->># Branch point for Release 5.0.2b1 ->># ->># Revision 6.0 1998/03/02 05:26:43 tbr ->># Branch point for Release 5.0.1 ->># ->># Revision 5.0 1998/01/26 03:23:16 tbr ->># Branch point for Release 5.0.1b1 ->># ->># Revision 4.0 1995/12/15 09:13:18 tbr ->># Branch point for Release 5.0.0 ->># ->># Revision 3.1 1995/12/15 01:16:33 andy ->># Prepare for GA Release ->># -/* - SCCS: @(#) crsrfnt.m Rel 1.6 (11/25/91) - - UniSoft Ltd., London, England - -(C) Copyright 1991 X/Open Company Limited - -All rights reserved. No part of this source code may be reproduced, -stored in a retrieval system, or transmitted, in any form or by any -means, electronic, mechanical, photocopying, recording or otherwise, -except as stated in the end-user licence agreement, without the prior -permission of the copyright owners. - -X/Open and the 'X' symbol are trademarks of X/Open Company Limited in -the UK and other countries. -*/ ->>TITLE cursorfont XOPEN ->>EXTERN -#include ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_X_cursor -is defined with the value 0. ->>STRATEGY -Include the file -Verify that the symbol XC_X_cursor is defined. -Verify that the symbol is defined to have value 0. ->>CODE - -#ifdef XC_X_cursor - -# if (XC_X_cursor == 0) - PASS; -# else - report("XC_X_cursor was defined to have value %ld instead of 0.", (long) XC_X_cursor); - FAIL; -# endif - -#else - report("XC_X_cursor is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_bottom_left_corner -is defined with the value 12. ->>STRATEGY -Include the file -Verify that the symbol XC_bottom_left_corner is defined. -Verify that the symbol is defined to have value 12. ->>CODE - -#ifdef XC_bottom_left_corner - -# if (XC_bottom_left_corner == 12) - PASS; -# else - report("XC_bottom_left_corner was defined to have value %ld instead of 12.", (long) XC_bottom_left_corner); - FAIL; -# endif - -#else - report("XC_bottom_left_corner is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_bottom_right_corner -is defined with the value 14. ->>STRATEGY -Include the file -Verify that the symbol XC_bottom_right_corner is defined. -Verify that the symbol is defined to have value 14. ->>CODE - -#ifdef XC_bottom_right_corner - -# if (XC_bottom_right_corner == 14) - PASS; -# else - report("XC_bottom_right_corner was defined to have value %ld instead of 14.", (long) XC_bottom_right_corner); - FAIL; -# endif - -#else - report("XC_bottom_right_corner is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_top_left_corner -is defined with the value 134. ->>STRATEGY -Include the file -Verify that the symbol XC_top_left_corner is defined. -Verify that the symbol is defined to have value 134. ->>CODE - -#ifdef XC_top_left_corner - -# if (XC_top_left_corner == 134) - PASS; -# else - report("XC_top_left_corner was defined to have value %ld instead of 134.", (long) XC_top_left_corner); - FAIL; -# endif - -#else - report("XC_top_left_corner is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_top_right_corner -is defined with the value 136. ->>STRATEGY -Include the file -Verify that the symbol XC_top_right_corner is defined. -Verify that the symbol is defined to have value 136. ->>CODE - -#ifdef XC_top_right_corner - -# if (XC_top_right_corner == 136) - PASS; -# else - report("XC_top_right_corner was defined to have value %ld instead of 136.", (long) XC_top_right_corner); - FAIL; -# endif - -#else - report("XC_top_right_corner is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_arrow -is defined with the value 2. ->>STRATEGY -Include the file -Verify that the symbol XC_arrow is defined. -Verify that the symbol is defined to have value 2. ->>CODE - -#ifdef XC_arrow - -# if (XC_arrow == 2) - PASS; -# else - report("XC_arrow was defined to have value %ld instead of 2.", (long) XC_arrow); - FAIL; -# endif - -#else - report("XC_arrow is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_based_arrow_down -is defined with the value 4. ->>STRATEGY -Include the file -Verify that the symbol XC_based_arrow_down is defined. -Verify that the symbol is defined to have value 4. ->>CODE - -#ifdef XC_based_arrow_down - -# if (XC_based_arrow_down == 4) - PASS; -# else - report("XC_based_arrow_down was defined to have value %ld instead of 4.", (long) XC_based_arrow_down); - FAIL; -# endif - -#else - report("XC_based_arrow_down is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_based_arrow_up -is defined with the value 6. ->>STRATEGY -Include the file -Verify that the symbol XC_based_arrow_up is defined. -Verify that the symbol is defined to have value 6. ->>CODE - -#ifdef XC_based_arrow_up - -# if (XC_based_arrow_up == 6) - PASS; -# else - report("XC_based_arrow_up was defined to have value %ld instead of 6.", (long) XC_based_arrow_up); - FAIL; -# endif - -#else - report("XC_based_arrow_up is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_double_arrow -is defined with the value 42. ->>STRATEGY -Include the file -Verify that the symbol XC_double_arrow is defined. -Verify that the symbol is defined to have value 42. ->>CODE - -#ifdef XC_double_arrow - -# if (XC_double_arrow == 42) - PASS; -# else - report("XC_double_arrow was defined to have value %ld instead of 42.", (long) XC_double_arrow); - FAIL; -# endif - -#else - report("XC_double_arrow is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_question_arrow -is defined with the value 92. ->>STRATEGY -Include the file -Verify that the symbol XC_question_arrow is defined. -Verify that the symbol is defined to have value 92. ->>CODE - -#ifdef XC_question_arrow - -# if (XC_question_arrow == 92) - PASS; -# else - report("XC_question_arrow was defined to have value %ld instead of 92.", (long) XC_question_arrow); - FAIL; -# endif - -#else - report("XC_question_arrow is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_sb_h_double_arrow -is defined with the value 108. ->>STRATEGY -Include the file -Verify that the symbol XC_sb_h_double_arrow is defined. -Verify that the symbol is defined to have value 108. ->>CODE - -#ifdef XC_sb_h_double_arrow - -# if (XC_sb_h_double_arrow == 108) - PASS; -# else - report("XC_sb_h_double_arrow was defined to have value %ld instead of 108.", (long) XC_sb_h_double_arrow); - FAIL; -# endif - -#else - report("XC_sb_h_double_arrow is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_sb_v_double_arrow -is defined with the value 116. ->>STRATEGY -Include the file -Verify that the symbol XC_sb_v_double_arrow is defined. -Verify that the symbol is defined to have value 116. ->>CODE - -#ifdef XC_sb_v_double_arrow - -# if (XC_sb_v_double_arrow == 116) - PASS; -# else - report("XC_sb_v_double_arrow was defined to have value %ld instead of 116.", (long) XC_sb_v_double_arrow); - FAIL; -# endif - -#else - report("XC_sb_v_double_arrow is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_top_left_arrow -is defined with the value 132. ->>STRATEGY -Include the file -Verify that the symbol XC_top_left_arrow is defined. -Verify that the symbol is defined to have value 132. ->>CODE - -#ifdef XC_top_left_arrow - -# if (XC_top_left_arrow == 132) - PASS; -# else - report("XC_top_left_arrow was defined to have value %ld instead of 132.", (long) XC_top_left_arrow); - FAIL; -# endif - -#else - report("XC_top_left_arrow is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_bottom_tee -is defined with the value 18. ->>STRATEGY -Include the file -Verify that the symbol XC_bottom_tee is defined. -Verify that the symbol is defined to have value 18. ->>CODE - -#ifdef XC_bottom_tee - -# if (XC_bottom_tee == 18) - PASS; -# else - report("XC_bottom_tee was defined to have value %ld instead of 18.", (long) XC_bottom_tee); - FAIL; -# endif - -#else - report("XC_bottom_tee is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_left_tee -is defined with the value 72. ->>STRATEGY -Include the file -Verify that the symbol XC_left_tee is defined. -Verify that the symbol is defined to have value 72. ->>CODE - -#ifdef XC_left_tee - -# if (XC_left_tee == 72) - PASS; -# else - report("XC_left_tee was defined to have value %ld instead of 72.", (long) XC_left_tee); - FAIL; -# endif - -#else - report("XC_left_tee is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_right_tee -is defined with the value 98. ->>STRATEGY -Include the file -Verify that the symbol XC_right_tee is defined. -Verify that the symbol is defined to have value 98. ->>CODE - -#ifdef XC_right_tee - -# if (XC_right_tee == 98) - PASS; -# else - report("XC_right_tee was defined to have value %ld instead of 98.", (long) XC_right_tee); - FAIL; -# endif - -#else - report("XC_right_tee is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_top_tee -is defined with the value 140. ->>STRATEGY -Include the file -Verify that the symbol XC_top_tee is defined. -Verify that the symbol is defined to have value 140. ->>CODE - -#ifdef XC_top_tee - -# if (XC_top_tee == 140) - PASS; -# else - report("XC_top_tee was defined to have value %ld instead of 140.", (long) XC_top_tee); - FAIL; -# endif - -#else - report("XC_top_tee is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_bottom_side -is defined with the value 16. ->>STRATEGY -Include the file -Verify that the symbol XC_bottom_side is defined. -Verify that the symbol is defined to have value 16. ->>CODE - -#ifdef XC_bottom_side - -# if (XC_bottom_side == 16) - PASS; -# else - report("XC_bottom_side was defined to have value %ld instead of 16.", (long) XC_bottom_side); - FAIL; -# endif - -#else - report("XC_bottom_side is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_left_side -is defined with the value 70. ->>STRATEGY -Include the file -Verify that the symbol XC_left_side is defined. -Verify that the symbol is defined to have value 70. ->>CODE - -#ifdef XC_left_side - -# if (XC_left_side == 70) - PASS; -# else - report("XC_left_side was defined to have value %ld instead of 70.", (long) XC_left_side); - FAIL; -# endif - -#else - report("XC_left_side is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_right_side -is defined with the value 96. ->>STRATEGY -Include the file -Verify that the symbol XC_right_side is defined. -Verify that the symbol is defined to have value 96. ->>CODE - -#ifdef XC_right_side - -# if (XC_right_side == 96) - PASS; -# else - report("XC_right_side was defined to have value %ld instead of 96.", (long) XC_right_side); - FAIL; -# endif - -#else - report("XC_right_side is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_top_side -is defined with the value 138. ->>STRATEGY -Include the file -Verify that the symbol XC_top_side is defined. -Verify that the symbol is defined to have value 138. ->>CODE - -#ifdef XC_top_side - -# if (XC_top_side == 138) - PASS; -# else - report("XC_top_side was defined to have value %ld instead of 138.", (long) XC_top_side); - FAIL; -# endif - -#else - report("XC_top_side is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_ll_angle -is defined with the value 76. ->>STRATEGY -Include the file -Verify that the symbol XC_ll_angle is defined. -Verify that the symbol is defined to have value 76. ->>CODE - -#ifdef XC_ll_angle - -# if (XC_ll_angle == 76) - PASS; -# else - report("XC_ll_angle was defined to have value %ld instead of 76.", (long) XC_ll_angle); - FAIL; -# endif - -#else - report("XC_ll_angle is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_lr_angle -is defined with the value 78. ->>STRATEGY -Include the file -Verify that the symbol XC_lr_angle is defined. -Verify that the symbol is defined to have value 78. ->>CODE - -#ifdef XC_lr_angle - -# if (XC_lr_angle == 78) - PASS; -# else - report("XC_lr_angle was defined to have value %ld instead of 78.", (long) XC_lr_angle); - FAIL; -# endif - -#else - report("XC_lr_angle is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_ul_angle -is defined with the value 144. ->>STRATEGY -Include the file -Verify that the symbol XC_ul_angle is defined. -Verify that the symbol is defined to have value 144. ->>CODE - -#ifdef XC_ul_angle - -# if (XC_ul_angle == 144) - PASS; -# else - report("XC_ul_angle was defined to have value %ld instead of 144.", (long) XC_ul_angle); - FAIL; -# endif - -#else - report("XC_ul_angle is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_ur_angle -is defined with the value 148. ->>STRATEGY -Include the file -Verify that the symbol XC_ur_angle is defined. -Verify that the symbol is defined to have value 148. ->>CODE - -#ifdef XC_ur_angle - -# if (XC_ur_angle == 148) - PASS; -# else - report("XC_ur_angle was defined to have value %ld instead of 148.", (long) XC_ur_angle); - FAIL; -# endif - -#else - report("XC_ur_angle is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_circle -is defined with the value 24. ->>STRATEGY -Include the file -Verify that the symbol XC_circle is defined. -Verify that the symbol is defined to have value 24. ->>CODE - -#ifdef XC_circle - -# if (XC_circle == 24) - PASS; -# else - report("XC_circle was defined to have value %ld instead of 24.", (long) XC_circle); - FAIL; -# endif - -#else - report("XC_circle is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_cross -is defined with the value 30. ->>STRATEGY -Include the file -Verify that the symbol XC_cross is defined. -Verify that the symbol is defined to have value 30. ->>CODE - -#ifdef XC_cross - -# if (XC_cross == 30) - PASS; -# else - report("XC_cross was defined to have value %ld instead of 30.", (long) XC_cross); - FAIL; -# endif - -#else - report("XC_cross is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_crosshair -is defined with the value 34. ->>STRATEGY -Include the file -Verify that the symbol XC_crosshair is defined. -Verify that the symbol is defined to have value 34. ->>CODE - -#ifdef XC_crosshair - -# if (XC_crosshair == 34) - PASS; -# else - report("XC_crosshair was defined to have value %ld instead of 34.", (long) XC_crosshair); - FAIL; -# endif - -#else - report("XC_crosshair is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_center_ptr -is defined with the value 22. ->>STRATEGY -Include the file -Verify that the symbol XC_center_ptr is defined. -Verify that the symbol is defined to have value 22. ->>CODE - -#ifdef XC_center_ptr - -# if (XC_center_ptr == 22) - PASS; -# else - report("XC_center_ptr was defined to have value %ld instead of 22.", (long) XC_center_ptr); - FAIL; -# endif - -#else - report("XC_center_ptr is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_left_ptr -is defined with the value 68. ->>STRATEGY -Include the file -Verify that the symbol XC_left_ptr is defined. -Verify that the symbol is defined to have value 68. ->>CODE - -#ifdef XC_left_ptr - -# if (XC_left_ptr == 68) - PASS; -# else - report("XC_left_ptr was defined to have value %ld instead of 68.", (long) XC_left_ptr); - FAIL; -# endif - -#else - report("XC_left_ptr is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_right_ptr -is defined with the value 94. ->>STRATEGY -Include the file -Verify that the symbol XC_right_ptr is defined. -Verify that the symbol is defined to have value 94. ->>CODE - -#ifdef XC_right_ptr - -# if (XC_right_ptr == 94) - PASS; -# else - report("XC_right_ptr was defined to have value %ld instead of 94.", (long) XC_right_ptr); - FAIL; -# endif - -#else - report("XC_right_ptr is not defined."); - FAIL; -#endif - ->>ASSERTION Good A -When the header file is included, -then the symbol -.S XC_num_glyphs -is defined with a value which is even and is not less than 150. ->>STRATEGY -Include the file -Verify that the symbol XC_num_glyphs is defined. -Verify that the sumbol value is even. -Verify that the symbol is defined to have value not less than 150. ->>CODE - -#ifdef XC_num_glyphs - - if(XC_num_glyphs < 150) { - report("XC_num_glyphs (value %ld) is less than 150.", (long) XC_num_glyphs); - FAIL; - } else - CHECK; - - if(XC_num_glyphs % 2 != 0) { - report("XC_num_glyphs (value %ld) is not even.", (long) XC_num_glyphs); - FAIL; - } else - CHECK; - - CHECKPASS(2); -#else - report("XC_num_glyphs is not defined."); - FAIL; -#endif - diff --git a/xts5/scenarios/Xopen_scen b/xts5/scenarios/Xopen_scen index 8b83c740..9eb667f2 100644 --- a/xts5/scenarios/Xopen_scen +++ b/xts5/scenarios/Xopen_scen @@ -55,11 +55,11 @@ # "VSW5TESTSUITE CASE XAllocNamedColor 7" - /Xopen/XAllocNamedColor/XAllocNamedColor + /Xopen/XAllocNamedColor "VSW5TESTSUITE CASE cursorfont 32" - /Xopen/cursorfont/cursorfont + /Xopen/cursorfont "VSW5TESTSUITE CASE XCreateFontCursor 31" - /Xopen/XCreateFontCursor/XCreateFontCursor + /Xopen/XCreateFontCursor "VSW5TESTSUITE CASE keysym 7" /Xopen/keysym/keysym "VSW5TESTSUITE CASE keysymdef 15" @@ -67,6 +67,6 @@ "VSW5TESTSUITE CASE XKeysymToKeycode 14" /Xopen/XKeysymToKeycode/XKeysymToKeycode "VSW5TESTSUITE CASE XLookupColor 7" - /Xopen/XLookupColor/XLookupColor + /Xopen/XLookupColor "VSW5TESTSUITE CASE XStringToKeysym 14" /Xopen/XStringToKeysym/XStringToKeysym diff --git a/xts5/tet_scen b/xts5/tet_scen index 92e8676d..b7c9c163 100644 --- a/xts5/tet_scen +++ b/xts5/tet_scen @@ -3069,15 +3069,15 @@ XUnloadFont xXAllocNamedColor "VSW5TESTSUITE CASE XAllocNamedColor 7" - /Xopen/XAllocNamedColor/XAllocNamedColor + /Xopen/XAllocNamedColor xcursorfont "VSW5TESTSUITE CASE cursorfont 32" - /Xopen/cursorfont/cursorfont + /Xopen/cursorfont xXCreateFontCursor "VSW5TESTSUITE CASE XCreateFontCursor 31" - /Xopen/XCreateFontCursor/XCreateFontCursor + /Xopen/XCreateFontCursor xkeysym "VSW5TESTSUITE CASE keysym 7" @@ -3093,7 +3093,7 @@ xXKeysymToKeycode xXLookupColor "VSW5TESTSUITE CASE XLookupColor 7" - /Xopen/XLookupColor/XLookupColor + /Xopen/XLookupColor xXStringToKeysym "VSW5TESTSUITE CASE XStringToKeysym 14" -- cgit v1.2.3