summaryrefslogtreecommitdiff
path: root/xts5/Xlib5
diff options
context:
space:
mode:
authorDan Nicholson <dbn.lists@gmail.com>2009-09-16 12:20:41 -0700
committerDan Nicholson <dbn.lists@gmail.com>2009-09-16 12:20:41 -0700
commit704eb8d4cbfa2f8c47882a8ea6c7732cf5fa20d1 (patch)
tree1f48212ecf5556fbff17172c6904e525481e8653 /xts5/Xlib5
parent5d01bd434ff7186701c931883b110c179d4fa8b8 (diff)
xts5: Move tests out of tset directory
The tset directory was mostly useless and causes extra baggage if the scenario files are going to be used on an installed package. The test directories are now flattened into xts5.
Diffstat (limited to 'xts5/Xlib5')
-rw-r--r--xts5/Xlib5/.gitignore15
-rw-r--r--xts5/Xlib5/Makefile.am26
-rw-r--r--xts5/Xlib5/XChangeProperty/XChangeProperty.m891
-rw-r--r--xts5/Xlib5/XConvertSelection/XConvertSelection.m299
-rw-r--r--xts5/Xlib5/XDeleteProperty/XDeleteProperty.m242
-rw-r--r--xts5/Xlib5/XGetAtomName/XGetAtomName.m164
-rw-r--r--xts5/Xlib5/XGetGeometry/XGetGeometry.m487
-rw-r--r--xts5/Xlib5/XGetSelectionOwner/XGetSelectionOwner.m171
-rw-r--r--xts5/Xlib5/XGetWindowAttributes/XGetWindowAttributes.m415
-rw-r--r--xts5/Xlib5/XGetWindowProperty/XGetWindowProperty.m1025
-rw-r--r--xts5/Xlib5/XInternAtom/XInternAtom.m518
-rw-r--r--xts5/Xlib5/XListProperties/XListProperties.m251
-rw-r--r--xts5/Xlib5/XQueryPointer/XQueryPointer.m414
-rw-r--r--xts5/Xlib5/XQueryTree/XQueryTree.m326
-rw-r--r--xts5/Xlib5/XRotateWindowProperties/XRotateWindowProperties.m687
-rw-r--r--xts5/Xlib5/XSetSelectionOwner/XSetSelectionOwner.m546
-rw-r--r--xts5/Xlib5/XTranslateCoordinates/XTranslateCoordinates.m430
17 files changed, 6907 insertions, 0 deletions
diff --git a/xts5/Xlib5/.gitignore b/xts5/Xlib5/.gitignore
new file mode 100644
index 00000000..998d811b
--- /dev/null
+++ b/xts5/Xlib5/.gitignore
@@ -0,0 +1,15 @@
+XChangeProperty/XChangeProperty
+XConvertSelection/XConvertSelection
+XDeleteProperty/XDeleteProperty
+XGetAtomName/XGetAtomName
+XGetGeometry/XGetGeometry
+XGetSelectionOwner/XGetSelectionOwner
+XGetWindowAttributes/XGetWindowAttributes
+XGetWindowProperty/XGetWindowProperty
+XInternAtom/XInternAtom
+XListProperties/XListProperties
+XQueryPointer/XQueryPointer
+XQueryTree/XQueryTree
+XRotateWindowProperties/XRotateWindowProperties
+XSetSelectionOwner/XSetSelectionOwner
+XTranslateCoordinates/XTranslateCoordinates
diff --git a/xts5/Xlib5/Makefile.am b/xts5/Xlib5/Makefile.am
new file mode 100644
index 00000000..9931325b
--- /dev/null
+++ b/xts5/Xlib5/Makefile.am
@@ -0,0 +1,26 @@
+include ../../common.mk
+AUTOMAKE_OPTIONS = subdir-objects
+
+AM_CFLAGS = $(XTS_LCFLAGS) $(XTS_CFLAGS)
+LDADD = $(TCM) $(XTS_LLIBS) $(XTS_LIBS)
+
+libexec_PROGRAMS = $(tprogs)
+BUILT_SOURCES = $(tprogs:$(EXEEXT)=.c)
+CLEANFILES = $(BUILT_SOURCES)
+
+tprogs = \
+ XChangeProperty/XChangeProperty \
+ XConvertSelection/XConvertSelection \
+ XDeleteProperty/XDeleteProperty \
+ XGetAtomName/XGetAtomName \
+ XGetGeometry/XGetGeometry \
+ XGetSelectionOwner/XGetSelectionOwner \
+ XGetWindowAttributes/XGetWindowAttributes \
+ XGetWindowProperty/XGetWindowProperty \
+ XInternAtom/XInternAtom \
+ XListProperties/XListProperties \
+ XQueryPointer/XQueryPointer \
+ XQueryTree/XQueryTree \
+ XRotateWindowProperties/XRotateWindowProperties \
+ XSetSelectionOwner/XSetSelectionOwner \
+ XTranslateCoordinates/XTranslateCoordinates
diff --git a/xts5/Xlib5/XChangeProperty/XChangeProperty.m b/xts5/Xlib5/XChangeProperty/XChangeProperty.m
new file mode 100644
index 00000000..ca265aa9
--- /dev/null
+++ b/xts5/Xlib5/XChangeProperty/XChangeProperty.m
@@ -0,0 +1,891 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XChangeProperty/XChangeProperty.m,v 1.2 2005-11-03 08:43:38 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XChangeProperty/XChangeProperty.m
+>>#
+>># Description:
+>># Tests for XChangeProperty()
+>>#
+>># Modifications:
+>># $Log: chngprprty.m,v $
+>># Revision 1.2 2005-11-03 08:43:38 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:26 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:42 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:00 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:56 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:28 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:14 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:28 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:07 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XChangeProperty Xlib5
+void
+
+Display *display = Dsp;
+Window w = defwin(display);
+Atom property = xcp_list[0];
+Atom type = XA_INTEGER;
+int format = 32;
+int mode = PropModeReplace;
+unsigned char *data = (unsigned char *)NULL;
+int nelements = 0;
+>>EXTERN
+#include "X11/Xatom.h"
+
+static Atom xcp_list[] = {
+ XA_COPYRIGHT, XA_INTEGER };
+
+static int xcp_num_list = NELEM(xcp_list);
+
+static void
+xcp_add_property(prop, data)
+Atom prop;
+unsigned long data;
+{
+ XChangeProperty(display, w, prop, XA_INTEGER, 32,
+ PropModeReplace, (unsigned char *)&data, 1);
+ XSync(display, True);
+}
+
+static int
+xcp_get_property(prop, length, ret)
+Atom prop;
+int length;
+unsigned char **ret;
+{
+Atom type;
+int format;
+unsigned long nitems;
+unsigned long after;
+
+ XGetWindowProperty(display, w, prop, 0, (long)length, False,
+ XA_INTEGER, &type, &format, &nitems, &after, ret);
+
+ if ( type != XA_INTEGER || format != 32 ) {
+ delete("XGetWindowProperty returned unexpected values");
+ report("type is %s (expected XA_INTEGER)", atomname(type));
+ report("format is %d (expected 32)",format);
+ return(0);
+ } else {
+ if (nitems != length) {
+ report("%s did not change the", TestName);
+ report("window property as expected");
+ report("Expected %d items", length);
+ report("Returned %d items", nitems);
+ return(0);
+ } else {
+ if (after != 0) {
+ report("%s did not change the", TestName);
+ report("window property as expected");
+ report("Expected after: 0");
+ report("Returned after: %d", after);
+ return(0);
+ }
+ }
+ }
+ return(1);
+}
+
+>>ASSERTION Good A
+A call to xname alters the
+.A property
+for the specified window
+.A w
+and
+generates a
+.S PropertyNotify
+event on that window.
+>>STRATEGY
+Create a window without properties and with PropertyChangeMask events selected.
+Call xname to replace a property value.
+Verify that a PropertyNotify event occurred.
+Verify that the property was updated as expected.
+>>CODE
+unsigned long newdata;
+unsigned long retdata;
+unsigned char *retptr;
+int num_ev;
+XEvent ev, good;
+
+/* Create a window without properties and with PropertyChangeMask events selected. */
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to replace a property value. */
+ mode = PropModeReplace;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Verify that a PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev == 0) {
+ FAIL;
+ report("A call to %s caused no events", TestName);
+ } else {
+ if(num_ev != 1) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 1",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = property;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+ }
+
+/* Verify that the property was updated as expected. */
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != newdata) {
+ FAIL;
+ report("%s did not assign the property value",TestName);
+ report("as expected");
+ report("Expected value: %u", newdata);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+When
+.A mode
+is
+.S PropModeReplace ,
+then a call to xname discards the previous value of
+.A property
+and stores the new
+.A data ,
+in the specified
+.A format
+and
+.A type ,
+and a
+.S PropertyNotify
+event is generated.
+>>STRATEGY
+Create a window with properties and PropertyChangeMask events selected.
+Call xname to replace a property value.
+Verify that a PropertyNotify event occurred.
+Verify that the property was updated as expected.
+>>CODE
+int loop;
+unsigned long newdata;
+unsigned long retdata;
+unsigned char *retptr;
+int num_ev;
+XEvent ev, good;
+
+/* Create a window with properties and PropertyChangeMask events selected. */
+ for(loop=0; loop < xcp_num_list; loop++)
+ xcp_add_property(xcp_list[loop], (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to replace a property value. */
+ mode = PropModeReplace;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Verify that a PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev == 0) {
+ FAIL;
+ report("A call to %s caused no events", TestName);
+ } else {
+ if(num_ev != 1) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 1",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = property;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+ }
+
+/* Verify that the property was updated as expected. */
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != newdata) {
+ FAIL;
+ report("%s did not change the property value",TestName);
+ report("as expected");
+ report("Expected value: %u", newdata);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+When
+.A mode
+is
+.S PropModePrepend ,
+then a call to xname inserts the specified
+.A data
+before the beginning
+of the existing data for
+.A property ,
+and a
+.S PropertyNotify
+event is generated.
+>>STRATEGY
+Create a window with properties and PropertyChangeMask events selected.
+Call xname to replace a property value.
+Verify that a PropertyNotify event occurred.
+Verify that the property was updated as expected.
+>>CODE
+int loop;
+unsigned long newdata;
+unsigned long *retdata;
+unsigned char *retptr;
+int num_ev;
+XEvent ev, good;
+
+/* Create a window with properties and PropertyChangeMask events selected. */
+ for(loop=0; loop < xcp_num_list; loop++)
+ xcp_add_property(xcp_list[loop], (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to replace a property value. */
+ mode = PropModePrepend;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Verify that a PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev == 0) {
+ FAIL;
+ report("A call to %s caused no events", TestName);
+ } else {
+ if(num_ev != 1) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 1",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = property;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+ }
+
+/* Verify that the property was updated as expected. */
+ if(!xcp_get_property(property, 2, &retptr)) {
+ FAIL;
+ } else {
+ retdata = (unsigned long *)retptr;
+ if(retdata[0] != newdata || retdata[1] != 0) {
+ FAIL;
+ report("%s did not change the property value",TestName);
+ report("as expected");
+ report("Expected value: %u,%u", newdata, 0);
+ report("Returned value: %u,%u", retdata[0], retdata[1]);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+When
+.A mode
+is
+.S PropModeAppend ,
+then a call to xname inserts the specified
+.A data
+onto the end of the existing data for
+.A property ,
+and a
+.S PropertyNotify
+event is generated.
+>>STRATEGY
+Create a window with properties and PropertyChangeMask events selected.
+Call xname to replace a property value.
+Verify that a PropertyNotify event occurred.
+Verify that the property was updated as expected.
+>>CODE
+int loop;
+unsigned long newdata;
+unsigned long *retdata;
+unsigned char *retptr;
+int num_ev;
+XEvent ev, good;
+
+/* Create a window with properties and PropertyChangeMask events selected. */
+ for(loop=0; loop < xcp_num_list; loop++)
+ xcp_add_property(xcp_list[loop], (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to replace a property value. */
+ mode = PropModeAppend;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Verify that a PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev == 0) {
+ FAIL;
+ report("A call to %s caused no events", TestName);
+ } else {
+ if(num_ev != 1) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 1",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = property;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+ }
+
+/* Verify that the property was updated as expected. */
+ if(!xcp_get_property(property, 2, &retptr)) {
+ FAIL;
+ } else {
+ retdata = (unsigned long *)retptr;
+ if(retdata[0] != 0 || retdata[1] != newdata) {
+ FAIL;
+ report("%s did not change the property value",TestName);
+ report("as expected");
+ report("Expected values: %u,%u", 0, newdata);
+ report("Returned values: %u,%u", retdata[0], retdata[1]);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+When
+.A mode
+is
+.S PropModeAppend
+or
+.S PropModePrepend
+and the
+.A property
+is undefined for window
+.A w ,
+then on a call to xname the
+.A property
+is treated as if it were defined with the correct
+.A type
+and
+.A format
+and had zero length data.
+>>STRATEGY
+Create a window without properties and with PropertyChangeMask events selected.
+Call xname to prepend to a non-existant property value.
+Verify that a PropertyNotify event occurred.
+Verify that the property was updated as expected.
+Call xname to append to a non-existant property value.
+Verify that a PropertyNotify event occurred.
+Verify that the property was updated as expected.
+>>CODE
+unsigned long newdata;
+unsigned long retdata;
+unsigned char *retptr;
+int num_ev;
+XEvent ev, good;
+
+/* Create a window without properties and with PropertyChangeMask events selected. */
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to prepend to a non-existant property value. */
+ mode = PropModePrepend;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Verify that a PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev == 0) {
+ FAIL;
+ report("A call to %s caused no events", TestName);
+ } else {
+ if(num_ev != 1) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 1",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = property;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+ }
+
+/* Verify that the property was updated as expected. */
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != newdata) {
+ FAIL;
+ report("%s did not assign the property value",TestName);
+ report("as expected");
+ report("Expected value: %u", newdata);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+/* Call xname to append to a non-existant property value. */
+ property = xcp_list[1];
+ mode = PropModeAppend;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Verify that a PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev == 0) {
+ FAIL;
+ report("A call to %s caused no events", TestName);
+ } else {
+ if(num_ev != 1) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 1",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = property;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+ }
+
+/* Verify that the property was updated as expected. */
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != newdata) {
+ FAIL;
+ report("%s did not assign the property value",TestName);
+ report("as expected");
+ report("Expected value: %u", newdata);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(4);
+
+>>ASSERTION Good A
+>># The lifetime of a property is not tied to the storing client.
+>># Split into two new ones......
+When the storing client closes its connection to the server and
+the window
+.A w
+is not destroyed, then the
+.A format ,
+.A data
+and
+.A type
+of the
+.A property
+remain associated with the window.
+>>STRATEGY
+Create a new client.
+Call xname to add a property to the window on the new client.
+Close client2.
+Allow time for the client to close.
+Verify that the property is still defined.
+>>CODE
+Display *client2;
+unsigned long newdata;
+unsigned long retdata;
+unsigned char *retptr;
+
+/* Create a new client. */
+ client2 = XOpenDisplay(config.display);
+ if(client2 == (Display *)NULL) {
+ delete("could not create new client");
+ return;
+ } else
+ CHECK;
+
+/* Call xname to add a property to the window on the new client. */
+ display = client2;
+ mode = PropModeReplace;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+/* Close client2. */
+ XCloseDisplay(client2);
+
+/* Allow time for the client to close. */
+ reset_delay();
+
+/* Verify that the property is still defined. */
+ display = Dsp;
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != newdata) {
+ FAIL;
+ report("The property value was not",TestName);
+ report("as expected");
+ report("Expected value: %u", newdata);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+>># This assertion kinda slipped through the net. It would
+>># catch if some bizarre implementation actually damaged
+>># the property atom.
+When the storing client closes its connection to the server and
+the server does not reset, then the atom
+.A property
+remains.
+>>STRATEGY
+Create a new client.
+Call xname to change a property on a window on the new client.
+Close new client.
+Allow time for the client to close.
+Verify that atom property remains defined.
+>>CODE
+Display *display2;
+unsigned long newdata;
+Atom atm;
+
+/* Create a new client. */
+ if (config.display == (char *)NULL) {
+ delete("config.display not set");
+ return;
+ } else
+ CHECK;
+
+ display2 = XOpenDisplay(config.display);
+ if (display2 == (Display *)NULL) {
+ delete("Could not open display for display2");
+ return;
+ } else
+ CHECK;
+
+/* Call xname to change a property on a window on the new client. */
+ display = display2;
+ newdata = 255;
+ data = (unsigned char *)&newdata;
+ XCALL;
+
+/* Close new client. */
+ (void) XCloseDisplay(display2);
+
+/* Allow time for the client to close. */
+ reset_delay();
+
+/* Verify that atom property remains defined. */
+ atm = XInternAtom(Dsp, "INTEGER", True);
+
+ if (atm != XA_INTEGER) {
+ FAIL;
+ report("%s caused INTEGER atom to become undefined.",
+ TestName);
+ report("Expected atom %u", (unsigned long)XA_INTEGER);
+ report("Returned atom %u", (unsigned long)atm);
+ } else
+ CHECK;
+
+ CHECKPASS(3);
+
+>>ASSERTION Bad A
+When
+.A mode
+is
+.S PropModePrepend
+or
+.S PropModeAppend
+and the
+.A type
+or
+.A format
+do not match the existing
+.A property
+value, then on a call to xname a
+.S BadMatch
+error occurs.
+>>STRATEGY
+Create a window with properties and PropertyChangeMask events selected.
+Call xname to append a property value, with incorrect type information.
+Verify that no PropertyNotify event occurred.
+Verify that the property was unchanged.
+Call xname to prepend a property value, with incorrect format information.
+Verify that no PropertyNotify event occurred.
+Verify that the property was unchanged.
+>>CODE BadMatch
+int loop;
+unsigned long newdata;
+unsigned long retdata;
+unsigned char *retptr;
+int num_ev;
+XEvent ev;
+
+/* Create a window with properties and PropertyChangeMask events selected. */
+ for(loop=0; loop < xcp_num_list; loop++)
+ xcp_add_property(xcp_list[loop], (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to append a property value, with incorrect type information. */
+ format = 32;
+ type = XA_BITMAP;
+ mode = PropModeAppend;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+ if(geterr()!= BadMatch) {
+ FAIL;
+ } else
+ CHECK;
+
+/* Verify that no PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev != 0) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 0",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else
+ CHECK;
+
+/* Verify that the property was unchanged. */
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != 0) {
+ FAIL;
+ report("%s changed the property value",TestName);
+ report("unexpectedly");
+ report("Expected value: %u", 0);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+/* Call xname to prepend a property value, with incorrect format information. */
+ format = 16;
+ type = XA_INTEGER;
+ mode = PropModePrepend;
+ newdata = xcp_num_list;
+ data = (unsigned char *)&newdata;
+ nelements = 1;
+ XCALL;
+
+ if(geterr()!= BadMatch) {
+ FAIL;
+ } else
+ CHECK;
+
+/* Verify that no PropertyNotify event occurred. */
+ num_ev = getevent(display, &ev);
+ if(num_ev != 0) {
+ FAIL;
+ report("A call to %s caused %d events, expecting 0",
+ TestName, num_ev);
+ do {
+ report("Event %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else
+ CHECK;
+
+/* Verify that the property was unchanged. */
+ if(!xcp_get_property(property, 1, &retptr)) {
+ FAIL;
+ } else {
+ retdata = *(unsigned long *)retptr;
+ if(retdata != 0) {
+ FAIL;
+ report("%s changed the property value",TestName);
+ report("unexpectedly");
+ report("Expected value: %u", 0);
+ report("Returned value: %u", retdata);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(6);
+
+>>ASSERTION Bad B
+.ER BadAlloc
+>>ASSERTION Bad A
+.ER BadAtom
+>>ASSERTION Bad A
+.ER BadWindow
+>>ASSERTION Bad A
+.ER BadValue format 8 16 32
+>>ASSERTION Bad A
+.ER BadValue mode PropModeReplace PropModePrepend PropModeAppend
diff --git a/xts5/Xlib5/XConvertSelection/XConvertSelection.m b/xts5/Xlib5/XConvertSelection/XConvertSelection.m
new file mode 100644
index 00000000..6c979825
--- /dev/null
+++ b/xts5/Xlib5/XConvertSelection/XConvertSelection.m
@@ -0,0 +1,299 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XConvertSelection/XConvertSelection.m,v 1.2 2005-11-03 08:43:38 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XConvertSelection/XConvertSelection.m
+>>#
+>># Description:
+>># Tests for XConvertSelection()
+>>#
+>># Modifications:
+>># $Log: cnvrtslctn.m,v $
+>># Revision 1.2 2005-11-03 08:43:38 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:27 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:43 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:00 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:57 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:28 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:16 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:30 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:11 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XConvertSelection Xlib5
+void
+
+Display *display = Dsp;
+Atom selection = XA_COPYRIGHT;
+Atom target = XA_NOTICE;
+Atom property = XA_INTEGER;
+Window requestor = defwin(display);
+Time thetime = CurrentTime;
+>>EXTERN
+#include "X11/Xatom.h"
+>>ASSERTION Good A
+When the specified
+.A selection
+has an owner, then a call to xname generates a
+.S SelectionRequest
+event to the selection owner, with
+.A selection ,
+.A target ,
+.A property ,
+.A requestor ,
+and
+.A time
+arguments passed unchanged as event structure members.
+>>STRATEGY
+Create a new client.
+Create a window with a selection which it owns on client2.
+Call xname to convert the selection.
+Verify that the correct SelectionNotify event was delivered to client2
+Verify no events were delivered to client1.
+>>CODE
+Display *client1, *client2;
+Window owner;
+int num_ev;
+XEvent ev;
+
+/* Create a new client. */
+ client1 = display;
+ client2 = opendisplay();
+ if (client2 == (Display *)NULL) {
+ delete("Could not create client2");
+ return;
+ } else
+ CHECK;
+
+/* Create a window with a selection which it owns on client2. */
+ owner = defwin(client2);
+ XSetSelectionOwner(client2, selection, owner, CurrentTime);
+ XSync(client2, True);
+
+/* Call xname to convert the selection. */
+ XCALL;
+ XSync(client1, False);
+ XSync(client2, False);
+
+/* Verify that the correct SelectionNotify event was delivered to client2 */
+ num_ev = getevent(client2, &ev);
+ if (num_ev != 1) {
+ FAIL;
+ report("%s did not cause a single SelectionNotify event",
+ TestName);
+ trace("Received %d events", num_ev);
+ while (num_ev > 0) {
+ trace("Event %s", eventname(ev.type));
+ num_ev = getevent(client2, &ev);
+ }
+ } else {
+ XEvent good;
+
+ good.type = SelectionRequest;
+ good.xselectionrequest.type = SelectionRequest;
+ good.xselectionrequest.display = client2;
+ good.xselectionrequest.owner = owner;
+ good.xselectionrequest.requestor = requestor;
+ good.xselectionrequest.selection = selection;
+ good.xselectionrequest.target = target;
+ good.xselectionrequest.property = property;
+ good.xselectionrequest.time = -1;
+
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ report("SelectionNotify event was incorrect");
+ } else
+ CHECK;
+ }
+
+/* Verify no events were delivered to client1. */
+ num_ev = getevent(client1, &ev);
+ if (num_ev != 0) {
+ FAIL;
+ report("%s generated unexpected events on client1",
+ TestName);
+ trace("Expected 0 events");
+ trace("Received %d events", num_ev);
+ do {
+ trace("Event: %s", eventname(ev.type));
+ } while(getevent(client1, &ev));
+ } else
+ CHECK;
+
+ CHECKPASS(3);
+
+>>ASSERTION Good A
+When the specified
+.A selection
+has no owner, then a call to xname generates a
+.S SelectionNotify
+event to the
+.A requestor
+window with
+.A selection ,
+.A target
+and
+.A time
+arguments passed unchanged as event structure members, and with
+.A property
+set to
+.S None .
+>>STRATEGY
+Call xname to convert the selection.
+Verify that the correct SelectionNotify event was delivered to display.
+>>CODE
+int num_ev;
+XEvent ev;
+
+/* Call xname to convert the selection. */
+ XCALL;
+ XSync(display, False);
+
+/* Verify that the correct SelectionNotify event was delivered to display. */
+ num_ev = getevent(display, &ev);
+ if (num_ev != 1) {
+ FAIL;
+ report("%s did not cause a single SelectionNotify event",
+ TestName);
+ trace("Received %d events", num_ev);
+ while (num_ev > 0) {
+ trace("Event %s", eventname(ev.type));
+ num_ev = getevent(display, &ev);
+ }
+ } else {
+ XEvent good;
+
+ good.type = SelectionNotify;
+ good.xselection.type = SelectionNotify;
+ good.xselection.display = display;
+ good.xselection.requestor = requestor;
+ good.xselection.selection = selection;
+ good.xselection.target = target;
+ good.xselection.property = None; /* is passed with no owner */
+ good.xselection.time = -1;
+
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ report("SelectionNotify event was incorrect");
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(1);
+
+>>ASSERTION Good A
+The atoms
+.S PRIMARY
+and
+.S SECONDARY
+are predefined selection atoms.
+>>STRATEGY
+Obtain the server representation for the PRIMARY and SECONDARY atoms.
+Verify that the atoms were defined.
+>>CODE
+Atom primary, secondary;
+
+/* Obtain the server representation for the PRIMARY and SECONDARY atoms. */
+ primary = XInternAtom(display, "PRIMARY", True);
+ secondary = XInternAtom(display, "SECONDARY", True);
+
+/* Verify that the atoms were defined. */
+ if (primary == None) {
+ FAIL;
+ report("PRIMARY was not defined");
+ } else
+ CHECK;
+
+ if (secondary == None) {
+ FAIL;
+ report("SECONDARY was not defined");
+ } else
+ CHECK;
+
+ CHECKPASS(2);
+
+>>ASSERTION Bad A
+.ER BadWindow
+>>ASSERTION Bad A
+.ER BadAtom
diff --git a/xts5/Xlib5/XDeleteProperty/XDeleteProperty.m b/xts5/Xlib5/XDeleteProperty/XDeleteProperty.m
new file mode 100644
index 00000000..1ccca1c8
--- /dev/null
+++ b/xts5/Xlib5/XDeleteProperty/XDeleteProperty.m
@@ -0,0 +1,242 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XDeleteProperty/XDeleteProperty.m,v 1.2 2005-11-03 08:43:38 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XDeleteProperty/XDeleteProperty.m
+>>#
+>># Description:
+>># Tests for XDeleteProperty()
+>>#
+>># Modifications:
+>># $Log: dltprprty.m,v $
+>># Revision 1.2 2005-11-03 08:43:38 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:27 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:43 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:01 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:57 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:29 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:16 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:31 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:13 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XDeleteProperty Xlib5
+void
+
+Display *display = Dsp;
+Window w = defwin(display);
+Atom property = XA_COPYRIGHT;
+>>EXTERN
+#include "X11/Xatom.h"
+>>ASSERTION Good A
+When the specified
+.A property
+exists on the specified window
+.A w ,
+then
+a call to xname deletes the
+.A property
+and a
+.S PropertyNotify
+event is generated on the window
+.A w .
+>>STRATEGY
+Create a window with a property and PropertyChangeMask events selected.
+Call xname to delete the property.
+Verify that a good PropertyNotify event occurred.
+Verify that the window property was deleted.
+>>CODE
+char *data="a tested property";
+int num = 0;
+XEvent ev;
+
+/* Create a window with a property and PropertyChangeMask events selected. */
+ XChangeProperty(display, w, property, XA_STRING, 8,
+ PropModeReplace,(unsigned char *)data, strlen(data));
+ XSync(display, True);
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to delete the property. */
+ XCALL;
+
+/* Verify that a good PropertyNotify event occurred. */
+
+ num = getevent(display, &ev);
+ if (num != 1) {
+ FAIL;
+ report("%s caused %d events", num);
+ trace("Expecting a single PropertyNotify event");
+ } else {
+ XEvent good;
+
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.display= display;
+ good.xproperty.serial = 0;
+ good.xproperty.send_event = False;
+ good.xproperty.window = w;
+ good.xproperty.atom = property;
+ good.xproperty.time = 0;
+ good.xproperty.state = PropertyDelete;
+
+#ifdef TESTING
+ good.xproperty.atom--;
+#endif
+
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ }
+
+/* Verify that the window property was deleted. */
+ (void)XListProperties(display, w, &num);
+ if (num != 0) {
+ FAIL;
+ report("%s did not delete a window property", TestName);
+ trace("Expected: 0 properties");
+ trace("Returned: %d propert%s", num, (num==1?"y":"ies"));
+ } else
+ CHECK;
+
+ CHECKPASS(2);
+>>ASSERTION Good A
+When the specified
+.A property
+does not exist on the specified window
+.A w ,
+then a call to xname deletes no property of the window
+.A w
+and no
+.S PropertyNotify
+event is generated.
+>>STRATEGY
+Create a window with a property and PropertyChangeMask events selected.
+Call xname to delete a non-existant property.
+Verify that no PropertyNotify events occurred.
+Verify that the window property was not deleted.
+>>CODE
+char *data="a tested property";
+int num = 0;
+XEvent ev;
+
+/* Create a window with a property and PropertyChangeMask events selected. */
+ XChangeProperty(display, w, XA_NOTICE, XA_STRING, 8,
+ PropModeReplace,(unsigned char *)data, strlen(data));
+ XSync(display, True);
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to delete a non-existant property. */
+#ifdef TESTING
+ property = XA_NOTICE;
+#endif
+ XCALL;
+
+/* Verify that no PropertyNotify events occurred. */
+ if (getevent(display, &ev) != 0) {
+ FAIL;
+ report("%s caused unexpected event(s)", TestName);
+ do {
+ trace("Event: %s", eventname(ev.type));
+ } while(getevent(display, &ev));
+ } else
+ CHECK;
+
+/* Verify that the window property was not deleted. */
+ (void)XListProperties(display, w, &num);
+ if (num != 1) {
+ FAIL;
+ report("%s unexpectedly changed the window properties",
+ TestName);
+ trace("Expected: 1 property");
+ trace("Returned: %d properties", num);
+ } else
+ CHECK;
+
+ CHECKPASS(2);
+
+>>ASSERTION Bad A
+.ER BadAtom
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XGetAtomName/XGetAtomName.m b/xts5/Xlib5/XGetAtomName/XGetAtomName.m
new file mode 100644
index 00000000..37d76a55
--- /dev/null
+++ b/xts5/Xlib5/XGetAtomName/XGetAtomName.m
@@ -0,0 +1,164 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XGetAtomName/XGetAtomName.m,v 1.2 2005-11-03 08:43:38 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XGetAtomName/XGetAtomName.m
+>>#
+>># Description:
+>># Tests for XGetAtomName()
+>>#
+>># Modifications:
+>># $Log: gtatmnm.m,v $
+>># Revision 1.2 2005-11-03 08:43:38 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:27 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:44 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:01 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:58 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:29 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:17 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:32 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:16 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XGetAtomName Xlib5
+char *
+
+Display *display = Dsp;
+Atom atom;
+>>EXTERN
+#include "X11/Xatom.h"
+
+static struct xga_struct {
+ char *name;
+ Atom atom;
+} xga_list[] = {
+ "PRIMARY", XA_PRIMARY,
+ "CUT_BUFFER0", XA_CUT_BUFFER0,
+ "RECTANGLE", XA_RECTANGLE,
+ "COPYRIGHT", XA_COPYRIGHT,
+};
+static int xga_nlist = NELEM(xga_list);
+
+>>ASSERTION Good A
+A call to xname returns the name, which can be freeed with XFree,
+associated with the specified
+.A atom .
+>>STRATEGY
+For some predefined atoms:
+ Call xname to obtain the name associated with the atom.
+ Verify the strings returned were as expected.
+>>CODE
+char *ret_str;
+int l;
+
+/* For some predefined atoms: */
+ for(l=0; l<xga_nlist; l++) {
+
+/* Call xname to obtain the name associated with the atom. */
+ atom = xga_list[l].atom;
+ trace("checking atom %d (%s)", atom, atomname(atom));
+ ret_str = XCALL;
+
+ if (ret_str == NULL) {
+ FAIL;
+ report("%s returned a null string with atom name %s",
+ TestName, xga_list[l].name);
+ continue;
+ } else
+ CHECK;
+
+/* Verify the strings returned were as expected. */
+ if (strcmp(xga_list[l].name, ret_str) != 0 ) {
+ FAIL;
+ report("%s returned an unexpected string");
+ report("Expected: '%s'", xga_list[l].name);
+ report("Returned: '%s'", ret_str);
+ } else
+ CHECK;
+ XFree(ret_str);
+ }
+
+ CHECKPASS(2*xga_nlist);
+>>ASSERTION Bad A
+.ER BadAtom
diff --git a/xts5/Xlib5/XGetGeometry/XGetGeometry.m b/xts5/Xlib5/XGetGeometry/XGetGeometry.m
new file mode 100644
index 00000000..328eeb73
--- /dev/null
+++ b/xts5/Xlib5/XGetGeometry/XGetGeometry.m
@@ -0,0 +1,487 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XGetGeometry/XGetGeometry.m,v 1.2 2005-11-03 08:43:38 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XGetGeometry/XGetGeometry.m
+>>#
+>># Description:
+>># Tests for XGetGeometry()
+>>#
+>># Modifications:
+>># $Log: gtgmtry.m,v $
+>># Revision 1.2 2005-11-03 08:43:38 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:27 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:44 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:02 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:58 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:30 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.0 1995/12/15 08:48:34 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:18 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XGetGeometry Xlib5
+Status
+
+Display *display = Dsp;
+Drawable d;
+Window *root_return = &root;
+int *x_return = &x;
+int *y_return = &y;
+unsigned int *width_return = &width;
+unsigned int *height_return = &height;
+unsigned int *border_width_return = &border_width;
+unsigned int *depth_return = &depth;
+>>EXTERN
+#define XGG_BorderWidth 5
+#define XGG_X 25
+#define XGG_Y 35
+#define XGG_Width 20
+#define XGG_Height 15
+
+Window root;
+int x;
+int y;
+unsigned int width;
+unsigned int height;
+unsigned int border_width;
+unsigned int depth;
+>>ASSERTION Good A
+When the
+.A drawable
+is an
+.S InputOutput
+window, then a call to xname returns the root window in
+.A root_return ,
+the x and y coordinates of the upper-left outer corner relative to
+the parent window origin in
+.A x_return
+and
+.A y_return ,
+the inside width and height in
+.A width_return
+and
+.A height_return ,
+the border width in
+.A border_width_return ,
+and the depth of the window in
+.A depth_return .
+>>STRATEGY
+For each visual and depth:
+ Create a parent window
+ Create a test window
+ Call xname to obtain the test window geometry
+ Verify that the values returned were as expected
+>>CODE
+XVisualInfo *vp;
+struct area ap;
+
+/* For each visual and depth: */
+ for(resetvinf(VI_WIN); nextvinf(&vp); ) {
+ Window parent, w;
+
+/* Create a parent window */
+ ap.x = 7;
+ ap.y = 11;
+ ap.width = 9;
+ ap.height = 13;
+
+ parent = makewin(display, vp);
+
+/* Create a test window */
+ w = mkwinchild(display, vp, &ap, 0, parent, XGG_BorderWidth);
+
+/* Call xname to obtain the test window geometry */
+ root = (Window)0;
+ x = -1;
+ y = -1;
+ width = 255;
+ height = 255;
+ border_width = 255;
+ depth = 255;
+
+ d = (Drawable)w;
+ XCALL;
+
+/* Verify that the values returned were as expected */
+ if (root != DefaultRootWindow(display)) {
+ FAIL;
+ report("%s did not return the expected root window",
+ TestName);
+ trace("Expected root=%0x", DefaultRootWindow(display));
+ trace("Returned root=%0x", root);
+ } else
+ CHECK;
+
+ if (x != ap.x) {
+ FAIL;
+ report("%s did not return the expected x coordinate",
+ TestName);
+ trace("Expected x=%d", ap.x);
+ trace("Returned x=%d", x);
+ } else
+ CHECK;
+
+ if (y != ap.y) {
+ FAIL;
+ report("%s did not return the expected y coordinate",
+ TestName);
+ trace("Expected y=%d", ap.y);
+ trace("Returned y=%d", y);
+ } else
+ CHECK;
+
+ if (width != ap.width) {
+ FAIL;
+ report("%s did not return the expected width",
+ TestName);
+ trace("Expected width=%u", ap.width);
+ trace("Returned width=%u", width);
+ } else
+ CHECK;
+
+ if (height != ap.height) {
+ FAIL;
+ report("%s did not return the expected height",
+ TestName);
+ trace("Expected height=%u", ap.height);
+ trace("Returned height=%u", height);
+ } else
+ CHECK;
+
+ if (border_width != XGG_BorderWidth) {
+ FAIL;
+ report("%s did not return the expected border_width",
+ TestName);
+ trace("Expected border_width=%u", XGG_BorderWidth);
+ trace("Returned border_width=%u", border_width);
+ } else
+ CHECK;
+
+ if (depth != vp->depth) {
+ FAIL;
+ report("%s did not return the expected depth",
+ TestName);
+ trace("Expected depth=%u", vp->depth);
+ trace("Returned depth=%u", depth);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(7*nvinf());
+>>ASSERTION Good A
+When the
+.A drawable
+is an
+.S InputOnly
+window, then a call to xname returns the root window in
+.A root_return ,
+the x and y coordinates of the upper-left outer corner relative to
+the parent window origin in
+.A x_return
+and
+.A y_return ,
+the inside width and height of the window in
+.A width_return
+and
+.A height_return ,
+and sets
+.A border_width_return
+and
+.A depth_return
+to zero.
+>>STRATEGY
+Create a parent window
+Create an InputOnly test window
+Call xname to obtain the test window geometry
+Verify that the returned values were as expected
+>>CODE
+Window parent, w;
+XSetWindowAttributes atts;
+
+/* Create a parent window */
+ parent = defwin(display);
+
+/* Create an InputOnly test window */
+ atts.override_redirect = config.debug_override_redirect;
+ w = XCreateWindow(display, parent, XGG_X, XGG_Y, XGG_Width, XGG_Height,
+ 0, 0, InputOnly, CopyFromParent,
+ CWOverrideRedirect, &atts);
+ regid(display, (union regtypes *)&w, REG_WINDOW);
+
+/* Call xname to obtain the test window geometry */
+ root = (Window)0;
+ x = -1;
+ y = -1;
+ width = 255;
+ height = 255;
+ border_width = 255;
+ depth = 255;
+
+ d = (Drawable)w;
+ XCALL;
+
+/* Verify that the returned values were as expected */
+ if (root != DefaultRootWindow(display)) {
+ FAIL;
+ report("%s did not return the expected root window",
+ TestName);
+ trace("Expected root=%0x", DefaultRootWindow(display));
+ trace("Returned root=%0x", root);
+ } else
+ CHECK;
+
+ if (x != XGG_X) {
+ FAIL;
+ report("%s did not return the expected x coordinate",
+ TestName);
+ trace("Expected x=%d", XGG_X);
+ trace("Returned x=%d", x);
+ } else
+ CHECK;
+
+ if (y != XGG_Y) {
+ FAIL;
+ report("%s did not return the expected y coordinate",
+ TestName);
+ trace("Expected y=%d", XGG_Y);
+ trace("Returned y=%d", y);
+ } else
+ CHECK;
+
+ if (width != XGG_Width) {
+ FAIL;
+ report("%s did not return the expected width",
+ TestName);
+ trace("Expected width=%u", XGG_Width);
+ trace("Returned width=%u", width);
+ } else
+ CHECK;
+
+ if (height != XGG_Height) {
+ FAIL;
+ report("%s did not return the expected height",
+ TestName);
+ trace("Expected height=%u", XGG_Height);
+ trace("Returned height=%u", height);
+ } else
+ CHECK;
+
+ if (border_width != 0) {
+ FAIL;
+ report("%s did not return the expected border_width",
+ TestName);
+ trace("Expected border_width=%u", 0);
+ trace("Returned border_width=%u", border_width);
+ } else
+ CHECK;
+
+ if (depth != 0) {
+ FAIL;
+ report("%s did not return the expected depth",
+ TestName);
+ trace("Expected depth=%u", 0);
+ trace("Returned depth=%u", depth);
+ } else
+ CHECK;
+
+ CHECKPASS(7);
+>>ASSERTION Good A
+When the
+.A drawable
+is a
+.S pixmap ,
+then a call to xname returns the root window in
+.A root_return ,
+the inside width and height in
+.A width_return
+and
+.A height_return ,
+the depth of the pixmap in
+.A depth_return ,
+and sets
+.A x_return ,
+.A y_return ,
+and
+.A border_width_return
+to zero.
+>>STRATEGY
+For each depth:
+ Create a parent window
+ Create a test pixmap
+ Call xname to obtain the test pixmap geometry
+ Verify that the values returned were as expected
+>>CODE
+XVisualInfo *vp;
+
+/* For each depth: */
+ for(resetvinf(VI_PIX); nextvinf(&vp); ) {
+ Window parent;
+ Pixmap pm;
+
+/* Create a parent window */
+ parent = makewin(display, vp);
+
+/* Create a test pixmap */
+ pm = XCreatePixmap(display, parent,
+ XGG_Width, XGG_Height, vp->depth);
+ regid(display, (union regtypes *)&pm, REG_PIXMAP);
+
+/* Call xname to obtain the test pixmap geometry */
+ root = (Window)0;
+ x = -1;
+ y = -1;
+ width = 255;
+ height = 255;
+ border_width = 255;
+ depth = 255;
+
+ d = (Drawable)pm;
+ XCALL;
+
+/* Verify that the values returned were as expected */
+ if (root != DefaultRootWindow(display)) {
+ FAIL;
+ report("%s did not return the expected root window",
+ TestName);
+ trace("Expected root=%0x", DefaultRootWindow(display));
+ trace("Returned root=%0x", root);
+ } else
+ CHECK;
+
+ if (x != 0) {
+ FAIL;
+ report("%s did not return the expected x coordinate",
+ TestName);
+ trace("Expected x=%d", 0);
+ trace("Returned x=%d", x);
+ } else
+ CHECK;
+
+ if (y != 0) {
+ FAIL;
+ report("%s did not return the expected y coordinate",
+ TestName);
+ trace("Expected y=%d", 0);
+ trace("Returned y=%d", y);
+ } else
+ CHECK;
+
+ if (width != XGG_Width) {
+ FAIL;
+ report("%s did not return the expected width",
+ TestName);
+ trace("Expected width=%u", XGG_Width);
+ trace("Returned width=%u", width);
+ } else
+ CHECK;
+
+ if (height != XGG_Height) {
+ FAIL;
+ report("%s did not return the expected height",
+ TestName);
+ trace("Expected height=%u", XGG_Height);
+ trace("Returned height=%u", height);
+ } else
+ CHECK;
+
+ if (border_width != 0) {
+ FAIL;
+ report("%s did not return the expected border_width",
+ TestName);
+ trace("Expected border_width=%u", 0);
+ trace("Returned border_width=%u", border_width);
+ } else
+ CHECK;
+
+ if (depth != vp->depth) {
+ FAIL;
+ report("%s did not return the expected depth",
+ TestName);
+ trace("Expected depth=%u", vp->depth);
+ trace("Returned depth=%u", depth);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(7*nvinf());
+>>ASSERTION Bad A
+.ER BadDrawable
diff --git a/xts5/Xlib5/XGetSelectionOwner/XGetSelectionOwner.m b/xts5/Xlib5/XGetSelectionOwner/XGetSelectionOwner.m
new file mode 100644
index 00000000..e962b634
--- /dev/null
+++ b/xts5/Xlib5/XGetSelectionOwner/XGetSelectionOwner.m
@@ -0,0 +1,171 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XGetSelectionOwner/XGetSelectionOwner.m,v 1.2 2005-11-03 08:43:39 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XGetSelectionOwner/XGetSelectionOwner.m
+>>#
+>># Description:
+>># Tests for XGetSelectionOwner()
+>>#
+>># Modifications:
+>># $Log: gtslctnown.m,v $
+>># Revision 1.2 2005-11-03 08:43:39 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:27 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:45 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:02 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:59 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:30 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:18 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:36 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:20 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XGetSelectionOwner Xlib5
+Window
+
+Display *display = Dsp;
+Atom selection = XA_COPYRIGHT;
+>>EXTERN
+#include "X11/Xatom.h"
+>>ASSERTION Good A
+A call to xname returns the window ID associated with the window that
+currently owns the specified
+.A selection .
+>>STRATEGY
+Create a window with a selection.
+Call xname to obtain the window ID of the selection owner.
+Verify the window ID returned was that of the selection owner.
+>>CODE
+Window owner, ret;
+
+/* Create a window with a selection. */
+ owner = defwin(display);
+ XSetSelectionOwner(display, selection, owner, CurrentTime);
+
+/* Call xname to obtain the window ID of the selection owner. */
+ ret = XCALL;
+
+/* Verify the window ID returned was that of the selection owner. */
+ if (ret != owner) {
+ FAIL;
+ report("%s did not return the window ID of the selection owner",
+ TestName);
+ trace("Expected window ID: %0x", owner);
+ trace("Returned window ID: %0x", ret);
+ } else
+ CHECK;
+
+ CHECKPASS(1);
+
+>>ASSERTION Good A
+When the
+.A selection
+is not owned by a window, then a call to xname returns
+.S None .
+>>STRATEGY
+Ensure the selection has no owner.
+Call xname to obtain selection owner.
+Verify that xname returned None.
+>>CODE
+Window ret;
+
+/* Ensure the selection has no owner. */
+ XSetSelectionOwner(display, selection, None, CurrentTime);
+
+/* Call xname to obtain selection owner. */
+ ret = XCALL;
+
+/* Verify that xname returned None. */
+ if(ret != None) {
+ FAIL;
+ report("%s returned %0x on a selection with no owner.",
+ TestName);
+ report("Expecting None.");
+ } else
+ CHECK;
+
+ CHECKPASS(1);
+
+>>ASSERTION Bad A
+.ER BadAtom
diff --git a/xts5/Xlib5/XGetWindowAttributes/XGetWindowAttributes.m b/xts5/Xlib5/XGetWindowAttributes/XGetWindowAttributes.m
new file mode 100644
index 00000000..7c9ea804
--- /dev/null
+++ b/xts5/Xlib5/XGetWindowAttributes/XGetWindowAttributes.m
@@ -0,0 +1,415 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XGetWindowAttributes/XGetWindowAttributes.m,v 1.2 2005-11-03 08:43:39 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XGetWindowAttributes/XGetWindowAttributes.m
+>>#
+>># Description:
+>># Tests for XGetWindowAttributes()
+>>#
+>># Modifications:
+>># $Log: gtwdwattrb.m,v $
+>># Revision 1.2 2005-11-03 08:43:39 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:27 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:45 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:03 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:18:59 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:31 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.0 1995/12/15 08:48:37 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:23 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XGetWindowAttributes Xlib5
+Status
+
+Display *display = Dsp;
+Window w;
+XWindowAttributes *window_attributes_return = &w_a;
+>>EXTERN
+XWindowAttributes w_a;
+>># There is only one assertion here. The rational for this is that
+>># this is a fundemental function, and that many of our tests rely
+>># on the correct working of this to succeed. If there is
+>># a problem with the function it will manifest itself elsewhere.
+>># -stuart.
+>>ASSERTION Good A
+A call to xname on an existing window
+.A w
+returns
+.S True ,
+and the current attributes for the specified window
+.A w
+to the
+.A window_attributes_return
+structure.
+>>STRATEGY
+Create a colormap.
+Install a colormap.
+Create a window.
+Call xname to obtain the window attributes.
+Verify the window attributes were returned as expected.
+>>CODE
+Window parent;
+int x, y, depth;
+unsigned int width, height, border_width, class;
+XVisualInfo *vinf;
+Visual *visual;
+unsigned long valuemask;
+XSetWindowAttributes attributes;
+
+/* Create a window. */
+ resetvinf(VI_WIN);
+ if( !nextvinf(&vinf) ) {
+ delete("nextvinf call returned false");
+ return;
+ } else
+ CHECK;
+
+ parent = DefaultRootWindow(Dsp);
+ x = 5;
+ y = 10;
+ width = 15;
+ height = 20;
+ border_width = 3;
+ depth = vinf->depth;
+ class = InputOutput;
+ visual= vinf->visual;
+ valuemask = CWBitGravity | CWWinGravity | CWBackingStore |
+ CWBackingPlanes | CWBackingPixel | CWSaveUnder | CWColormap |
+ CWOverrideRedirect | CWBorderPixel;
+
+ attributes.bit_gravity = NorthGravity;
+ attributes.win_gravity = SouthGravity;
+ attributes.backing_store = WhenMapped;
+ attributes.backing_planes= 3;
+ attributes.backing_pixel = 1;
+ attributes.save_under = True;
+
+ /*
+ * Create a colormap of the correct visual type, since there are
+ * no guarantees that the selected visual is the default visual.
+ * Install the colormap to ensure that we can test the
+ * map_installed value
+ */
+ attributes.colormap = makecolmap(display, vinf->visual, AllocNone);
+ XInstallColormap( display, attributes.colormap );
+
+ /*
+ * Set the window border pixel also, since it is possible that the
+ * window visual does not match that of it's parent (the root),
+ * causing a BadMatch error since the default border pixmap is
+ * CopyFromParent.
+ */
+ attributes.border_pixel = 0;
+
+ attributes.override_redirect = True;
+
+ w = XCreateWindow(display, parent, x, y, width, height, border_width,
+ depth, class, visual, valuemask, &attributes);
+ regid(display, (union regtypes *)&w, REG_WINDOW);
+
+/* Call xname to obtain the window attributes. */
+ XCALL;
+
+/* Verify the window attributes were returned as expected. */
+#ifdef TESTING
+ x--; y--; width--; height--; class--; depth--;
+ attributes.bit_gravity = EastGravity;
+ attributes.win_gravity = WestGravity;
+ attributes.backing_store = NotUseful;
+ attributes.backing_planes= 5;
+ attributes.backing_pixel = 0;
+ attributes.save_under = False;
+ attributes.colormap = CopyFromParent;
+ attributes.all_event_masks = StructureNotifyMask;
+ attributes.your_event_mask = StructureNotifyMask;
+ attributes.do_not_propagate_mask = StructureNotifyMask;
+ attributes.override_redirect = False;
+#endif
+ if (w_a.x != x || w_a.y != y) {
+ FAIL;
+ report("%s did not return expected x,y coordinates", TestName);
+ trace("Expected x=%d, y=%d", x, y);
+ trace("Returned x=%d, y=%d", w_a.x, w_a.y);
+ } else
+ CHECK;
+
+ if (w_a.width != width) {
+ FAIL;
+ report("%s did not return expected width", TestName);
+ trace("Expected width=%u", width);
+ trace("Returned width=%u", w_a.width);
+ } else
+ CHECK;
+
+ if (w_a.height != height) {
+ FAIL;
+ report("%s did not return expected height", TestName);
+ trace("Expected height=%u", height);
+ trace("Returned height=%u", w_a.height);
+ } else
+ CHECK;
+
+ if (w_a.border_width != border_width) {
+ FAIL;
+ report("%s did not return expected border width", TestName);
+ trace("Expected border_width=%u", border_width);
+ trace("Returned border_width=%u", w_a.border_width);
+ } else
+ CHECK;
+
+ if (w_a.depth != depth) {
+ FAIL;
+ report("%s did not return expected depth", TestName);
+ trace("Expected depth=%d", depth);
+ trace("Returned depth=%d", w_a.depth);
+ } else
+ CHECK;
+
+ if (XVisualIDFromVisual(w_a.visual) != XVisualIDFromVisual(visual)) {
+ FAIL;
+ report("%s did not return expected visual", TestName);
+ trace("Expected visual=%d", XVisualIDFromVisual(visual));
+ trace("Returned visual=%d", XVisualIDFromVisual(w_a.visual));
+ } else
+ CHECK;
+
+ if (w_a.root != parent) {
+ FAIL;
+ report("%s did not return expected root window", TestName);
+ trace("Expected root window=%d", parent);
+ trace("Returned root window=%d", w_a.root);
+ } else
+ CHECK;
+
+ if (w_a.class != class) {
+ FAIL;
+ report("%s did not return expected class", TestName);
+ trace("Expected class=%u", class);
+ trace("Returned class=%u", w_a.class);
+ } else
+ CHECK;
+
+ if (w_a.bit_gravity != attributes.bit_gravity) {
+ FAIL;
+ report("%s did not return expected bit gravity", TestName);
+ trace("Expected bit_gravity=%s",
+ bitgravityname(attributes.bit_gravity));
+ trace("Returned bit_gravity=%s",
+ bitgravityname(w_a.bit_gravity));
+ } else
+ CHECK;
+
+ if (w_a.win_gravity != attributes.win_gravity) {
+ FAIL;
+ report("%s did not return expected win gravity", TestName);
+ trace("Expected win_gravity=%s",
+ wingravityname(attributes.win_gravity));
+ trace("Returned win_gravity=%s",
+ wingravityname(w_a.win_gravity));
+ } else
+ CHECK;
+
+ if (w_a.backing_store != attributes.backing_store) {
+ FAIL;
+ report("%s did not return expected backing store", TestName);
+ trace("Expected backing_store=%s",
+ backingstorename(attributes.backing_store));
+ trace("Returned backing_store=%s",
+ backingstorename(w_a.backing_store));
+ } else
+ CHECK;
+
+ if (w_a.backing_planes != attributes.backing_planes) {
+ FAIL;
+ report("%s did not return expected backing planes", TestName);
+ trace("Expected backing_planes=%u", attributes.backing_planes);
+ trace("Returned backing_planes=%u", w_a.backing_planes);
+ } else
+ CHECK;
+
+ if (w_a.backing_pixel != attributes.backing_pixel) {
+ FAIL;
+ report("%s did not return expected backing pixel", TestName);
+ trace("Expected backing_pixel=%u", attributes.backing_pixel);
+ trace("Returned backing_pixel=%u", w_a.backing_pixel);
+ } else
+ CHECK;
+
+ if (w_a.save_under != attributes.save_under) {
+ FAIL;
+ report("%s did not return expected save under", TestName);
+ trace("Expected save_under=%s",
+ boolname(attributes.save_under));
+ trace("Returned save_under=%s",
+ boolname(w_a.save_under));
+ } else
+ CHECK;
+
+ if (w_a.colormap != attributes.colormap) {
+ FAIL;
+ report("%s did not return expected colormap", TestName);
+ trace("Expected colormap=%d", attributes.colormap);
+ trace("Returned colormap=%d", w_a.colormap);
+ } else
+ CHECK;
+
+ if (w_a.map_installed != True) {
+ FAIL;
+ report("%s did not return expected map_installed", TestName);
+ trace("Expected map_installed=%s",
+ boolname(True));
+ trace("Returned map_installed=%s",
+ boolname(w_a.map_installed));
+ } else
+ CHECK;
+
+ if (w_a.map_state != IsUnmapped ) {
+ FAIL;
+ report("%s did not return expected map_state", TestName);
+ trace("Expected map_state=%s",
+ mapstatename(IsUnmapped));
+ trace("Returned map_state=%s",
+ mapstatename(w_a.map_state));
+ } else
+ CHECK;
+
+ if (w_a.all_event_masks != NoEventMask ) {
+ FAIL;
+ report("%s did not return expected all_event_masks", TestName);
+ trace("Expected all_event_masks=%s",
+ eventmaskname(NoEventMask));
+ trace("Returned all_event_masks=%s",
+ eventmaskname((unsigned long)w_a.all_event_masks));
+ } else
+ CHECK;
+
+ if (w_a.your_event_mask != NoEventMask ) {
+ FAIL;
+ report("%s did not return expected your_event_mask", TestName);
+ trace("Expected your_event_mask=%s",
+ eventmaskname(NoEventMask));
+ trace("Returned your_event_mask=%s",
+ eventmaskname((unsigned long)w_a.your_event_mask));
+ } else
+ CHECK;
+
+ if (w_a.do_not_propagate_mask != NoEventMask ) {
+ FAIL;
+ report("%s did not return expected do_not_propagate_mask",
+ TestName);
+ trace("Expected do_not_propagate_mask=%s",
+ eventmaskname(NoEventMask));
+ trace("Returned do_not_propagate_mask=%s",
+ eventmaskname((unsigned long)w_a.do_not_propagate_mask));
+ } else
+ CHECK;
+
+ if (w_a.override_redirect != True) {
+ FAIL;
+ report("%s did not return expected override_redirect",
+ TestName);
+ trace("Expected override_redirect=%s",
+ boolname(attributes.override_redirect));
+ trace("Returned override_redirect=%s",
+ boolname(w_a.override_redirect));
+ } else
+ CHECK;
+
+ if (w_a.screen != DefaultScreenOfDisplay(display) ) {
+ FAIL;
+ report("%s did not return expected screen pointer",
+ TestName);
+ } else
+ CHECK;
+
+ CHECKPASS(23);
+
+>>ASSERTION Bad B 1
+>># The bad drawable could occur if the window is destroyed whilst the
+>># request is being processed. The Prize for the most original, working
+>># implementation is two Milky Ways..... -stuart.
+When xname is called, then a
+.S BadDrawable
+error can occur.
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XGetWindowProperty/XGetWindowProperty.m b/xts5/Xlib5/XGetWindowProperty/XGetWindowProperty.m
new file mode 100644
index 00000000..31c9ab87
--- /dev/null
+++ b/xts5/Xlib5/XGetWindowProperty/XGetWindowProperty.m
@@ -0,0 +1,1025 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XGetWindowProperty/XGetWindowProperty.m,v 1.3 2005-11-03 08:43:39 jmichael Exp $
+
+Copyright (c) 2001 The Open Group
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XGetWindowProperty/XGetWindowProperty.m
+>>#
+>># Description:
+>># Tests for XGetWindowProperty()
+>>#
+>># Modifications:
+>># $Log: gtwdwprprt.m,v $
+>># Revision 1.3 2005-11-03 08:43:39 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.2 2005/04/21 09:40:42 ajosey
+>># resync to VSW5.1.5
+>>#
+>># Revision 8.2 2005/01/21 10:48:22 gwc
+>># Updated copyright notice
+>>#
+>># Revision 8.1 2001/10/04 09:44:52 vsx
+>># req.4.W.00157: fix incorrect comments about 32 bit longs
+>>#
+>># Revision 8.0 1998/12/23 23:26:46 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:03 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:00 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:31 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:19 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:39 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:26 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XGetWindowProperty Xlib5
+int
+
+Display *display = Dsp;
+Window w = defwin(display);
+Atom property = XA_COPYRIGHT;
+long long_offset = 2;
+long long_length = 2;
+Bool delete_prop = False;
+Atom req_type = XA_STRING;
+Atom *actual_type_return = &actual_type;
+int *actual_format_return = &actual_format;
+unsigned long *nitems_return = &nitems;
+unsigned long *bytes_after_return = &bytes_after;
+unsigned char **prop_return = &prop;
+>>EXTERN
+#include "X11/Xatom.h"
+
+static Atom actual_type;
+static int actual_format;
+static unsigned long nitems;
+static unsigned long bytes_after;
+static unsigned char *prop;
+
+static void
+set_vars()
+{
+ actual_type = 0;
+ actual_format = -1;
+ nitems = -1;
+ bytes_after = -1;
+ prop = (unsigned char *)NULL;
+}
+
+static int
+check_values( ex_actual_type, ex_actual_format, ex_nitems, ex_bytes_after )
+Atom ex_actual_type;
+int ex_actual_format;
+unsigned long ex_nitems;
+unsigned long ex_bytes_after;
+{
+ int fail;
+ int pass;
+
+ fail=0;
+ pass=0;
+
+#ifdef TESTING_CHECK
+ ex_actual_type = XA_RESOLUTION;
+ ex_actual_format = 6;
+ ex_nitems=256;
+ ex_bytes_after=256;
+#endif
+ if (actual_type != ex_actual_type) {
+ FAIL;
+ report("%s returned an incorrect actual_type_return",
+ TestName);
+ report("Expected actual_type_return: %u (%s)", ex_actual_type,
+ (ex_actual_type==None?"None":atomname(ex_actual_type)));
+ report("Returned actual_type_return: %u (%s)",
+ actual_type, atomname(actual_type));
+ } else
+ pass++;
+
+ if (actual_format != ex_actual_format) {
+ FAIL;
+ report("%s returned an incorrect actual_format_return",
+ TestName);
+ report("Expected actual_format_return: %d", ex_actual_format);
+ report("Returned actual_format_return: %d", actual_format);
+ } else
+ pass++;
+
+ if (nitems != ex_nitems) {
+ FAIL;
+ report("%s returned an incorrect nitems_return",
+ TestName);
+ report("Expected nitems_return: %d", ex_nitems);
+ report("Returned nitems_return: %d", nitems);
+ } else
+ pass++;
+
+ if (bytes_after != ex_bytes_after) {
+ FAIL;
+ report("%s returned an incorrect bytes_after_return",
+ TestName);
+ report("Expected bytes_after_return: %d", ex_bytes_after);
+ report("Returned bytes_after_return: %d", bytes_after);
+ } else
+ pass++;
+
+ return((fail==0 && pass==4?1:0));
+}
+
+>>ASSERTION Good A
+A successful call to xname returns
+.A Success
+and the actual type of the property, the actual format of the property,
+the number of 8-bit, 16-bit, or 32-bit items transferred,
+the number of bytes remaining to be read in the property,
+and a pointer to the data actually returned.
+>>STRATEGY
+Create a window with a property.
+Call xname to obtain the property information.
+Verify that the returned information was correct.
+>>CODE
+int ret;
+unsigned char cbuf[5];
+char *data = "a tested property";
+
+/* Create a window with a property. */
+ XChangeProperty(display, w, property, XA_STRING, 8,
+ PropModeReplace,(unsigned char *)data, strlen(data));
+
+/* Call xname to obtain the property information. */
+ set_vars();
+ long_offset = 3;
+ long_length = 1;
+ delete_prop = False;
+ ret = XCALL;
+
+/* Verify that the returned information was correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))", TestName,
+ ret, Success);
+ } else
+ CHECK;
+
+ if (check_values( XA_STRING, 8, (unsigned long)4, (unsigned long)1 )) {
+ CHECK;
+ } else
+ FAIL;
+
+ (void) strncpy((char *)cbuf, &(data[12]), 4);
+ cbuf[4] = '\0';
+
+ if (prop == (unsigned char *)NULL) {
+ FAIL;
+ report("%s returned an incorrect prop_return",
+ TestName);
+ report("Expected prop_return: unsigned char * pointer");
+ report("Returned prop_return: NULL pointer");
+ } else
+ if (strncmp((char *)prop, (char *)cbuf, 5) != 0) {
+ FAIL;
+ report("%s returned an incorrect prop_return",
+ TestName);
+ report("Expected prop_return: '%s'", cbuf);
+ report("Returned prop_return: '%s'", prop);
+ } else
+ CHECK;
+
+ CHECKPASS(3);
+
+>>ASSERTION Good A
+>># Test for both delete True/False
+>># Ensure no PropertyNotify events were generated. -stuart.
+When the specified
+.A property
+does not exist for the specified window
+.A w ,
+then a call to xname returns
+.S None
+to
+.A actual_type_return ,
+zero to
+.A actual_format_return
+and
+.A bytes_after_return ,
+the
+.A nitems_return
+argument is empty, and the
+.A delete
+argument is ignored.
+>>STRATEGY
+Create a window with PropertyChangeMask events selected and no properties.
+For delete_prop of True and False:
+ Call xname to obtain the property information.
+ Verify that the returned values were correct.
+ Verify that no PropertyNotify events were generated.
+>>CODE
+int mode;
+int ret;
+XEvent ev;
+
+/* Create a window with PropertyChangeMask events selected and no properties. */
+ XDeleteProperty(display, w, property); /* ENSURE property is nuked. */
+ XSync(display,True);
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* For delete_prop of True and False: */
+ for(mode=0; mode<2; mode++) {
+
+/* Call xname to obtain the property information. */
+ delete_prop = (mode==0?True:False);
+ trace("delete_prop is %s", boolname(delete_prop));
+ set_vars();
+ long_offset = 3;
+ long_length = 1;
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( None, 0,
+ (unsigned long)0, (unsigned long)0 ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+/* Verify that no PropertyNotify events were generated. */
+ ret = getevent(display, &ev);
+#ifdef TESTING
+ ret++;
+ ev.type = PropertyNotify;
+#endif
+ if (ret != 0) {
+ FAIL;
+ report("%s caused %d unexpected event%s", TestName,
+ ret, (ret==1?"":"s"));
+ do {
+ report("event %s returned", eventname(ev.type));
+ } while(getevent(display, &ev) != 0) ;
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2*3);
+>>ASSERTION Good A
+>># Ensure the last item by ensuring no PropertyNotify events were
+>># generated. Test for both delete True and False. -stuart.
+When the specified
+.A property
+exists for the specified window
+.A w
+and the type does not match the specified
+.A req_type ,
+then a call to xname returns the actual property type to
+.A actual_type_return ,
+the actual property format to
+.A actual_format_return ,
+and the property length in bytes to
+.A bytes_after_return ,
+the
+.A nitems_return
+argument is empty, and the
+.A delete
+argument is ignored.
+>>STRATEGY
+Create a window with a property and PropertyChangeMask events selected.
+For delete_prop of True and False:
+ Call xname to obtain the property information.
+ Verify that the returned values were correct.
+ Verify that no PropertyNotify events were generated.
+>>CODE
+int mode;
+int ret;
+char *data = "a tested property";
+XEvent ev;
+
+/* Create a window with a property and PropertyChangeMask events selected. */
+ XChangeProperty(display, w, property, XA_STRING, 8,
+ PropModeReplace,(unsigned char *)data, strlen(data));
+ XSync(display,True);
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* For delete_prop of True and False: */
+ for(mode=0; mode<2; mode++) {
+
+/* Call xname to obtain the property information. */
+ delete_prop = (mode==0?True:False);
+ trace("delete_prop is %s", boolname(delete_prop));
+ set_vars();
+ long_offset = 3;
+ long_length = 1;
+ req_type = XA_INTEGER;
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( XA_STRING, 8,
+ (unsigned long)0, (unsigned long)strlen(data) ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+/* Verify that no PropertyNotify events were generated. */
+ ret = getevent(display, &ev);
+#ifdef TESTING
+ ret++;
+ ev.type = PropertyNotify;
+#endif
+ if (ret != 0) {
+ FAIL;
+ report("%s caused %d unexpected event%s", TestName,
+ ret, (ret==1?"":"s"));
+ do {
+ report("event %s returned", eventname(ev.type));
+ } while(getevent(display, &ev) != 0) ;
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2*3);
+>>ASSERTION Good A
+>># Ensure a) No PropertyNotify events generated
+>># b) That the property can be referenced again.
+>># c) tested for req_type of type and AnyPropertyType
+>># Test this by using long_offset and long_length to test different
+>># values for bytes_after_return and nitems_return. -stuart.
+>># There might be a better way of expressing the assertion...
+When the specified
+.A property
+exists for the specified window
+.A w ,
+.A req_type
+is set to the type of the property or
+.S AnyPropertyType ,
+and
+.A delete
+is set to
+.S False ,
+then a call to xname returns the actual
+.A property
+type to
+.A actual_type_return ,
+the actual
+.A property
+format to
+.A actual_format_return ,
+the number of trailing unread bytes in the
+.A property
+in
+.A bytes_after_return ,
+the number of 8/16/32 bit items in
+.A nitems_return ,
+the data is placed in
+.A prop_return ,
+where the data is sourced from four times
+.A long_offset
+bytes into the
+.A property ,
+and is the minimum of the remaining bytes
+left in the
+.A property
+and four times
+.A long_length
+bytes long, and the
+.A property
+is not deleted.
+>>STRATEGY
+Create a window with testable properties.
+For req_type is the required type and AnyPropertyType:
+ Call xname to obtain the property information of a STRING property,
+ with delete False.
+ Verify that the returned values were correct.
+ Verify that no PropertyNotify events were generated.
+ Call xname to obtain the property information of an INTEGER property,
+ with delete False.
+ Verify that the returned values were correct.
+ Verify that no PropertyNotify events were generated.
+>>CODE
+int ret;
+int mode;
+char *cdata = "a tested property";
+>># Note that this _must_ be an array of longs, even if longs are 64 bit
+unsigned long idata[4];
+XEvent ev;
+
+/* Create a window with testable properties. */
+ XChangeProperty(display, w, XA_COPYRIGHT, XA_STRING, 8,
+ PropModeReplace, (unsigned char *)cdata, strlen(cdata));
+
+ for( ret=0; ret<4; ret++ )
+ idata[ret] = ret;
+ XChangeProperty(display, w, XA_NOTICE, XA_INTEGER, 32,
+ PropModeReplace, (unsigned char *)idata, 4);
+
+ XSync(display, True);
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* For req_type is the required type and AnyPropertyType: */
+ for(mode=0; mode<2 ;mode++) {
+
+ trace("Calling %s to obtain string information", TestName);
+/* Call xname to obtain the property information of a STRING property, */
+/* with delete False. */
+ set_vars();
+ property = XA_COPYRIGHT;
+ long_length = 2; /* Attempt to read 8 bytes from */
+ long_offset = 4; /* 16 bytes into the property. */
+ /* We expect only one byte to be returned. */
+ trace("req_type is %s", (mode==0?"STRING":"AnyPropertyType"));
+ req_type=(mode==0?XA_STRING:AnyPropertyType);
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( XA_STRING, 8,
+ (unsigned long)1, (unsigned long)0 ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+ if (prop == (unsigned char *)NULL) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: unsigned char * pointer");
+ report("Returned prop_return: NULL pointer");
+ } else
+ if (strncmp((char *)prop, "y", 1) != 0) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: 'y'");
+ report("Returned prop_return: '%s'", prop);
+ } else
+ CHECK;
+
+/* Verify that no PropertyNotify events were generated. */
+ ret = getevent(display, &ev);
+ if (ret != 0) {
+ FAIL;
+ report("%s caused %d unexpected event%s", TestName,
+ ret, (ret==1?"":"s"));
+ do {
+ report("event %s returned", eventname(ev.type));
+ } while(getevent(display, &ev) != 0) ;
+ } else
+ CHECK;
+
+ trace("Calling %s to obtain integer information", TestName);
+/* Call xname to obtain the property information of an INTEGER property, */
+/* with delete False. */
+ set_vars();
+ property = XA_NOTICE;
+ long_length = 1; /* Attempt to read 4 bytes from */
+ long_offset = 1; /* 4 bytes into the property. */
+ /* We expect one integer to be returned. */
+ trace("req_type is %s", (mode==0?"INTEGER":"AnyPropertyType"));
+ req_type=(mode==0?XA_INTEGER:AnyPropertyType);
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( XA_INTEGER, 32,
+ (unsigned long)1, (unsigned long)8 ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+ if (prop == (unsigned char *)NULL) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: unsigned char * pointer");
+ report("Returned prop_return: NULL pointer");
+ } else
+ if ( *(unsigned long *)prop != idata[1] ) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: %u", idata[1]);
+ report("Returned prop_return: %u",
+ *(unsigned long*)prop);
+ } else
+ CHECK;
+
+/* Verify that no PropertyNotify events were generated. */
+ ret = getevent(display, &ev);
+ if (ret != 0) {
+ FAIL;
+ report("%s caused %d unexpected event%s", TestName,
+ ret, (ret==1?"":"s"));
+ do {
+ report("event %s returned", eventname(ev.type));
+ } while(getevent(display, &ev) != 0) ;
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2*8);
+
+>>ASSERTION Good A
+>># NEW, NON_MIT_REVIEWED ASSERTION
+When the specified
+.A property
+exists for the specified window
+.A w ,
+.A req_type
+is set to the type of the property or
+.S AnyPropertyType ,
+and
+.A delete
+is set to
+.S True ,
+and on a call to xname the number of unread bytes in the
+.A property
+returned to
+.A bytes_after_return
+is non-zero, then
+the actual
+.A property
+type is returned to
+.A actual_type_return ,
+the actual
+.A property
+format to
+.A actual_format_return ,
+the number of trailing unread bytes in the
+.A property
+in
+.A bytes_after_return ,
+the number of 8/16/32 bit items in
+.A nitems_return ,
+the data is placed in
+.A prop_return ,
+where the data is sourced from four times
+.A long_offset
+bytes into the
+.A property ,
+and is the minimum of the remaining bytes
+left in the
+.A property
+and four times
+.A long_length
+bytes long, and the
+.A property
+is not deleted.
+>>STRATEGY
+Create a window with testable properties.
+For req_type is the required type and AnyPropertyType:
+ Call xname to obtain the property information of a STRING property,
+ with delete True.
+ Verify that the returned values were correct.
+ Verify that no PropertyNotify events were generated.
+ Call xname to obtain the property information of an INTEGER property,
+ with delete True.
+ Verify that the returned values were correct.
+ Verify that no PropertyNotify events were generated.
+>>CODE
+int ret;
+int mode;
+char *cdata = "a tested property";
+>># Note that this _must_ be an array of longs, even if longs are 64 bit
+unsigned long idata[4];
+XEvent ev;
+
+/* Create a window with testable properties. */
+ XChangeProperty(display, w, XA_COPYRIGHT, XA_STRING, 8,
+ PropModeReplace, (unsigned char *)cdata, strlen(cdata));
+
+ for( ret=0; ret<4; ret++ )
+ idata[ret] = ret;
+ XChangeProperty(display, w, XA_NOTICE, XA_INTEGER, 32,
+ PropModeReplace, (unsigned char *)idata, 4);
+
+ XSync(display, True);
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* For req_type is the required type and AnyPropertyType: */
+ for(mode=0; mode<2 ;mode++) {
+
+ trace("Calling %s to obtain string information", TestName);
+/* Call xname to obtain the property information of a STRING property, */
+/* with delete True. */
+ set_vars();
+ property = XA_COPYRIGHT;
+ long_length = 1; /* Attempt to read 4 bytes from */
+ long_offset = 1; /* 4 bytes into the property. */
+ /* We expect 4 bytes to be returned. */
+ trace("req_type is %s", (mode==0?"STRING":"AnyPropertyType"));
+ req_type=(mode==0?XA_STRING:AnyPropertyType);
+ delete_prop=True;
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( XA_STRING, 8,
+ (unsigned long)4, (unsigned long)9 ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+ if (prop == (unsigned char *)NULL) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: unsigned char * pointer");
+ report("Returned prop_return: NULL pointer");
+ } else
+ if (strncmp((char *)prop, "sted", 1) != 0) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: 'sted'");
+ report("Returned prop_return: '%s'", prop);
+ } else
+ CHECK;
+
+/* Verify that no PropertyNotify events were generated. */
+ ret = getevent(display, &ev);
+ if (ret != 0) {
+ FAIL;
+ report("%s caused %d unexpected event%s", TestName,
+ ret, (ret==1?"":"s"));
+ do {
+ report("event %s returned", eventname(ev.type));
+ } while(getevent(display, &ev) != 0) ;
+ } else
+ CHECK;
+
+ trace("Calling %s to obtain integer information", TestName);
+/* Call xname to obtain the property information of an INTEGER property, */
+/* with delete True. */
+ set_vars();
+ property = XA_NOTICE;
+ long_length = 1; /* Attempt to read 4 bytes from */
+ long_offset = 1; /* 4 bytes into the property. */
+ /* We expect one integer to be returned. */
+ trace("req_type is %s", (mode==0?"INTEGER":"AnyPropertyType"));
+ req_type=(mode==0?XA_INTEGER:AnyPropertyType);
+ delete_prop = True;
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( XA_INTEGER, 32,
+ (unsigned long)1, (unsigned long)8 ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+ if (prop == (unsigned char *)NULL) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: unsigned char * pointer");
+ report("Returned prop_return: NULL pointer");
+ } else
+ if ( *(unsigned long *)prop != idata[1] ) {
+ FAIL;
+ report("%s returned an unexpected prop_return");
+ report("Expected prop_return: %u", idata[1]);
+ report("Returned prop_return: %u",
+ *(unsigned long *)prop);
+ } else
+ CHECK;
+
+/* Verify that no PropertyNotify events were generated. */
+ ret = getevent(display, &ev);
+ if (ret != 0) {
+ FAIL;
+ report("%s caused %d unexpected event%s", TestName,
+ ret, (ret==1?"":"s"));
+ do {
+ report("event %s returned", eventname(ev.type));
+ } while(getevent(display, &ev) != 0) ;
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2*8);
+
+>>ASSERTION Good A
+When the specified
+.A property
+exists for the specified window
+.A w ,
+.A req_type
+is set to the type of the property or
+.S AnyPropertyType ,
+.A delete
+is set to
+.S True ,
+and on a call to xname the number of unread bytes in the
+.A property
+returned to
+.A bytes_after_return
+is zero, then the property is deleted from the window
+.A w
+and a
+.S PropertyNotify
+event is generated on the specified window
+.A w .
+>>STRATEGY
+Create a window with PropertyChangeMask events selected.
+For req_type is the required type and AnyPropertyType:
+ Create a property on the window.
+ Call xname to obtain the property information,
+ with delete True.
+ Verify that the returned values were correct.
+ Verify that a single PropertyNotify event was generated.
+ Verify that the property has been deleted.
+>>CODE
+int mode;
+int ret;
+char *data="a tested property";
+XEvent ev;
+
+/* Create a window with PropertyChangeMask events selected. */
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* For req_type is the required type and AnyPropertyType: */
+ for(mode=0; mode<2 ;mode++) {
+
+/* Create a property on the window. */
+ XChangeProperty(display, w, XA_COPYRIGHT, XA_STRING, 8,
+ PropModeReplace, (unsigned char *)data, strlen(data));
+ XSync(display,True);
+
+/* Call xname to obtain the property information, */
+/* with delete True. */
+
+ set_vars();
+
+ delete_prop = True;
+ req_type=(mode==0?XA_STRING:AnyPropertyType);
+ long_offset = 3;
+ long_length = 2;
+
+ trace("delete_prop is %s", boolname(delete_prop));
+ trace("req_type is %s", (mode==0?"STRING":"AnyPropertyType"));
+ ret = XCALL;
+ XSync(display, False);
+
+/* Verify that the returned values were correct. */
+ if (ret != Success) {
+ FAIL;
+ report("%s returned %d (expecting Success (%d))",
+ TestName, ret, Success);
+ } else
+ CHECK;
+
+ if ( check_values( XA_STRING, 8,
+ (unsigned long)5, (unsigned long)0 ) ) {
+ CHECK;
+ } else
+ FAIL;
+
+/* Verify that a single PropertyNotify event was generated. */
+ ret = getevent(display, &ev);
+ if (ret != 1 || ev.type != PropertyNotify) {
+ FAIL;
+ report("%s caused %d events", TestName, ret);
+ report("Expecting a single PropertyNotify event");
+ while(ret != 0) {
+ report("Returned: %s event",
+ eventname(ev.type));
+ ret = getevent(display, &ev);
+ }
+ } else {
+ XEvent good;
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.display = display;
+ good.xproperty.serial = 0; /* Can't know */
+ good.xproperty.send_event = False;
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.atom = XA_COPYRIGHT;
+ good.xproperty.time = 0 ; /* Can't know */
+ good.xproperty.state = PropertyDelete;
+
+ if (checkevent(&good, &ev) != 0) {
+ FAIL;
+ } else
+ CHECK;
+ }
+
+/* Verify that the property has been deleted. */
+ delete_prop=False;
+ ret = XCALL;
+
+ if ((ret != Success) || !check_values(None, 0,
+ (unsigned long)0, (unsigned long)0) ) {
+ FAIL;
+ report("Property was not deleted.");
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2*4);
+
+>>ASSERTION Good A
+A call to xname always allocates one extra byte in
+.A prop_return
+and sets it to ASCII
+.A NULL .
+>>STRATEGY
+Create a window with a property.
+Call xname to obtain property information.
+Verify that prop_return contained an ASCII NULL.
+>>CODE
+int ret;
+char *data = "a tested property";
+
+/* Create a window with a property. */
+ XChangeProperty(display, w, property, XA_STRING, 8, PropModeReplace,
+ (unsigned char *)data, strlen(data));
+
+/* Call xname to obtain property information. */
+ set_vars();
+ long_offset=1;
+ long_length=0;
+ ret = XCALL;
+
+ if (ret != Success) {
+ delete("%s returned %d when expecting %d", ret, Success);
+ return;
+ } else
+ CHECK;
+
+ if (!check_values( XA_STRING, 8,
+ (unsigned long)0, (unsigned long)13 )) {
+ delete("%s returned unexpected values");
+ } else
+ CHECK;
+
+/* Verify that prop_return contained an ASCII NULL. */
+
+ if (prop == (unsigned char *)NULL) {
+ FAIL;
+ report("%s returned an unexpected prop_return", TestName);
+ report("Expected prop_return: unsigned char * pointer");
+ report("Returned prop_return: NULL pointer");
+ return;
+ } else
+ CHECK;
+
+ if (*prop != (unsigned char)'\0') {
+ FAIL;
+ report("%s did not allocate an ASCII NULL character beyond");
+ report("the prop_return data.");
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+>>ASSERTION Bad A
+.ER BadWindow
+>>ASSERTION Bad A
+.ER BadAtom
+>>ASSERTION Bad A
+When xname is called with
+.A long_offset
+such that the offset lies beyond the end of the
+.A property ,
+then a
+.S BadValue
+error occurs.
+>>STRATEGY
+Create a window with a property and PropertyChangeMask events selected.
+Call xname with a long_offset beyond the property end.
+Verify that a BadValue error occurred.
+>>CODE BadValue
+char *data = "a tested property";
+
+/* Create a window with a property and PropertyChangeMask events selected. */
+ XChangeProperty(display, w, property, XA_STRING, 8,
+ PropModeReplace,(unsigned char *)data, strlen(data));
+
+ seterrdef();
+
+/* Call xname with a long_offset beyond the property end. */
+ long_offset=5;
+ long_length=0;
+
+ XCALL;
+
+/* Verify that a BadValue error occurred. */
+ if (geterr() != BadValue) {
+ FAIL;
+ report("%s did not generate a BadValue when long_offset was",
+ TestName);
+ report("beyond the length of the property");
+ } else
+ CHECK;
+
+ CHECKPASS(1);
diff --git a/xts5/Xlib5/XInternAtom/XInternAtom.m b/xts5/Xlib5/XInternAtom/XInternAtom.m
new file mode 100644
index 00000000..8d16d0d8
--- /dev/null
+++ b/xts5/Xlib5/XInternAtom/XInternAtom.m
@@ -0,0 +1,518 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XInternAtom/XInternAtom.m,v 1.2 2005-11-03 08:43:39 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XInternAtom/XInternAtom.m
+>>#
+>># Description:
+>># Tests for XInternAtom()
+>>#
+>># Modifications:
+>># $Log: intrnatm.m,v $
+>># Revision 1.2 2005-11-03 08:43:39 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:28 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:47 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:04 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:00 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:32 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:20 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:41 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:29 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XInternAtom Xlib5
+Atom
+
+Display *display = Dsp;
+char *atom_name;
+Bool only_if_exists;
+>>EXTERN
+/* Need to pick up the XA_RECTANGLE declaration */
+#include "X11/Xatom.h"
+
+#define XIA_ATOM_NAME_1 "XTEST_ATOM_ONE"
+#define XIA_ATOM_NAME_2 "XTEST_ATOM_TWO"
+#define XIA_ATOM_NAME_3a "XTEST_ATOM_THREE"
+#define XIA_ATOM_NAME_3b "Xtest_Atom_Three"
+#define XIA_ATOM_NAME_3c "xTeSt_aToM_tHrEe"
+#define XIA_ATOM_NAME_4 "XTEST_ATOM_FOUR"
+#define XIA_ATOM_NAME_5 "XTEST_ATOM_FIVE"
+>>ASSERTION Good A
+A call to xname
+returns the atom identifier associated with the specified
+.A atom_name .
+>>STRATEGY
+Call xname to obtain the atom representation associated with \"RECTANGLE\".
+Verify that the atom returned was as expected.
+>>CODE
+Atom atom_return;
+
+/* Call xname to obtain the atom representation associated with "RECTANGLE". */
+ atom_name = "RECTANGLE";
+ only_if_exists = True;
+ atom_return = XCALL;
+
+/* Verify that the atom returned was as expected. */
+ if (atom_return != XA_RECTANGLE) {
+ FAIL;
+ report("%s did not return the expected value",
+ TestName);
+ report("Expected value: %u (%s)", (unsigned long)XA_RECTANGLE,
+ atomname(XA_RECTANGLE));
+ report("Returned value: %u (%s)", (unsigned long)atom_return,
+ atomname(atom_return));
+ } else
+ CHECK;
+
+ CHECKPASS(1);
+
+>>ASSERTION Good A
+When xname is called with
+.A only_if_exists
+set to
+.S True
+and the specified
+.A atom_name
+is not associated with an atom, then
+.S None
+is returned.
+>>STRATEGY
+Call xname with an atom_name not associated with an atom,
+ with only_if_exists True.
+Verify that None was returned.
+>>CODE
+Atom atom_return;
+
+/* Call xname with an atom_name not associated with an atom, */
+/* with only_if_exists True. */
+ atom_name=XIA_ATOM_NAME_1;
+ only_if_exists = True;
+ atom_return = XCALL;
+
+/* Verify that None was returned. */
+ if (atom_return != (Atom)None) {
+ FAIL;
+ report("%s did not return the expected value", TestName);
+ report("Expected value: %u (None)", None);
+ report("Returned value: %u (%s)", (unsigned long)atom_return,
+ atomname(atom_return));
+ } else
+ CHECK;
+ CHECKPASS(1);
+
+>>ASSERTION Good A
+When xname is called with
+.A only_if_exists
+set to
+.S False
+and the specified
+.A atom_name
+is not associated with an atom, then
+an atom is created and its atom identifer is returned.
+>>STRATEGY
+Call xname to ensure that atom_name is not associated with an atom.
+Call xname with an atom_name not associated with an atom,
+ with only_if_exists False.
+Verify that None was not returned.
+Verify that the returned atom id corresponds to atom_name.
+>>CODE
+Atom atom_return;
+char *check_name;
+
+/* Call xname to ensure that atom_name is not associated with an atom. */
+ atom_name=XIA_ATOM_NAME_2;
+ only_if_exists = True;
+ atom_return = XCALL;
+
+ if(atom_return != None) {
+ delete("Atom name %s has an identifier associated with it (%u)",
+ XIA_ATOM_NAME_2, atom_return);
+ report("Possible reason: Server was not reset");
+ report("after a previous test run");
+ return;
+ } else
+ CHECK;
+
+/* Call xname with an atom_name not associated with an atom, */
+/* with only_if_exists False. */
+ atom_name=XIA_ATOM_NAME_2;
+ only_if_exists = False;
+ atom_return = XCALL;
+
+/* Verify that None was not returned. */
+ trace("Atom id returned: %u (%s)", (unsigned long)atom_return,
+ atomname(atom_return));
+
+ if (atom_return == (Atom)None) {
+ FAIL;
+ report("%s did not return the expected value", TestName);
+ report("Expected value: an atom identifier");
+ report("Returned value: %u (None)", None);
+ return;
+ } else
+ CHECK;
+
+/* Verify that the returned atom id corresponds to atom_name. */
+ check_name = XGetAtomName(display, atom_return);
+ if (check_name == NULL) {
+ delete("XGetAtomName returned NULL");
+ return;
+ } else
+ CHECK;
+
+ if(strcmp(check_name, XIA_ATOM_NAME_2) != 0) {
+ FAIL;
+ report("%s did not return an atom id associated with atom_name",
+ TestName);
+ report("Atom returned was %u", (unsigned long)atom_return);
+ report("Expected associated name: %s", XIA_ATOM_NAME_2);
+ report("Returned associated name: %s", check_name);
+ } else
+ CHECK;
+
+ XFree(check_name);
+ CHECKPASS(4);
+
+>>ASSERTION Good A
+On a call to xname, the case of the
+.A atom_name
+string is significant for designating or identifying atoms.
+>>STRATEGY
+Call xname to ensure that atom XIA_ATOM_NAME_3a does not exist.
+Call xname to create an atom XIA_ATOM_NAME_3a.
+Call xname to create an atom XIA_ATOM_NAME_3b.
+Verify the atom identifiers are distinct.
+Call xname to obtain the atom id associated with XIA_ATOM_NAME_3c.
+Verify the atom identifier is None.
+>>CODE
+Atom atom_a, atom_b, atom_return;
+
+/* Call xname to ensure that atom XIA_ATOM_NAME_3a does not exist. */
+ atom_name=XIA_ATOM_NAME_3a;
+ only_if_exists = True;
+ atom_return = XCALL;
+
+ if(atom_return != None) {
+ delete("Atom name %s has an identifier associated with it (%u)",
+ XIA_ATOM_NAME_3a, atom_return);
+ report("Possible reason: Server was not reset");
+ report("after a previous test run");
+ return;
+ } else
+ CHECK;
+
+/* Call xname to create an atom XIA_ATOM_NAME_3a. */
+ atom_name=XIA_ATOM_NAME_3a;
+ only_if_exists = False;
+ atom_a = XCALL;
+
+ if (atom_a == (Atom)None) {
+ delete("%s did not return the expected value", TestName);
+ report("Expected value: an atom identifier for %s",
+ XIA_ATOM_NAME_3a);
+ report("Returned value: %u (None)", None);
+ return;
+ } else
+ CHECK;
+ trace("XIA_ATOM_NAME_3a (%s) is %u", XIA_ATOM_NAME_3a,
+ (unsigned long)atom_a);
+
+/* Call xname to create an atom XIA_ATOM_NAME_3b. */
+ atom_name=XIA_ATOM_NAME_3b;
+ only_if_exists = False;
+ atom_b = XCALL;
+
+ if (atom_b == (Atom)None) {
+ delete("%s did not return the expected value", TestName);
+ report("Expected value: an atom identifier for %s",
+ XIA_ATOM_NAME_3b);
+ report("Returned value: %u (None)", None);
+ return;
+ } else
+ CHECK;
+ trace("XIA_ATOM_NAME_3b (%s) is %u", XIA_ATOM_NAME_3b,
+ (unsigned long)atom_b);
+
+/* Verify the atom identifiers are distinct. */
+ if(atom_a == atom_b) {
+ FAIL;
+ report("%s did not return distinct atom identifiers for",
+ TestName);
+ report("atom %s and atom %s.",
+ XIA_ATOM_NAME_3a, XIA_ATOM_NAME_3b);
+ } else
+ CHECK;
+
+/* Call xname to obtain the atom id associated with XIA_ATOM_NAME_3c. */
+ atom_name=XIA_ATOM_NAME_3c;
+ only_if_exists = True;
+ atom_return = XCALL;
+
+/* Verify the atom id associated with XIA_ATOM_NAME_3c is None. */
+ if (atom_return != (Atom)None) {
+ char *check_name;
+ check_name=XGetAtomName(display, atom_return);
+ FAIL;
+ report("%s did not return the expected value", TestName);
+ report("Expected value: %u (None)", None);
+ report("Returned value: %u (%s)", (unsigned long)atom_return,
+ (check_name==NULL?"NO_NAME":check_name));
+ XFree(check_name);
+ } else
+ CHECK;
+
+ CHECKPASS(5);
+
+>>ASSERTION Good A
+Atoms created by a call to xname will remain defined after the client's
+connection closes.
+>>STRATEGY
+Create a new client.
+Call xname to ensure that XIA_ATOM_NAME_4 is not associated with an atom.
+Call xname to create atom XIA_ATOM_NAME_4 on display2.
+Close display2.
+Allow sufficient time for the server to register the close display
+Verify that atom XIA_ATOM_NAME_4 remains defined.
+>>CODE
+Atom atom_return, atom_return2;
+Display *display2;
+
+/* Create a new client. */
+ if (config.display == (char *) NULL) {
+ delete("config.display not set");
+ return;
+ }
+ else
+ CHECK;
+
+ display2 = XOpenDisplay(config.display);
+ if (display2 == (Display *)NULL) {
+ delete("Could not open display for display2");
+ return;
+ } else
+ CHECK;
+
+/* Call xname to ensure that atom_name is not associated with an atom. */
+ display = display2;
+ atom_name=XIA_ATOM_NAME_4;
+ only_if_exists = True;
+ atom_return = XCALL;
+
+ if(atom_return != None) {
+ delete("Atom name %s has an identifier associated with it (%u)",
+ XIA_ATOM_NAME_4, atom_return);
+ report("Possible reason: Server was not reset");
+ report("after a previous test run");
+ return;
+ } else
+ CHECK;
+
+/* Call xname to create a new atom on display2. */
+ atom_name=XIA_ATOM_NAME_4;
+ only_if_exists = False;
+ atom_return = XCALL;
+
+ trace("Atom id %u returned for %s", (unsigned long)atom_return,
+ XIA_ATOM_NAME_4);
+
+ if (atom_return == (Atom)None) {
+ delete("%s did not return the expected value", TestName);
+ report("Expected value: an atom identifier");
+ report("Returned value: %u (None)", None);
+ return;
+ } else
+ CHECK;
+
+/* Close display2. */
+ (void) XCloseDisplay(display2);
+
+/* Allow sufficient time for the server to register the close display */
+ reset_delay();
+
+/* Verify that atom XIA_ATOM_NAME_4 remains defined. */
+ display = Dsp;
+ atom_name=XIA_ATOM_NAME_4;
+ only_if_exists = True;
+ atom_return2 = XCALL;
+
+ trace("Atom id %u returned for %s", (unsigned long)atom_return,
+ XIA_ATOM_NAME_4);
+
+ if (atom_return2 != atom_return) {
+ FAIL;
+ report("%s did not return the expected value", TestName);
+ report("Expected value: %u (%s)", atom_return,
+ XIA_ATOM_NAME_4);
+ report("Returned value: %u", (unsigned long)atom_return2);
+ } else
+ CHECK;
+
+ CHECKPASS(5);
+
+>>ASSERTION Good A
+When the last connection to the server closes, then atoms created by
+a call to xname will become undefined.
+>>STRATEGY
+Ensure we can open a new display.
+Create an atom by calling xname.
+Close the last connection to the server.
+Allow sufficient time for the server to register the close display
+Open a new connection to the server.
+Verify that the atom is undefined.
+>>CODE
+Atom atom_return;
+
+/* Ensure we can open a new display. */
+ if (config.display == (char *) NULL) {
+ delete("config.display not set");
+ return;
+ }
+ else
+ CHECK;
+
+/* Create an atom by calling xname. */
+ atom_name=XIA_ATOM_NAME_5;
+ only_if_exists = False;
+ atom_return = XCALL;
+
+ trace("Atom id %u returned for %s", (unsigned long)atom_return,
+ XIA_ATOM_NAME_4);
+
+#ifdef TESTING
+ atom_return = None;
+#endif
+ if (atom_return == (Atom)None) {
+ delete("%s did not return the expected value", TestName);
+ report("Expected value: an atom identifier");
+ report("Returned value: %u (None)", None);
+ return;
+ } else
+ CHECK;
+
+/* Close the last connection to the server. */
+ (void) XCloseDisplay(display);
+
+/* Allow sufficient time for the server to register the close display */
+ reset_delay();
+
+/* Open a new connection to the server. */
+ Dsp = XOpenDisplay(config.display);
+ if (Dsp == (Display *)NULL) {
+ int i;
+ delete("Could not open display");
+ cancelrest("Could not open display");
+ return;
+ } else
+ CHECK;
+
+/* Verify that the atom is undefined. */
+ display = Dsp;
+ atom_name=XIA_ATOM_NAME_5;
+ only_if_exists = True;
+ atom_return = XCALL;
+
+ trace("Atom id %u returned for %s", (unsigned long)atom_return,
+ XIA_ATOM_NAME_5);
+
+ if (atom_return != (Atom)None) {
+ char *check_name;
+ FAIL;
+ report("Closing last connection to server did not");
+ report("clear the defined atom %s", XIA_ATOM_NAME_5);
+ report("Expected value: %u (None)", (unsigned long)None);
+ check_name=XGetAtomName(display, atom_return);
+ report("Returned value: %u (%s)", (unsigned long)atom_return,
+ (check_name==NULL?"NO_NAME":check_name));
+ report("Possible reason: Other connections open to server");
+ report("during test run");
+ XFree(check_name);
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+
+>>ASSERTION Bad A
+.ER BadAlloc
+>>ASSERTION Bad A
+.ER BadValue only_if_exists True False
diff --git a/xts5/Xlib5/XListProperties/XListProperties.m b/xts5/Xlib5/XListProperties/XListProperties.m
new file mode 100644
index 00000000..64b4d8c7
--- /dev/null
+++ b/xts5/Xlib5/XListProperties/XListProperties.m
@@ -0,0 +1,251 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XListProperties/XListProperties.m,v 1.2 2005-11-03 08:43:39 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XListProperties/XListProperties.m
+>>#
+>># Description:
+>># Tests for XListProperties()
+>>#
+>># Modifications:
+>># $Log: lstprprts.m,v $
+>># Revision 1.2 2005-11-03 08:43:39 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:28 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:47 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:05 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:01 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:32 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:22 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:43 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:32 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XListProperties Xlib5
+Atom *
+
+Display *display = Dsp;
+Window w = defwin(display);
+int *num_prop_return = &num_prop;
+>>EXTERN
+#include "X11/Xatom.h"
+
+static int num_prop;
+
+static Atom xlp_list[] = {
+ XA_PRIMARY,
+ XA_CUT_BUFFER0,
+ XA_RECTANGLE,
+ XA_COPYRIGHT,
+};
+static int xlp_nlist = NELEM(xlp_list);
+
+>>ASSERTION Good A
+When the specified window
+.A w
+has properties defined, then a call to xname
+returns a pointer to an array of atom properties that are defined for
+the specified window
+.A w
+and can be freed with XFree,
+and returns the number of properties in the
+array in
+.A num_prop_return .
+>>STRATEGY
+Create a window with properties.
+Call xname to obtain the property list for the window.
+Verify that the number of properties returned was as expected.
+Verify that the correct properties were returned.
+Verify the list may be XFree'd.
+>>CODE
+int loop,loop2;
+int found;
+char *data = "a tested property";
+Atom *ret;
+
+/* Create a window with properties. */
+ for(loop=0; loop<xlp_nlist; loop++)
+ XChangeProperty(display, w, xlp_list[loop], XA_STRING, 8,
+ PropModeReplace,(unsigned char *)data, strlen(data));
+
+/* Call xname to obtain the property list for the window. */
+ num_prop = -1;
+ ret = XCALL;
+
+/* Verify that the number of properties returned was as expected. */
+ if (num_prop != xlp_nlist) {
+ FAIL;
+ report("%s returned an unexpected num_prop_return",
+ TestName);
+ trace("Expected value: %d", xlp_nlist);
+ trace("Returned value: %d", num_prop);
+ } else
+ CHECK;
+
+ if (ret == (Atom *)NULL) {
+ FAIL;
+ report("%s returned a NULL pointer.", TestName);
+ report("Expecting a pointer to a list of atoms.");
+ return;
+ } else
+ CHECK;
+
+
+ found = 0;
+
+/* Verify that the correct properties were returned. */
+ for (loop=0; loop<num_prop; loop++) {
+ for(loop2=0; loop2<xlp_nlist; loop2++) {
+ if( ret[loop] == xlp_list[loop2] ) {
+ found++;
+ break;
+ }
+ }
+ }
+
+#ifdef TESTING
+ found = 0;
+#endif
+
+ if (found != num_prop) {
+ FAIL;
+ report("%s returned unexpected properties", TestName);
+ trace("Expected properties");
+ for (loop=0; loop<xlp_nlist; loop++)
+ trace(" %s", atomname(xlp_list[loop]));
+ trace("Returned properties");
+ for (loop=0; loop<num_prop; loop++)
+ trace(" %s", atomname(ret[loop]));
+ } else
+ CHECK;
+
+/* Verify the list may be XFree'd. */
+ if (num_prop != 0)
+ {
+ XFree((char*)ret);
+ CHECK;
+ }
+
+ CHECKPASS(4);
+>>ASSERTION Good A
+When the specified window
+.A w
+has no properties defined, then a call to xname returns
+.S NULL ,
+and zero in
+.A num_prop_return .
+>>STRATEGY
+Create a window with no properties.
+Call xname to obtain the property list for the window.
+Verify that a NULL pointer was returned.
+Verify that num_prop_return was zero.
+>>CODE
+Atom *ret;
+
+/* Create a window with no properties. */
+/* Call xname to obtain the property list for the window. */
+ num_prop = -1;
+ ret = XCALL;
+
+/* Verify that a NULL pointer was returned. */
+ if (ret != (Atom *)NULL) {
+ FAIL;
+ report("%s returned an unexpected value", TestName);
+ trace("Expected value: NULL pointer");
+ trace("Returned value: non-NULL pointer");
+ } else
+ CHECK;
+
+/* Verify that num_prop_return was zero. */
+ if (num_prop != 0) {
+ FAIL;
+ report("%s returned an unexpected num_prop_return",
+ TestName);
+ trace("Expected value: 0");
+ trace("Returned value: %d", num_prop);
+ } else
+ CHECK;
+
+ CHECKPASS(2);
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XQueryPointer/XQueryPointer.m b/xts5/Xlib5/XQueryPointer/XQueryPointer.m
new file mode 100644
index 00000000..62ae37b9
--- /dev/null
+++ b/xts5/Xlib5/XQueryPointer/XQueryPointer.m
@@ -0,0 +1,414 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XQueryPointer/XQueryPointer.m,v 1.2 2005-11-03 08:43:40 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XQueryPointer/XQueryPointer.m
+>>#
+>># Description:
+>># Tests for XQueryPointer()
+>>#
+>># Modifications:
+>># $Log: qrypntr.m,v $
+>># Revision 1.2 2005-11-03 08:43:40 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:28 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:48 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:05 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:01 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:33 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.0 1995/12/15 08:48:45 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:34 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XQueryPointer Xlib5
+Bool
+
+Display *display = Dsp;
+Window w;
+Window *root_return = &root;
+Window *child_return = &child;
+int *root_x_return = &root_x;
+int *root_y_return = &root_y;
+int *win_x_return = &win_x;
+int *win_y_return = &win_y;
+unsigned int *mask_return = &mask;
+>>EXTERN
+Window root;
+Window child;
+int root_x;
+int root_y;
+int win_x;
+int win_y;
+unsigned int mask;
+
+static void
+set_variables()
+{
+ root = (Window)0;
+ child= (Window)0;
+ root_x= 0;
+ root_y= 0;
+ win_x = 0;
+ win_y =0;
+ mask = 0;
+}
+
+#define XQP_X 60
+#define XQP_Y 50
+>>ASSERTION Good A
+A call to xname returns the root window the pointer is logically on in
+.A root_return ,
+and the pointer coordinates relative to the root window's origin in
+.A root_x_return
+and
+.A root_y_return .
+>>STRATEGY
+Call XWarpPointer to move pointer to a known position
+Call xname to obtain pointer position
+Verify that the correct root window and pointer position were returned
+>>CODE
+Bool ret;
+
+/* Call XWarpPointer to move pointer to a known position */
+ (void) warppointer(display, DefaultRootWindow(display), XQP_X, XQP_Y);
+
+/* Call xname to obtain pointer position */
+ w = DefaultRootWindow(display);
+ set_variables();
+ ret = XCALL;
+ if (ret != True) {
+ delete("%s returned %s, expecting True", TestName,
+ boolname(ret));
+ } else
+ CHECK;
+
+/* Verify that the correct root window and pointer position were returned */
+ if (root != DefaultRootWindow(display)) {
+ FAIL;
+ report("%s did not return expected root window", TestName);
+ trace("Expected root window=%0x", DefaultRootWindow(display));
+ trace("Returned root window=%0x", root);
+ } else
+ CHECK;
+
+ if (root_x != XQP_X) {
+ FAIL;
+ report("%s did not return expected root_x_return", TestName);
+ trace("Expected root_x_return=%d", XQP_X);
+ trace("Returned root_x_return=%d", root_x);
+ } else
+ CHECK;
+
+ if (root_y != XQP_Y) {
+ FAIL;
+ report("%s did not return expected root_y_return", TestName);
+ trace("Expected root_y_return=%d", XQP_Y);
+ trace("Returned root_y_return=%d", root_y);
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+>>ASSERTION Good C
+If multiple screens are supported:
+When the pointer is not on the same screen as the specified window
+.A w ,
+then a call to xname returns
+.S False ,
+.A child_return
+is set to
+.S None ,
+and
+.A win_x_return
+and
+.A win_y_return
+are set to zero.
+>>STRATEGY
+If multiple screens are supported:
+ Ensure that pointer is not on the alternate screen
+ Call xname to obtain pointer position on alternate screen
+ Verify that win_x_return, win_y_return and child_return
+ were set correctly
+>>CODE
+Bool ret;
+
+/* If multiple screens are supported: */
+ if (config.alt_screen == -1) {
+ unsupported("No alternate screen supported");
+ return;
+ }
+
+/* Ensure that pointer is not on the alternate screen */
+ (void) warppointer(display, DefaultRootWindow(display), XQP_X, XQP_Y);
+
+/* Call xname to obtain pointer position on alternate screen */
+ set_variables();
+ w = RootWindow(display, config.alt_screen);
+ ret = XCALL;
+ if (ret != False) {
+ FAIL;
+ report("%s returned %s, expecting False.", TestName,
+ boolname(ret));
+ } else
+ CHECK;
+
+/* Verify that win_x_return, win_y_return and child_return */
+/* were set correctly */
+ if (child != None) {
+ FAIL;
+ report("%s returned an unexpected window in child_return",
+ TestName);
+ trace("Expected (*child_return)=%0x (None)", None);
+ trace("Returned (*child_return)=%0x", child);
+ } else
+ CHECK;
+
+ if (win_x != 0) {
+ FAIL;
+ report("%s returned an unexpected value for win_x_return",
+ TestName);
+ trace("Expected (*win_x_return)=0");
+ trace("Returned (*win_x_return)=%d", win_x);
+ } else
+ CHECK;
+
+ if (win_y != 0) {
+ FAIL;
+ report("%s returned an unexpected value for win_y_return",
+ TestName);
+ trace("Expected (*win_y_return)=0");
+ trace("Returned (*win_y_return)=%d", win_y);
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+>>ASSERTION Good A
+When the pointer is on the same screen as the specified window
+.A w
+and a child of that window contains the pointer, then a call to xname returns
+.S True ,
+.A win_x_return
+and
+.A win_y_return
+are set to the pointer coordinates relative to the origin
+of the specified window
+.A w ,
+and
+.A child_return
+is set to the child window.
+>>STRATEGY
+Create a child of the root window
+Ensure the pointer is over the child by calling warppointer()
+Call xname to obtain pointer position
+Verify that win_x_return, win_y_return and child_return
+ were set correctly
+>>CODE
+Window rc;
+XVisualInfo *vp;
+Bool ret;
+
+/* Create a child of the root window */
+ resetvinf(VI_WIN); (void)nextvinf(&vp);
+ /* makewinpos border width had better not change... */
+ rc = makewinpos(display, vp, XQP_X-1, XQP_Y-1);
+
+/* Ensure the pointer is over the child by calling warppointer() */
+ (void) warppointer(display, DefaultRootWindow(display),
+ XQP_X+10, XQP_Y+5);
+
+/* Call xname to obtain pointer position */
+ set_variables();
+ w = DefaultRootWindow(display);
+ ret = XCALL;
+ if (ret != True) {
+ FAIL;
+ report("%s returned %s, expecting True.", TestName,
+ boolname(ret));
+ } else
+ CHECK;
+
+/* Verify that win_x_return, win_y_return and child_return */
+/* were set correctly */
+ if (child != rc) {
+ FAIL;
+ report("%s returned an unexpected window in child_return",
+ TestName);
+ trace("Expected (*child_return)=%0x", rc);
+ trace("Returned (*child_return)=%0x", child);
+ } else
+ CHECK;
+
+ if (win_x != XQP_X+10) {
+ FAIL;
+ report("%s returned an unexpected value for win_x_return",
+ TestName);
+ trace("Expected (*win_x_return)=%d", XQP_X+10);
+ trace("Returned (*win_x_return)=%d", win_x);
+ } else
+ CHECK;
+
+ if (win_y != XQP_Y+5) {
+ FAIL;
+ report("%s returned an unexpected value for win_y_return",
+ TestName);
+ trace("Expected (*win_y_return)=%d", XQP_Y+5);
+ trace("Returned (*win_y_return)=%d", win_y);
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+>>ASSERTION Good A
+When the pointer is on the same screen as the specified window
+.A w
+and no child of that window contains the pointer,
+then a call to xname returns
+.S True ,
+.A win_x_return
+and
+.A win_y_return
+are set to the pointer coordinates relative to the origin
+of the specified window
+.A w ,
+and
+.A child_return
+is set to
+.S None .
+>>STRATEGY
+Create window
+Ensure the pointer is over the window by calling warppointer()
+Call xname to obtain pointer position
+Verify that win_x_return, win_y_return and child_return
+ were set correctly
+>>CODE
+Bool ret;
+
+/* Create a window */
+ w = defwin(display);
+
+/* Ensure the pointer is over the window by calling warppointer() */
+ (void) warppointer(display, w, 10, 5);
+
+/* Call xname to obtain pointer position */
+ set_variables();
+ ret = XCALL;
+ if (ret != True) {
+ FAIL;
+ report("%s returned %s, expecting True.", TestName,
+ boolname(ret));
+ } else
+ CHECK;
+
+/* Verify that win_x_return, win_y_return and child_return */
+/* were set correctly */
+ if (child != None) {
+ FAIL;
+ report("%s returned an unexpected window in child_return",
+ TestName);
+ trace("Expected child_return=%0x", None);
+ trace("Returned child_return=%0x", child);
+ } else
+ CHECK;
+
+ if (win_x != 10) {
+ FAIL;
+ report("%s returned an unexpected value for win_x_return",
+ TestName);
+ trace("Expected win_x_return=%d", 10);
+ trace("Returned win_x_return=%d", win_x);
+ } else
+ CHECK;
+
+ if (win_y != 5) {
+ FAIL;
+ report("%s returned an unexpected value for win_y_return",
+ TestName);
+ trace("Expected (*win_y_return)=%d", 5);
+ trace("Returned (*win_y_return)=%d", win_y);
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+>>ASSERTION Good B 1
+A call to xname returns the current logical state of the keyboard buttons
+and the modifier keys as the bitwise inclusive OR of one or more
+of the button or modifier key bitmasks in
+.A mask_return .
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XQueryTree/XQueryTree.m b/xts5/Xlib5/XQueryTree/XQueryTree.m
new file mode 100644
index 00000000..dbfffcf4
--- /dev/null
+++ b/xts5/Xlib5/XQueryTree/XQueryTree.m
@@ -0,0 +1,326 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XQueryTree/XQueryTree.m,v 1.2 2005-11-03 08:43:40 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XQueryTree/XQueryTree.m
+>>#
+>># Description:
+>># Tests for XQueryTree()
+>>#
+>># Modifications:
+>># $Log: qrytr.m,v $
+>># Revision 1.2 2005-11-03 08:43:40 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:48 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:06 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:02 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:33 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.0 1995/12/15 08:48:46 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:37 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XQueryTree Xlib5
+Status
+
+Display *display = Dsp;
+Window w;
+Window *root_return = &root;
+Window *parent_return = &parent;
+Window **children_return = &children;
+unsigned int *nchildren_return = &nchildren;
+>>EXTERN
+/* These are the store locations for the returned data */
+static Window root;
+static Window parent;
+static Window *children;
+static unsigned int nchildren;
+
+/* Window structure template */
+/* A window with three child windows, one of which has */
+/* 3 overlapping children */
+static char *QTtemplate[] = {
+ ".",
+ "one . (10,10) 80x70",
+ "onec1 one (5,5) 30x30",
+ "onec2 one (15,10) 15x15",
+ "onec3 one (10,15) 15x15",
+ "two . (20,50) 40x20",
+ "three . (55,20) 20x20",
+};
+static int NQTtemplate = NELEM(QTtemplate);
+
+static char *QT2template[] = {
+ ".",
+ "one . (10,10) 80x70",
+ "o1 one (5,5) 40x40",
+ "two . (25,25) 10x10",
+ "o2 one (30,30) 40x35",
+ "o3 one (20,50) 45x10",
+ "o4 one (60,10) 10x10",
+ "o5 one (15,35) 30x20",
+};
+static int NQT2template = NELEM(QT2template);
+
+>>ASSERTION Good A
+A successful call to xname returns non-zero, the root window ID in
+.A root_return ,
+the parent window of the specified window
+.A w
+in
+.A parent_return ,
+a pointer to the list of children windows of specified window
+.A w
+in
+.A children_return ,
+and the number of children in the list for the specified window
+.A w
+in
+.A nchildren_return .
+>># ALTERNATIVE WORDING:
+>># A call to xname returns the root window ID of the specified window
+>># .A w
+>># in
+>># .A root_return ,
+>># the parent window in
+>># .A parent_return ,
+>># a pointer to the list of child windows in
+>># .A children_return
+>># which can be freed with XFree,
+>># and the number of child windows in the list in
+>># .A nchildren_return .
+>>STRATEGY
+Create a window hierarchy.
+Call xname to query the window tree.
+Verify that the root window, parent window, number of children and
+ the children array were returned as expected.
+>>CODE
+Window realparent;
+struct buildtree *tree;
+Window one, two, three;
+Window childarray[3];
+int loop;
+
+/* Create a window hierarchy. */
+ realparent = defwin(display);
+ tree = buildtree(display, realparent, QTtemplate, NQTtemplate);
+ one = btntow(tree, "one");
+ two = btntow(tree, "two");
+ three = btntow(tree, "three");
+ childarray[0] = btntow(tree, "onec1");
+ childarray[1] = btntow(tree, "onec2");
+ childarray[2] = btntow(tree, "onec3");
+ trace("root window is %0x", DefaultRootWindow(Dsp));
+ trace("parent is %0x", realparent);
+ trace("one is %0x", one);
+ trace("two is %0x", two);
+ trace("three is %0x", three);
+ for(loop=0; loop<3; loop++)
+ trace("onec%d is %0x", loop, childarray[loop]);
+
+/* Call xname to query the window tree. */
+#ifdef TESTING
+ w = realparent;
+#else
+ w = one;
+#endif
+ parent = None;
+ root = None;
+ children = (Window *)NULL;
+ nchildren = -1;
+ XCALL;
+
+/* Verify that the root window, parent window, number of children and */
+/* the children array were returned as expected. */
+
+
+ if (root != DefaultRootWindow(Dsp)) {
+ FAIL;
+ report("%s returned an unexpected value for the root window", TestName);
+ report("Expected: %0x", DefaultRootWindow(Dsp));
+ report("Returned: %0x", root);
+ } else
+ CHECK;
+
+ if (parent != realparent) {
+ FAIL;
+ report("%s returned an unexpected value for the parent window", TestName);
+ report("Expected: %0x", realparent);
+ report("Returned: %0x", parent);
+ } else
+ CHECK;
+
+ if (nchildren != 3) {
+ FAIL;
+ report("%s returned an unexpected number of child windows", TestName);
+ report("Expected: 3");
+ report("Returned: %d", nchildren);
+ for(loop=0; loop<nchildren; loop++)
+ report("children[%d] is %0x", loop, children[loop]);
+ } else {
+ for(loop=0; loop<nchildren; loop++)
+ {
+ if(children[loop] != childarray[loop]) {
+ FAIL;
+ report("children array [%d] returned unexpected window", loop);
+ report("Expected: %0x", childarray[loop]);
+ report("Returned: %0x", children[loop]);
+ } else
+ CHECK;
+ }
+ XFree((char*)children);
+ }
+
+ CHECKPASS(5);
+
+>>ASSERTION Good A
+A call to xname returns the child windows
+of the specified window
+.A w
+in
+.A children_return
+in current stacking order from bottommost first to topmost last.
+>>STRATEGY
+Create a window hierarchy.
+Call xname to query the window tree.
+Verify that the children array was returned as expected.
+>>CODE
+Window realparent;
+struct buildtree *tree;
+Window one, two;
+Window childarray[5];
+int loop;
+
+/* Create a window hierarchy. */
+ realparent = defwin(display);
+ tree = buildtree(display, realparent, QT2template, NQT2template);
+ one = btntow(tree, "one");
+ two = btntow(tree, "two");
+ childarray[0] = btntow(tree, "o1");
+ childarray[1] = btntow(tree, "o2");
+ childarray[2] = btntow(tree, "o3");
+ childarray[3] = btntow(tree, "o4");
+ childarray[4] = btntow(tree, "o5");
+ trace("root window is %0x", DefaultRootWindow(Dsp));
+ trace("parent is %0x", realparent);
+ trace("one is %0x", one);
+ trace("two is %0x", two);
+ for(loop=0; loop<5; loop++)
+ trace("one child %d is %0x", loop, childarray[loop]);
+
+/* Call xname to query the window tree. */
+#ifdef TESTING
+ w = realparent;
+#else
+ w = one;
+#endif
+ parent = None;
+ root = None;
+ children = (Window *)NULL;
+ nchildren = -1;
+ XCALL;
+
+/* Verify that the children array was returned as expected. */
+ if (nchildren != 5) {
+ FAIL;
+ report("%s returned an unexpected number of child windows", TestName);
+ report("Expected: 5");
+ report("Returned: %d", nchildren);
+ for(loop=0; loop<nchildren; loop++)
+ report("children[%d] is %0x", loop, children[loop]);
+ } else {
+ for(loop=0; loop<nchildren; loop++)
+ {
+ if(children[loop] != childarray[loop]) {
+ FAIL;
+ report("children array [%d] returned unexpected window", loop);
+ report("Expected: %0x", childarray[loop]);
+ report("Returned: %0x", children[loop]);
+ } else
+ CHECK;
+ }
+ XFree((char*)children);
+ }
+
+ CHECKPASS(5);
+
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XRotateWindowProperties/XRotateWindowProperties.m b/xts5/Xlib5/XRotateWindowProperties/XRotateWindowProperties.m
new file mode 100644
index 00000000..831086de
--- /dev/null
+++ b/xts5/Xlib5/XRotateWindowProperties/XRotateWindowProperties.m
@@ -0,0 +1,687 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XRotateWindowProperties/XRotateWindowProperties.m,v 1.2 2005-11-03 08:43:40 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XRotateWindowProperties/XRotateWindowProperties.m
+>>#
+>># Description:
+>># Tests for XRotateWindowProperties()
+>>#
+>># Modifications:
+>># $Log: rttwdwprpr.m,v $
+>># Revision 1.2 2005-11-03 08:43:40 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:49 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:06 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:02 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:34 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:23 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:48 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:40 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XRotateWindowProperties Xlib5
+void
+
+Display *display = Dsp;
+Window w = defwin(display);
+Atom *properties = (Atom *)&(xrwp_list[0]);
+int num_prop = 4;
+int npositions = 1;
+>>EXTERN
+#include "X11/Xatom.h"
+
+static Atom xrwp_list[5] = {
+ 0, 0, 0, 0, (unsigned)-1 };
+
+static void
+xrwp_add_property(disp, win, prop, data)
+Display *disp;
+Window win;
+Atom prop;
+unsigned long data;
+{
+ XChangeProperty(disp, win, prop, XA_INTEGER, 32,
+ PropModeReplace,(unsigned char *)&data, 1);
+ XSync(disp, True);
+}
+
+>>ASSERTION Good A
+>># This assertion is rather redundant. Perhaps we should delete it.
+>># If we don't delete it, we really ought to make the following changes.
+A call to xname rotates
+>># INSERT: the property values associated with
+.A properties
+>># DELETE next line
+on the window
+>># INSERT: of the window
+.A w
+and generates
+>># INSERT: a
+.S PropertyNotify
+>># DELETE next line
+events.
+>># INSERT: for each property.
+>>STRATEGY
+Create a window with properties, with PropertyChangeMask events selected.
+Call xname to rotate the window properties.
+Verify that PropertyNotify events were genereated.
+Verify that the property values were rotated as expected.
+>>CODE
+int num_ev;
+int loop;
+XEvent ev, good;
+
+/* Create a window with properties, with PropertyChangeMask events selected. */
+ xrwp_list[0] = XA_INTEGER;
+ xrwp_list[1] = XA_COPYRIGHT;
+ for(loop=0; loop<2; loop++)
+ xrwp_add_property(display, w, xrwp_list[loop],
+ (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to rotate the window properties. */
+ num_prop = 2;
+ XCALL;
+
+/* Verify that PropertyNotify events were genereated. */
+ num_ev = getevent(display, &ev);
+ if(num_ev != 2) {
+ FAIL;
+ report("%s did not cause the expected events",
+ TestName);
+ trace("Expected: 2 PropertyNotify events");
+ trace("Returned: %d events", num_ev);
+ for(; num_ev>0; ) {
+ trace("Event: %s", eventname(ev.type));
+ if(ev.type==PropertyNotify)
+ trace("Property: %s",
+ atomname(ev.xproperty.atom));
+ num_ev = getevent(display, &ev);
+ }
+ return;
+ } else {
+ loop=0;
+ do {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = xrwp_list[loop++];
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ } while(getevent(display, &ev));
+ }
+
+/* Verify that the property values were rotated as expected. */
+ for(loop=0; loop<2; loop++) {
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long after;
+ unsigned char *value;
+
+ XGetWindowProperty(display, w, xrwp_list[loop], 0, 1, False,
+ XA_INTEGER, &type, &format, &nitems, &after,
+ &value);
+
+ if (type != XA_INTEGER || format != 32 ||
+ nitems != 1 || after != 0) {
+ delete("XGetWindowProperty returned unexpected values");
+ trace("loop is %d", loop);
+ trace("type is %s (expected XA_INTEGER)",
+ atomname(type));
+ trace("format is %d (expected 32)", format);
+ trace("nitems is %u (expected 1)", nitems);
+ trace("after is %u (expected 0)", after);
+ return;
+ } else {
+ unsigned long tmp;
+
+ tmp = *(unsigned long *)value;
+ if (tmp != ((loop+1) % 2) ) {
+ FAIL;
+ report("%s did not rotate values as expected",
+ TestName);
+ trace("expected value %u", (loop+1) %2);
+ trace("returned value %u", tmp);
+ } else {
+ CHECK;
+ trace("expected value %u returned", tmp);
+ }
+ }
+ }
+
+ CHECKPASS(4);
+
+>>ASSERTION Good A
+When
+.A npositions
+mod
+.A num_prop
+is non-zero, then a call to xname reorders the values associated with the
+.A properties
+such that the value associated with a
+.A properties
+[I] becomes the value associated with the
+.A properties
+[ I +
+.A npositions ]
+mod
+.A num_prop ,
+and a
+.S PropertyNotify
+event is generated for each member of the
+.A properties
+array in the array order.
+>>STRATEGY
+Create a window with properties, with PropertyChangeMask events selected.
+Call xname to rotate the window properties.
+Verify that PropertyNotify events were genereated.
+Verify that the property values were rotated as expected.
+>>CODE
+int num_ev;
+int loop;
+XEvent ev, good;
+
+/* Create a window with properties, with PropertyChangeMask events selected. */
+ xrwp_list[0] = XA_INTEGER;
+ xrwp_list[1] = XA_COPYRIGHT;
+ xrwp_list[2] = XA_WM_HINTS;
+ xrwp_list[3] = XA_NOTICE;
+ for(loop=0; loop<num_prop; loop++)
+ xrwp_add_property(display, w, xrwp_list[loop],
+ (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Call xname to rotate the window properties. */
+ XCALL;
+
+/* Verify that PropertyNotify events were genereated. */
+ num_ev = getevent(display, &ev);
+ if(num_ev != num_prop) {
+ FAIL;
+ report("%s did not cause the expected events",
+ TestName);
+ trace("Expected: %d PropertyNotify events", num_prop);
+ trace("Returned: %d events", num_ev);
+ for(; num_ev>0; ) {
+ trace("Event: %s", eventname(ev.type));
+ if(ev.type==PropertyNotify)
+ trace("Property: %s",
+ atomname(ev.xproperty.atom));
+ num_ev = getevent(display, &ev);
+ }
+ return;
+ } else {
+ loop=0;
+ do {
+ good.type = PropertyNotify;
+ good.xproperty.type = PropertyNotify;
+ good.xproperty.atom = xrwp_list[loop++];
+ good.xproperty.display = display;
+ good.xproperty.window = w;
+ good.xproperty.state = PropertyNewValue;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ } else
+ CHECK;
+ } while(getevent(display, &ev));
+ }
+
+/* Verify that the property values were rotated as expected. */
+ for(loop=0; loop<num_prop; loop++) {
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long after;
+ unsigned char *value;
+ XGetWindowProperty(display, w, xrwp_list[loop], 0, 1, False,
+ XA_INTEGER, &type, &format, &nitems, &after,
+ &value);
+
+ if (type != XA_INTEGER || format != 32 ||
+ nitems != 1 || after != 0) {
+ delete("XGetWindowProperty returned unexpected values");
+ trace("loop is %d", loop);
+ trace("type is %s (expected XA_INTEGER)",
+ atomname(type));
+ trace("format is %d (expected 32)", format);
+ trace("nitems is %u (expected 1)", nitems);
+ trace("after is %u (expected 0)", after);
+ return;
+ } else {
+ unsigned long tmp;
+
+ /*
+ * The new value of prop[loop] is the value of the old
+ * prop[loop-npositions mod num_prop]
+ */
+ tmp = *(unsigned long *)value;
+ if (tmp != ((loop-npositions + num_prop) % num_prop) ) {
+ FAIL;
+ report("%s did not rotate values as expected",
+ TestName);
+ trace("expected value %u",
+ (loop-npositions + num_prop) % num_prop);
+ trace("returned value %u", tmp);
+ } else {
+ CHECK;
+ trace("expected value %u returned", tmp);
+ }
+ }
+ }
+
+ CHECKPASS(2*num_prop);
+
+>>ASSERTION Bad A
+When an atom occurs more than once in the
+.A properties
+list, then a call to xname changes no window
+>># DELETE next line
+.A properties, and a
+>># INSERT: property values, and a
+.S BadMatch
+error occurs.
+>>STRATEGY
+Create a window with properties, and PropertyChangeMask events selected.
+Ensure that the properties array contains a duplicate member.
+Call xname to rotate the window properties.
+Verify that a BadMatch error occurred.
+Verify that no property notify events were raised.
+Verify that the property values were not modified.
+>>CODE BadMatch
+XEvent ev;
+int loop;
+int num_ev;
+
+/* Create a window with properties, and PropertyChangeMask events selected. */
+ xrwp_list[0] = XA_INTEGER;
+ xrwp_list[1] = XA_COPYRIGHT;
+ xrwp_list[2] = XA_WM_HINTS;
+ for(loop=0; loop<3; loop++)
+ xrwp_add_property(display, w, xrwp_list[loop],
+ (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Ensure that the properties array contains a duplicate member. */
+ xrwp_list[3] = XA_COPYRIGHT;
+
+/* Call xname to rotate the window properties. */
+ XCALL;
+
+/* Verify that a BadMatch error occurred. */
+ if (geterr() != BadMatch) {
+ FAIL;
+ report("%s did not generate a BadMatch", TestName);
+ report("when the property list contained a duplicate");
+ } else
+ CHECK;
+
+/* Verify that no property notify events were raised. */
+ num_ev =getevent(display, &ev);
+ if(num_ev != 0) {
+ XEvent ev;
+ FAIL;
+ report("%s caused unexpected events",
+ TestName);
+ trace("Expected: no events");
+ trace("Returned: %d events", num_ev);
+ for(; num_ev>0; ) {
+ trace("Event: %s", eventname(ev.type));
+ if(ev.type==PropertyNotify)
+ trace("Property: %s",
+ atomname(ev.xproperty.atom));
+ num_ev = getevent(display, &ev);
+ }
+ return;
+ } else
+ CHECK;
+
+/* Verify that the property values were not modified. */
+ for(loop=0; loop<3; loop++) {
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long after;
+ unsigned char *value;
+ XGetWindowProperty(display, w, xrwp_list[loop], 0, 1, False,
+ XA_INTEGER, &type, &format, &nitems, &after,
+ &value);
+
+ if (type != XA_INTEGER || format != 32 ||
+ nitems != 1 || after != 0) {
+ delete("XGetWindowProperty returned unexpected values");
+ trace("loop is %d", loop);
+ trace("type is %s (expected XA_INTEGER)",
+ atomname(type));
+ trace("format is %d (expected 32)", format);
+ trace("nitems is %u (expected 1)", nitems);
+ trace("after is %u (expected 0)", after);
+ return;
+ } else {
+ unsigned long tmp;
+
+ tmp = *(unsigned long *)value;
+ if (tmp != loop ) {
+ FAIL;
+ report("%s changed the property values",
+ TestName);
+ report("when no change was expected");
+ trace("expected value %u", loop);
+ trace("returned value %u", tmp);
+ } else {
+ CHECK;
+ trace("expected property value %u", tmp);
+ }
+ }
+ }
+
+ CHECKPASS(5);
+
+>>ASSERTION Bad A
+When an atom in the
+.A properties
+list is not a property of the specified window
+.A w ,
+then a call to xname
+changes no window
+>># DELETE next line
+.A propreties ,
+>># INSERT: property values,
+and a
+.S BadMatch
+error occurs.
+>>STRATEGY
+Create a window with properties, and PropertyChangeMask events selected.
+Ensure the properties array has a member that is not a window property.
+Call xname to rotate the window properties.
+Verify that a BadMatch error occurred.
+Verify that no property notify events were raised.
+Verify that the property values were not modified.
+>>CODE BadMatch
+int loop;
+XEvent ev;
+int num_ev;
+
+/* Create a window with properties, and PropertyChangeMask events selected. */
+ xrwp_list[0] = XA_INTEGER;
+ xrwp_list[1] = XA_COPYRIGHT;
+ xrwp_list[2] = XA_WM_HINTS;
+ for(loop=0; loop<3; loop++)
+ xrwp_add_property(display, w, xrwp_list[loop],
+ (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Ensure the properties array has a member that is not a window property. */
+ xrwp_list[3] = XA_NOTICE;
+
+/* Call xname to rotate the window properties. */
+ XCALL;
+
+/* Verify that a BadMatch error occurred. */
+ if (geterr() != BadMatch) {
+ FAIL;
+ report("%s did not generate a BadMatch", TestName);
+ report("when the property list contained a duplicate");
+ } else
+ CHECK;
+
+/* Verify that no property notify events were raised. */
+ num_ev =getevent(display, &ev);
+ if(num_ev != 0) {
+ XEvent ev;
+ FAIL;
+ report("%s caused unexpected events",
+ TestName);
+ trace("Expected: no events");
+ trace("Returned: %d events", num_ev);
+ for(; num_ev>0; ) {
+ trace("Event: %s", eventname(ev.type));
+ if(ev.type==PropertyNotify)
+ trace("Property: %s",
+ atomname(ev.xproperty.atom));
+ num_ev = getevent(display, &ev);
+ }
+ return;
+ } else
+ CHECK;
+
+/* Verify that the property values were not modified. */
+ for(loop=0; loop<3; loop++) {
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long after;
+ unsigned char *value;
+ XGetWindowProperty(display, w, xrwp_list[loop], 0, 1, False,
+ XA_INTEGER, &type, &format, &nitems, &after,
+ &value);
+
+ if (type != XA_INTEGER || format != 32 ||
+ nitems != 1 || after != 0) {
+ delete("XGetWindowProperty returned unexpected values");
+ trace("loop is %d", loop);
+ trace("type is %s (expected XA_INTEGER)",
+ atomname(type));
+ trace("format is %d (expected 32)", format);
+ trace("nitems is %u (expected 1)", nitems);
+ trace("after is %u (expected 0)", after);
+ return;
+ } else {
+ unsigned long tmp;
+
+ tmp = *(unsigned long *)value;
+ if (tmp != loop ) {
+ FAIL;
+ report("%s changed the property values",
+ TestName);
+ report("when no change was expected");
+ trace("expected value %u", loop);
+ trace("returned value %u", tmp);
+ } else {
+ CHECK;
+ trace("expected property value %u", tmp);
+ }
+ }
+ }
+
+ CHECKPASS(5);
+
+>>ASSERTION Bad A
+>># THIS IS NEW!!! NOT originally submitted to mit
+When an atom in the
+.A properties
+list is a bad atom,
+then a call to xname
+changes no window
+property values, and a
+.S BadAtom
+error occurs.
+>>STRATEGY
+Create a window with properties, and PropertyChangeMask events selected.
+Ensure the properties array has a member that is a bad atom (-1).
+Call xname to rotate the window properties.
+Verify that a BadMatch error occurred.
+Verify that no property notify events were raised.
+Verify that the property values were not modified.
+>>CODE BadAtom
+int loop;
+XEvent ev;
+int num_ev;
+
+/* Create a window with properties, and PropertyChangeMask events selected. */
+ xrwp_list[0] = XA_INTEGER;
+ xrwp_list[1] = XA_COPYRIGHT;
+ xrwp_list[2] = XA_WM_HINTS;
+ for(loop=0; loop<3; loop++)
+ xrwp_add_property(display, w, xrwp_list[loop],
+ (unsigned long)loop);
+
+ XSelectInput(display, w, PropertyChangeMask);
+
+/* Ensure the properties array has a member that is a bad atom (-1). */
+ xrwp_list[3] = -1L;
+
+/* Call xname to rotate the window properties. */
+ XCALL;
+
+/* Verify that a BadMatch error occurred. */
+ if (geterr() != BadAtom) {
+ FAIL;
+ report("%s did not generate a BadAtom", TestName);
+ report("when the property list contained -1");
+ } else
+ CHECK;
+
+/* Verify that no property notify events were raised. */
+ num_ev =getevent(display, &ev);
+ if(num_ev != 0) {
+ XEvent ev;
+ FAIL;
+ report("%s caused unexpected events",
+ TestName);
+ trace("Expected: no events");
+ trace("Returned: %d events", num_ev);
+ for(; num_ev>0; ) {
+ trace("Event: %s", eventname(ev.type));
+ if(ev.type==PropertyNotify)
+ trace("Property: %s",
+ atomname(ev.xproperty.atom));
+ num_ev = getevent(display, &ev);
+ }
+ return;
+ } else
+ CHECK;
+
+/* Verify that the property values were not modified. */
+ for(loop=0; loop<3; loop++) {
+ Atom type;
+ int format;
+ unsigned long nitems;
+ unsigned long after;
+ unsigned char *value;
+ XGetWindowProperty(display, w, xrwp_list[loop], 0, 1, False,
+ XA_INTEGER, &type, &format, &nitems, &after,
+ &value);
+
+ if (type != XA_INTEGER || format != 32 ||
+ nitems != 1 || after != 0) {
+ delete("XGetWindowProperty returned unexpected values");
+ trace("loop is %d", loop);
+ trace("type is %s (expected XA_INTEGER)",
+ atomname(type));
+ trace("format is %d (expected 32)", format);
+ trace("nitems is %u (expected 1)", nitems);
+ trace("after is %u (expected 0)", after);
+ return;
+ } else {
+ unsigned long tmp;
+
+ tmp = *(unsigned long *)value;
+ if (tmp != loop ) {
+ FAIL;
+ report("%s changed the property values",
+ TestName);
+ report("when no change was expected");
+ trace("expected value %u", loop);
+ trace("returned value %u", tmp);
+ } else {
+ CHECK;
+ trace("expected property value %u", tmp);
+ }
+ }
+ }
+
+ CHECKPASS(5);
+
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XSetSelectionOwner/XSetSelectionOwner.m b/xts5/Xlib5/XSetSelectionOwner/XSetSelectionOwner.m
new file mode 100644
index 00000000..33152954
--- /dev/null
+++ b/xts5/Xlib5/XSetSelectionOwner/XSetSelectionOwner.m
@@ -0,0 +1,546 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XSetSelectionOwner/XSetSelectionOwner.m,v 1.2 2005-11-03 08:43:40 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XSetSelectionOwner/XSetSelectionOwner.m
+>>#
+>># Description:
+>># Tests for XSetSelectionOwner()
+>>#
+>># Modifications:
+>># $Log: stslctnown.m,v $
+>># Revision 1.2 2005-11-03 08:43:40 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:49 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:07 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:03 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:34 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.1 1996/05/09 00:34:24 andy
+>># Corrected Xatom include
+>>#
+>># Revision 4.0 1995/12/15 08:48:50 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:43 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XSetSelectionOwner Xlib5
+void
+
+Display *display = Dsp;
+Atom selection = XA_COPYRIGHT;
+Window owner = defwin(display);
+Time thetime = CurrentTime;
+>>EXTERN
+#include "X11/Xatom.h"
+>>ASSERTION Good A
+>># The code must test for a window, and a genuine time
+>># (not CurrentTime). -stuart.
+A call to xname changes the owner window to
+.A owner
+and
+the last-change time to
+.A time
+for the specified
+.A selection .
+>>STRATEGY
+Create a new client.
+Obtain current server time.
+Call xname to assign the owner and time for the selection.
+Call xname to clear the selection.
+Verify that the correct SelectionClear event occurred.
+>>CODE
+Display *client1, *client2;
+Time calltime;
+Window callwindow;
+int num_ev;
+XEvent ev;
+
+/* Create a new client. */
+ client1 = display;
+ client2 = opendisplay();
+ if (client2 == (Display *)NULL) {
+ delete("Could not open client2");
+ return;
+ } else
+ CHECK;
+
+/* Obtain current server time. */
+ calltime = gettime(client1);
+ callwindow = owner;
+
+/* Call xname to assign the owner and time for the selection. */
+ thetime = calltime;
+ XCALL;
+
+/* Call xname to clear the selection. */
+ display = client2;
+ thetime = CurrentTime;
+ owner = None;
+ XCALL;
+ XSync(client1, False);
+
+/* Verify that the correct SelectionClear event occurred. */
+ num_ev = getevent(client1, &ev);
+ if (num_ev != 1) {
+ delete("Expecting a single SelectionClear event");
+ report("Received %d events", num_ev);
+ while(num_ev !=0) {
+ trace("Event: %s", eventname(ev.type));
+ num_ev = getevent(client1, &ev);
+ }
+ return;
+ } else {
+ XEvent good;
+ good.type = SelectionClear;
+ good.xselectionclear.type = SelectionClear;
+ good.xselectionclear.selection = selection;
+ good.xselectionclear.display = client1;
+ good.xselectionclear.window = callwindow;
+ good.xselectionclear.time = calltime;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ report("%s did not set the selection as expected",
+ TestName);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+When the specified
+.A time
+is earlier than the current last-change time of the specified
+.A selection
+or is later than the current server time, then a call to xname has no effect.
+>>STRATEGY
+Create two new clients.
+Obtain current server time.
+Call xname to assign the owner and time for the selection.
+Call xname to assign the selection to a new client and owner
+ with time before last change time.
+Verify that no SelectionClear event occurred.
+Call xname to assign the selection to a new client and owner
+ with time after current server time.
+Verify that no SelectionClear event occurred.
+>>CODE
+Display *calldisplay, *client2, *client3;
+Time calltime;
+int num_ev;
+XEvent ev;
+
+/* Create two new clients. */
+ client2 = opendisplay();
+ if (client2 == (Display *)NULL) {
+ delete("Could not open client2");
+ return;
+ } else
+ CHECK;
+
+ client3 = opendisplay();
+ if (client3 == (Display *)NULL) {
+ delete("Could not open client3");
+ return;
+ } else
+ CHECK;
+
+/* Obtain current server time. */
+ calldisplay = display;
+ calltime = gettime(display);
+
+/* Call xname to assign the owner and time for the selection. */
+ display = calldisplay;
+ thetime = calltime;
+ XCALL;
+
+/* Call xname to assign the selection to a new client and owner */
+/* with time before last change time. */
+ display = client2;
+ owner = defwin(client2);
+ thetime = calltime-1;
+ XCALL;
+
+/* Verify that no SelectionClear event occurred. */
+ num_ev = getevent(calldisplay, &ev);
+ if (num_ev != 0) {
+ FAIL;
+ report("%s called with an earlier time changed the selection",
+ TestName);
+ trace("Expecting 0 events");
+ trace("Received %d events", num_ev);
+ do {
+ trace("Event: %s", eventname(ev.type));
+ } while(getevent(calldisplay, &ev));
+ } else
+ CHECK;
+
+/* Call xname to assign the selection to a new client and owner */
+/* with time after current server time. */
+ display = client3;
+ owner = defwin(client3);
+ thetime = gettime(client3)+(Time)100000;
+ XCALL;
+
+/* Verify that no SelectionClear event occurred. */
+ num_ev = getevent(calldisplay, &ev);
+ if (num_ev != 0) {
+ FAIL;
+ report("%s called with an earlier time changed the selection",
+ TestName);
+ trace("Expecting 0 events");
+ trace("Received %d events", num_ev);
+ do {
+ trace("Event: %s", eventname(ev.type));
+ } while(getevent(calldisplay, &ev));
+ } else
+ CHECK;
+
+ CHECKPASS(4);
+
+>>ASSERTION Good A
+When
+.A time
+is
+.S CurrentTime ,
+then a call to xname sets the last-change time of the specified
+.A selection
+to the current server time.
+>>STRATEGY
+Create a new client.
+Obtain current server time.
+Call xname to assign the owner and time for the selection.
+Call xname to clear the selection, to obtain selection time.
+Verify that the correct SelectionClear event occurred.
+Verify the time returned was within acceptable limits.
+>>CODE
+Display *client1, *client2;
+Time calltime, rettime, maxtime;
+int num_ev;
+XEvent ev;
+
+/* Create a new client. */
+ client1 = display;
+ client2 = opendisplay();
+ if (client2 == (Display *)NULL) {
+ delete("Could not open client2");
+ return;
+ } else
+ CHECK;
+
+/* Obtain current server time. */
+ calltime = gettime(client1);
+
+/* Call xname to assign the owner and time for the selection. */
+ thetime = CurrentTime;
+ XCALL;
+
+/* Call xname to clear the selection, to obtain selection time. */
+ display = client2;
+ thetime = CurrentTime;
+ owner = None;
+ XCALL;
+ XSync(client1, False);
+
+/* Verify that the correct SelectionClear event occurred. */
+ num_ev = getevent(client1, &ev);
+ if (num_ev != 1) {
+ delete("Expecting a single SelectionClear event");
+ report("Received %d events", num_ev);
+ while(num_ev !=0) {
+ trace("Event: %s", eventname(ev.type));
+ num_ev = getevent(client1, &ev);
+ }
+ return;
+ } else {
+ if (ev.type != SelectionClear) {
+ delete("Expecting a SelectionClear event");
+ report("Returned a %s event", eventname(ev.type));
+ return;
+ } else
+ CHECK;
+ }
+
+/* Verify the time returned was within acceptable limits. */
+ rettime=ev.xselectionclear.time;
+ maxtime=calltime+5000*config.speedfactor;
+ trace("Obtained server time: %u", calltime);
+ trace("Returned server time: %u", rettime);
+ trace("Upper expected time : %u", maxtime);
+ if((rettime<calltime) || (rettime>maxtime)) {
+ FAIL;
+ report("%s did not set last modified time of selection",
+ TestName);
+ report("to within reasonable bounds");
+ } else
+ CHECK;
+
+ CHECKPASS(3);
+
+>>ASSERTION Good A
+When the
+.A owner
+window is
+.S None ,
+then a call to xname sets the specified
+.A selection
+to have no owner.
+>>STRATEGY
+Call xname to set the owner for the selection.
+Verify that the selection was set.
+Call xname to set no owner for the selection.
+Verify that the selection has no owner.
+>>CODE
+
+/* Call xname to set the owner for the selection. */
+ XCALL;
+
+/* Verify that the selection was set. */
+ if(XGetSelectionOwner(display, selection) != owner) {
+ delete("A call to %s did not set the selection for the test",
+ TestName);
+ return;
+ } else
+ CHECK;
+
+/* Call xname to set no owner for the selection. */
+ thetime = CurrentTime;
+ owner = None;
+ XCALL;
+
+/* Verify that the selection has no owner. */
+ if (XGetSelectionOwner(display, selection) != None) {
+ FAIL;
+ report("A call to %s with owner of None failed to set the",
+ TestName);
+ report("selection owner to None.");
+ } else
+ CHECK;
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+>># This is ambiguous. In reality, the section owner must be a different
+>># client. This could be a grey area.
+When the specified
+.A selection
+has an owner, and the specified
+.A owner
+is not the same as the current owner,
+then on a call to xname the current owner is sent a
+.S SelectionClear
+event.
+>>STRATEGY
+Create one new client.
+Call xname to assign the owner and time for the selection.
+Call xname to assign the selection to a new owner.
+Verify that the correct SelectionClear event occurred.
+>>CODE
+Display *client1, *client2;
+Time calltime;
+Window callwindow;
+int num_ev;
+XEvent ev;
+
+/* Create a new client. */
+ client1 = display;
+ client2 = opendisplay();
+ if (client2 == (Display *)NULL) {
+ delete("Could not open client2");
+ return;
+ } else
+ CHECK;
+
+ calltime = gettime(client1);
+
+/* Call xname to assign the owner and time for the selection. */
+ callwindow = owner;
+ thetime = calltime;
+ XCALL;
+
+/* Call xname to assign the selection to a new owner. */
+ display = client2;
+ thetime = CurrentTime;
+ owner = defwin(client2);
+ XCALL;
+ XSync(client1, False);
+
+/* Verify that the correct SelectionClear event occurred. */
+ num_ev = getevent(client1, &ev);
+ if (num_ev != 1) {
+ delete("Expecting a single SelectionClear event");
+ report("Received %d events", num_ev);
+ while(num_ev !=0) {
+ trace("Event: %s", eventname(ev.type));
+ num_ev = getevent(client1, &ev);
+ }
+ return;
+ } else {
+ XEvent good;
+ good.type = SelectionClear;
+ good.xselectionclear.type = SelectionClear;
+ good.xselectionclear.selection = selection;
+ good.xselectionclear.display = client1;
+ good.xselectionclear.window = callwindow;
+ good.xselectionclear.time = calltime;
+ if (checkevent(&good, &ev)) {
+ FAIL;
+ report("%s did not set the selection as expected",
+ TestName);
+ } else
+ CHECK;
+ }
+
+ CHECKPASS(2);
+
+>>ASSERTION Good A
+>># Need to split this assertion into two, one for the owner, and the
+>># other for the last-change time, which is untestable -stuart.
+When the client that is the owner of a selection is terminated, or the
+owner window is destroyed,
+then the selection reverts to having no owner, and the last-change
+time is unaffected.
+>>STRATEGY
+Create a new client.
+Call xname to assign the owner and time for the selection.
+Close the connection for client2.
+Allow time for the connection to close.
+Verify that the ownership of the selection reverted to None.
+Assign the selection to another window.
+Close the window of the selection.
+Verify that the ownership of the selection reverted to None.
+>>CODE
+Display *client1, *client2;
+
+/* Create a new client. */
+ client1 = display;
+ client2 = XOpenDisplay(config.display);
+ if (client2 == (Display *)NULL) {
+ delete("Could not open client2");
+ return;
+ } else
+ CHECK;
+
+/* Call xname to assign the owner and time for the selection. */
+ display = client2;
+ XCALL;
+
+/* Close the connection for client2. */
+ XCloseDisplay(client2);
+
+/* Allow time for the connection to close. */
+ reset_delay();
+
+/* Verify that the ownership of the selection reverted to None. */
+ if (XGetSelectionOwner(client1, selection) != None) {
+ FAIL;
+ report("Closing the owner client did not set the selection");
+ report("owner to None.");
+ return;
+ } else
+ CHECK;
+
+/* Assign the selection to another window. */
+ display = client1;
+ owner = crechild(client1, defwin(client1), (struct area *)0);
+ XCALL;
+
+/* Close the window of the selection. */
+ XDestroyWindow(client1, owner);
+
+/* Verify that the ownership of the selection reverted to None. */
+ if (XGetSelectionOwner(client1, selection) != None) {
+ FAIL;
+ report("Closing the owner window did not set the selection");
+ report("owner to None.");
+ } else
+ CHECK;
+
+ CHECKPASS(3);
+
+>>ASSERTION Good B 1
+>># This is meant to mean that the selection atoms are global.
+>># I hope this is a near enough approximation. -stuart.
+The status of a selection atom is accessible by any client
+of the server.
+>>ASSERTION Bad A
+.ER BadAtom
+>>ASSERTION Bad A
+.ER BadWindow
diff --git a/xts5/Xlib5/XTranslateCoordinates/XTranslateCoordinates.m b/xts5/Xlib5/XTranslateCoordinates/XTranslateCoordinates.m
new file mode 100644
index 00000000..27e11c98
--- /dev/null
+++ b/xts5/Xlib5/XTranslateCoordinates/XTranslateCoordinates.m
@@ -0,0 +1,430 @@
+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.
+$Header: /cvs/xtest/xtest/xts5/tset/Xlib5/XTranslateCoordinates/XTranslateCoordinates.m,v 1.2 2005-11-03 08:43:40 jmichael Exp $
+
+Copyright (c) Applied Testing and Technology, Inc. 1995
+All Rights Reserved.
+
+>># Project: VSW5
+>>#
+>># File: xts5/tset/Xlib5/XTranslateCoordinates/XTranslateCoordinates.m
+>>#
+>># Description:
+>># Tests for XTranslateCoordinates()
+>>#
+>># Modifications:
+>># $Log: trnsltcrdn.m,v $
+>># Revision 1.2 2005-11-03 08:43:40 jmichael
+>># clean up all vsw5 paths to use xts5 instead.
+>>#
+>># Revision 1.1.1.2 2005/04/15 14:05:29 anderson
+>># Reimport of the base with the legal name in the copyright fixed.
+>>#
+>># Revision 8.0 1998/12/23 23:26:50 mar
+>># Branch point for Release 5.0.2
+>>#
+>># Revision 7.0 1998/10/30 22:45:08 mar
+>># Branch point for Release 5.0.2b1
+>>#
+>># Revision 6.0 1998/03/02 05:19:03 tbr
+>># Branch point for Release 5.0.1
+>>#
+>># Revision 5.0 1998/01/26 03:15:34 tbr
+>># Branch point for Release 5.0.1b1
+>>#
+>># Revision 4.0 1995/12/15 08:48:52 tbr
+>># Branch point for Release 5.0.0
+>>#
+>># Revision 3.1 1995/12/15 00:47:46 andy
+>># Prepare for GA Release
+>>#
+/*
+Portions of this software are based on Xlib and X Protocol Test Suite.
+We have used this material under the terms of its copyright, which grants
+free use, subject to the conditions below. Note however that those
+portions of this software that are based on the original Test Suite have
+been significantly revised and that all such revisions are copyright (c)
+1995 Applied Testing and Technology, Inc. Insomuch as the proprietary
+revisions cannot be separated from the freely copyable material, the net
+result is that use of this software is governed by the ApTest copyright.
+
+Copyright (c) 1990, 1991 X Consortium
+
+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
+X CONSORTIUM 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.
+
+Except as contained in this notice, the name of the X Consortium shall not be
+used in advertising or otherwise to promote the sale, use or other dealings
+in this Software without prior written authorization from the X Consortium.
+
+Permission to use, copy, modify, distribute, and sell this software and
+its documentation for any purpose is hereby granted without fee,
+provided that the above copyright notice appear in all copies and that
+both that copyright notice and this permission notice appear in
+supporting documentation, and that the name of UniSoft not be
+used in advertising or publicity pertaining to distribution of the
+software without specific, written prior permission. UniSoft
+makes no representations about the suitability of this software for any
+purpose. It is provided "as is" without express or implied warranty.
+*/
+>>TITLE XTranslateCoordinates Xlib5
+Bool
+
+Display *display = Dsp;
+Window src_w;
+Window dest_w;
+int src_x = c_ap.x + 10;
+int src_y = c_ap.y + 8;
+int *dest_x_return = &dest_x;
+int *dest_y_return = &dest_y;
+Window *child_return = &child;
+>>EXTERN
+static struct area c_ap;
+static int dest_x;
+static int dest_y;
+static Window child;
+
+void transinit()
+{
+ tpstartup();
+
+/* struct area of the child window */
+ c_ap.x = 50;
+ c_ap.y = 60;
+ c_ap.width = 20;
+ c_ap.height= 17;
+
+ dest_x = -1;
+ dest_y = -1;
+ child = ~0;
+}
+
+>>SET tpstartup transinit
+>>ASSERTION Good A
+A call to xname takes the
+.A src_x
+and
+.A src_y
+coordinates relative to the source window's origin and
+converts them to be
+relative to the destination window's origin and
+returns these translated coordinates in
+.A dest_x_return
+and
+.A dest_y_return .
+>># Note that I'm testing over a loop of border_widths. This is to ensure
+>># the border width is taken into account in the calculation. stuart
+>>STRATEGY
+For some values of border_width:
+ Create a window to be the source window.
+ Create a child window to be the destination window.
+ Map both windows.
+ Translate coordinates of the parent window to the child using xname.
+ Verify the returned coordinates were as expected.
+>>CODE
+Bool ret;
+int exp_x, exp_y;
+int border_width;
+
+/* Set up child window position coordinates */
+
+ for(border_width = 0; border_width < 5; border_width++) {
+ src_w = defdraw(display, VI_WIN);
+ XMapWindow(display, src_w);
+
+ /* Child window: visual = CopyFromParent, and is mapped */
+ dest_w = crechild(display, src_w, &c_ap);
+ XSetWindowBorderWidth(display, dest_w, border_width);
+ XSetWindowBorder(display, dest_w, W_FG);
+ XMapWindow(display, dest_w);
+
+/* Calculate expected return values */
+ exp_x = src_x - c_ap.x - border_width;
+ exp_y = src_y - c_ap.y - border_width;
+
+ ret = XCALL;
+
+ if (ret == False)
+ {
+ report("%s returned False when expecting True.",
+ TestName);
+ report("src_x=%d", src_x); delete("src_y=%d", src_y);
+ report("exp_x=%d", exp_x); delete("exp_y=%d", exp_y);
+ report("border_width=%d", border_width);
+ FAIL;
+ } else
+ if ((dest_x != exp_x) || (dest_y != exp_y)) {
+ report("%s did not return expected coordinates",
+ TestName);
+ report("Expected: (*dest_x_return)=%d, (*dest_y_return)=%d",
+ exp_x, exp_y);
+ report("Got: (*dest_x_return)=%d, (*dest_y_return)=%d",
+ dest_x, dest_y);
+ if( (dest_x == -1) || (dest_y == -1) )
+ report("(*dest_x_return) and (*dest_y_return) were probably not set");
+
+ FAIL;
+ } else
+ CHECK;
+
+ }
+
+ CHECKPASS(5);
+>>ASSERTION Good C
+When
+.A src_w
+and
+.A dest_w
+were not created on the same screen,
+then a call to xname returns zero and
+.A dest_x_return
+and
+.A dest_y_return
+are set to zero.
+>>STRATEGY
+If an alternate screen is supported:
+ Create a mapped window on the default screen.
+ Create a mapped window on the alternate screen.
+ Verify xname returns zero.
+ Verify that *dest_x_return is zero.
+ Verify that *dest_y_return is zero.
+>>CODE
+int ret;
+
+ if (config.alt_screen == -1) {
+ unsupported("No alternate screen supported");
+ return;
+ }
+
+ src_w = defdraw(display, VI_WIN);
+ XMapWindow(display, src_w);
+ dest_w = defdraw(display, VI_ALT_WIN);
+ XMapWindow(display, dest_w);
+
+ ret = XCALL;
+
+ if (ret != 0)
+ {
+ report("%s did not return zero when", TestName);
+ report("src_w and dest_w were on different screens.");
+ report("Expecting: 0");
+ report("Returned : %d", ret);
+ FAIL;
+ }
+ else
+ CHECK;
+
+ if ( dest_x != 0 || dest_y != 0 )
+ {
+ report("%s did not set the dest_x and dest_y as expected.",
+ TestName);
+ report("Expecting: (*dest_x_return)=0, (*dest_y_return)=0");
+ report("Returned : (*dest_x_return)=%d, (*dest_y_return)=%d",
+ dest_x, dest_y);
+ FAIL;
+ }
+ else
+ CHECK;
+
+ CHECKPASS(2);
+>>ASSERTION Good A
+When the coordinates are contained in a mapped child of
+.A dest_w ,
+then that child is returned in
+.A child_return .
+>>STRATEGY
+For some values of border_width:
+ Create a window to be the source and destination windows.
+ Create a sub window.
+ Map both windows.
+ Translate coordinates of the window to the child using xname.
+ Verify the child_return window was the sub window.
+>>CODE
+Window exp_w;
+Bool ret;
+int border_width;
+
+/* Set up child window position coordinates */
+
+ for(border_width = 0; border_width < 5; border_width++) {
+ src_w = defdraw(display, VI_WIN);
+ XMapWindow(display, src_w);
+
+ dest_w = src_w;
+
+ exp_w = crechild(display, src_w, &c_ap);
+
+ XSetWindowBorderWidth(display, exp_w, border_width);
+ XSetWindowBorder(display, exp_w, W_FG);
+ XMapWindow(display, exp_w);
+
+/* Calculate expected return values */
+ ret = XCALL;
+
+ if (ret == False)
+ {
+ report("%s returned False when expecting True.",
+ TestName);
+ report("border_width=%d", border_width);
+ FAIL;
+ } else
+ if (child != exp_w)
+ {
+ report("%s did not return the expected window in (*child_return)",
+ TestName);
+ report("(*child_return) = %0x", child);
+ report("expected window = %0x", exp_w);
+ report("border_width=%d", border_width);
+ FAIL;
+ }
+ else
+ CHECK;
+
+ }
+
+ CHECKPASS(5);
+>>ASSERTION Good A
+When the coordinates are not contained in a mapped child of
+.A dest_w ,
+then
+.A child_return
+is set to
+.S None .
+>>STRATEGY
+Create a mapped window to be the source and destination windows.
+Create an overlapping mapped sibling window.
+Translate coordinates of the window using xname.
+Verify the child_return window was None.
+Verify the returned coordinates were as expected.
+>>CODE
+XVisualInfo *vp;
+XWindowAttributes winatt;
+Window exp_w;
+Bool ret;
+
+ src_w = defdraw(display, VI_WIN);
+ XMapWindow(display, src_w);
+ dest_w = src_w;
+
+/* Get the root window relative postion of the first window */
+ XGetWindowAttributes(display, src_w, &winatt);
+
+/* Set the coordinates of the sibling window */
+ c_ap.x += winatt.x;
+ c_ap.y += winatt.y;
+
+/* Make sibling window: mapped */
+ resetvinf(VI_WIN); nextvinf(&vp);
+ exp_w = makewinpos(display, vp, c_ap.x, c_ap.y);
+
+ ret = XCALL;
+
+ if (ret == False)
+ {
+ report("%s returned False when expecting True.",
+ TestName);
+ FAIL;
+ } else
+ if (child != None)
+ {
+ report("When the source coordinates refered to a sibling window");
+ report("%s did not set child_return to None",
+ TestName);
+ report("Window id returned: %0x", child);
+ report("Source/Dest window: %0x", src_w);
+ report("Sibling window : %0x", exp_w);
+ FAIL;
+ }
+ else
+ CHECK;
+
+/* Now test for a point on dest_w itself */
+ src_x = 5;
+ src_y = 5;
+ child = ~0; /* We must make sure xname actually sets this */
+
+ ret = XCALL;
+
+ if (ret == False)
+ {
+ report("%s returned False when expecting True.",
+ TestName);
+ FAIL;
+ } else
+ if (child != None)
+ {
+ report("When the source coordinates refered to the dest_w");
+ report("%s did not set child_return to None",
+ TestName);
+ report("child_return : %0x", child);
+ report("Source/Dest window: %0x", src_w);
+ report("Sibling window : %0x", exp_w);
+ FAIL;
+ }
+ else
+ CHECK;
+
+ CHECKPASS(2);
+>>ASSERTION Bad A
+When a window argument does not name a valid window, then a
+.S BadWindow
+error occurs.
+>>STRATEGY
+For src_w and dest_w:
+ Set the argument to a bad window.
+ Verify a BadWindow error occurs.
+>>CODE BadWindow
+Window goodwin;
+
+ seterrdef();
+
+ goodwin = defdraw(display, VI_WIN);
+
+ src_w = badwin(display);
+ dest_w = goodwin;
+ XCALL;
+ if (geterr() == BadWindow)
+ CHECK;
+ else
+ FAIL;
+
+ src_w = goodwin;
+ dest_w = badwin(display);
+ XCALL;
+ if (geterr() == BadWindow)
+ CHECK;
+ else
+ FAIL;
+
+ CHECKPASS(2);