diff options
author | Dan Nicholson <dbn.lists@gmail.com> | 2009-09-16 12:20:41 -0700 |
---|---|---|
committer | Dan Nicholson <dbn.lists@gmail.com> | 2009-09-16 12:20:41 -0700 |
commit | 704eb8d4cbfa2f8c47882a8ea6c7732cf5fa20d1 (patch) | |
tree | 1f48212ecf5556fbff17172c6904e525481e8653 /xts5/Xproto | |
parent | 5d01bd434ff7186701c931883b110c179d4fa8b8 (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/Xproto')
124 files changed, 31950 insertions, 0 deletions
diff --git a/xts5/Xproto/.gitignore b/xts5/Xproto/.gitignore new file mode 100644 index 00000000..8b53e208 --- /dev/null +++ b/xts5/Xproto/.gitignore @@ -0,0 +1,122 @@ +pAllocColor/pAllocColor +pAllocColorCells/pAllocColorCells +pAllocColorPlanes/pAllocColorPlanes +pAllocNamedColor/pAllocNamedColor +pAllowEvents/pAllowEvents +pBadRequest/pBadRequest +pBell/pBell +pChangeActivePointerGrab/pChangeActivePointerGrab +pChangeGC/pChangeGC +pChangeHosts/pChangeHosts +pChangeKeyboardControl/pChangeKeyboardControl +pChangeKeyboardMapping/pChangeKeyboardMapping +pChangePointerControl/pChangePointerControl +pChangeProperty/pChangeProperty +pChangeSaveSet/pChangeSaveSet +pChangeWindowAttributes/pChangeWindowAttributes +pClearArea/pClearArea +pCloseFont/pCloseFont +pConfigureWindow/pConfigureWindow +pConvertSelection/pConvertSelection +pCopyArea/pCopyArea +pCopyColormapAndFree/pCopyColormapAndFree +pCopyGC/pCopyGC +pCopyPlane/pCopyPlane +pCirculateWindow/pCirculateWindow +pCreateColormap/pCreateColormap +pCreateCursor/pCreateCursor +pCreateGC/pCreateGC +pCreateGlyphCursor/pCreateGlyphCursor +pCreatePixmap/pCreatePixmap +pCreateWindow/pCreateWindow +pDeleteProperty/pDeleteProperty +pDestroySubwindows/pDestroySubwindows +pDestroyWindow/pDestroyWindow +pFillPoly/pFillPoly +pFreeColormap/pFreeColormap +pFreeColors/pFreeColors +pFreeCursor/pFreeCursor +pForceScreenSaver/pForceScreenSaver +pFreeGC/pFreeGC +pFreePixmap/pFreePixmap +pGrabButton/pGrabButton +pGrabKey/pGrabKey +pGrabKeyboard/pGrabKeyboard +pGrabPointer/pGrabPointer +pGrabServer/pGrabServer +pGetAtomName/pGetAtomName +pGetFontPath/pGetFontPath +pGetGeometry/pGetGeometry +pGetImage/pGetImage +pGetInputFocus/pGetInputFocus +pGetKeyboardControl/pGetKeyboardControl +pGetKeyboardMapping/pGetKeyboardMapping +pGetModifierMapping/pGetModifierMapping +pGetMotionEvents/pGetMotionEvents +pGetPointerControl/pGetPointerControl +pGetPointerMapping/pGetPointerMapping +pGetProperty/pGetProperty +pGetScreenSaver/pGetScreenSaver +pGetSelectionOwner/pGetSelectionOwner +pGetWindowAttributes/pGetWindowAttributes +pImageText16/pImageText16 +pImageText8/pImageText8 +pInstallColormap/pInstallColormap +pInternAtom/pInternAtom +pKillClient/pKillClient +pLookupColor/pLookupColor +pListExtensions/pListExtensions +pListFonts/pListFonts +pListFontsWithInfo/pListFontsWithInfo +pListHosts/pListHosts +pListInstalledColormaps/pListInstalledColormaps +pListProperties/pListProperties +pMapSubwindows/pMapSubwindows +pMapWindow/pMapWindow +pNoOperation/pNoOperation +pOpenDisplay/pOpenDisplay +pOpenFont/pOpenFont +pPolyArc/pPolyArc +pPolyFillArc/pPolyFillArc +pPolyFillRectangle/pPolyFillRectangle +pPolyLine/pPolyLine +pPolyPoint/pPolyPoint +pPolyRectangle/pPolyRectangle +pPolySegment/pPolySegment +pPolyText16/pPolyText16 +pPolyText8/pPolyText8 +pPutImage/pPutImage +pQueryBestSize/pQueryBestSize +pQueryColors/pQueryColors +pQueryExtension/pQueryExtension +pQueryFont/pQueryFont +pQueryKeymap/pQueryKeymap +pQueryPointer/pQueryPointer +pQueryTree/pQueryTree +pQueryTextExtents/pQueryTextExtents +pRecolorCursor/pRecolorCursor +pReparentWindow/pReparentWindow +pRotateProperties/pRotateProperties +pSendEvent/pSendEvent +pSetAccessControl/pSetAccessControl +pSetClipRectangles/pSetClipRectangles +pSetCloseDownMode/pSetCloseDownMode +pSetDashes/pSetDashes +pSetFontPath/pSetFontPath +pSetInputFocus/pSetInputFocus +pSetModifierMapping/pSetModifierMapping +pSetPointerMapping/pSetPointerMapping +pStoreColors/pStoreColors +pStoreNamedColor/pStoreNamedColor +pSetScreenSaver/pSetScreenSaver +pSetSelectionOwner/pSetSelectionOwner +pTranslateCoords/pTranslateCoords +pUngrabButton/pUngrabButton +pUngrabKey/pUngrabKey +pUngrabKeyboard/pUngrabKeyboard +pUngrabPointer/pUngrabPointer +pUngrabServer/pUngrabServer +pUnmapSubwindows/pUnmapSubwindows +pUnmapWindow/pUnmapWindow +pUninstallColormap/pUninstallColormap +pWarpPointer/pWarpPointer diff --git a/xts5/Xproto/Makefile.am b/xts5/Xproto/Makefile.am new file mode 100644 index 00000000..14082685 --- /dev/null +++ b/xts5/Xproto/Makefile.am @@ -0,0 +1,133 @@ +include ../../common.mk +AUTOMAKE_OPTIONS = subdir-objects + +AM_CFLAGS = $(XP_LCFLAGS) $(XP_CFLAGS) +LDADD = $(TCM) $(XP_LLIBS) $(XP_LIBS) + +check_PROGRAMS = $(tprogs) +BUILT_SOURCES = $(tprogs:$(EXEEXT)=.c) +CLEANFILES = $(BUILT_SOURCES) + +tprogs = \ + pAllocColor/pAllocColor \ + pAllocColorCells/pAllocColorCells \ + pAllocColorPlanes/pAllocColorPlanes \ + pAllocNamedColor/pAllocNamedColor \ + pAllowEvents/pAllowEvents \ + pBadRequest/pBadRequest \ + pBell/pBell \ + pChangeActivePointerGrab/pChangeActivePointerGrab \ + pChangeGC/pChangeGC \ + pChangeHosts/pChangeHosts \ + pChangeKeyboardControl/pChangeKeyboardControl \ + pChangeKeyboardMapping/pChangeKeyboardMapping \ + pChangePointerControl/pChangePointerControl \ + pChangeProperty/pChangeProperty \ + pChangeSaveSet/pChangeSaveSet \ + pChangeWindowAttributes/pChangeWindowAttributes \ + pClearArea/pClearArea \ + pCloseFont/pCloseFont \ + pConfigureWindow/pConfigureWindow \ + pConvertSelection/pConvertSelection \ + pCopyArea/pCopyArea \ + pCopyColormapAndFree/pCopyColormapAndFree \ + pCopyGC/pCopyGC \ + pCopyPlane/pCopyPlane \ + pCirculateWindow/pCirculateWindow \ + pCreateColormap/pCreateColormap \ + pCreateCursor/pCreateCursor \ + pCreateGC/pCreateGC \ + pCreateGlyphCursor/pCreateGlyphCursor \ + pCreatePixmap/pCreatePixmap \ + pCreateWindow/pCreateWindow \ + pDeleteProperty/pDeleteProperty \ + pDestroySubwindows/pDestroySubwindows \ + pDestroyWindow/pDestroyWindow \ + pFillPoly/pFillPoly \ + pFreeColormap/pFreeColormap \ + pFreeColors/pFreeColors \ + pFreeCursor/pFreeCursor \ + pForceScreenSaver/pForceScreenSaver \ + pFreeGC/pFreeGC \ + pFreePixmap/pFreePixmap \ + pGrabButton/pGrabButton \ + pGrabKey/pGrabKey \ + pGrabKeyboard/pGrabKeyboard \ + pGrabPointer/pGrabPointer \ + pGrabServer/pGrabServer \ + pGetAtomName/pGetAtomName \ + pGetFontPath/pGetFontPath \ + pGetGeometry/pGetGeometry \ + pGetImage/pGetImage \ + pGetInputFocus/pGetInputFocus \ + pGetKeyboardControl/pGetKeyboardControl \ + pGetKeyboardMapping/pGetKeyboardMapping \ + pGetModifierMapping/pGetModifierMapping \ + pGetMotionEvents/pGetMotionEvents \ + pGetPointerControl/pGetPointerControl \ + pGetPointerMapping/pGetPointerMapping \ + pGetProperty/pGetProperty \ + pGetScreenSaver/pGetScreenSaver \ + pGetSelectionOwner/pGetSelectionOwner \ + pGetWindowAttributes/pGetWindowAttributes \ + pImageText16/pImageText16 \ + pImageText8/pImageText8 \ + pInstallColormap/pInstallColormap \ + pInternAtom/pInternAtom \ + pKillClient/pKillClient \ + pLookupColor/pLookupColor \ + pListExtensions/pListExtensions \ + pListFonts/pListFonts \ + pListFontsWithInfo/pListFontsWithInfo \ + pListHosts/pListHosts \ + pListInstalledColormaps/pListInstalledColormaps \ + pListProperties/pListProperties \ + pMapSubwindows/pMapSubwindows \ + pMapWindow/pMapWindow \ + pNoOperation/pNoOperation \ + pOpenDisplay/pOpenDisplay \ + pOpenFont/pOpenFont \ + pPolyArc/pPolyArc \ + pPolyFillArc/pPolyFillArc \ + pPolyFillRectangle/pPolyFillRectangle \ + pPolyLine/pPolyLine \ + pPolyPoint/pPolyPoint \ + pPolyRectangle/pPolyRectangle \ + pPolySegment/pPolySegment \ + pPolyText16/pPolyText16 \ + pPolyText8/pPolyText8 \ + pPutImage/pPutImage \ + pQueryBestSize/pQueryBestSize \ + pQueryColors/pQueryColors \ + pQueryExtension/pQueryExtension \ + pQueryFont/pQueryFont \ + pQueryKeymap/pQueryKeymap \ + pQueryPointer/pQueryPointer \ + pQueryTree/pQueryTree \ + pQueryTextExtents/pQueryTextExtents \ + pRecolorCursor/pRecolorCursor \ + pReparentWindow/pReparentWindow \ + pRotateProperties/pRotateProperties \ + pSendEvent/pSendEvent \ + pSetAccessControl/pSetAccessControl \ + pSetClipRectangles/pSetClipRectangles \ + pSetCloseDownMode/pSetCloseDownMode \ + pSetDashes/pSetDashes \ + pSetFontPath/pSetFontPath \ + pSetInputFocus/pSetInputFocus \ + pSetModifierMapping/pSetModifierMapping \ + pSetPointerMapping/pSetPointerMapping \ + pStoreColors/pStoreColors \ + pStoreNamedColor/pStoreNamedColor \ + pSetScreenSaver/pSetScreenSaver \ + pSetSelectionOwner/pSetSelectionOwner \ + pTranslateCoords/pTranslateCoords \ + pUngrabButton/pUngrabButton \ + pUngrabKey/pUngrabKey \ + pUngrabKeyboard/pUngrabKeyboard \ + pUngrabPointer/pUngrabPointer \ + pUngrabServer/pUngrabServer \ + pUnmapSubwindows/pUnmapSubwindows \ + pUnmapWindow/pUnmapWindow \ + pUninstallColormap/pUninstallColormap \ + pWarpPointer/pWarpPointer diff --git a/xts5/Xproto/pAllocColor/pAllocColor.m b/xts5/Xproto/pAllocColor/pAllocColor.m new file mode 100644 index 00000000..2e7ae868 --- /dev/null +++ b/xts5/Xproto/pAllocColor/pAllocColor.m @@ -0,0 +1,265 @@ +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/Xproto/pAllocColor/pAllocColor.m,v 1.2 2005-11-03 08:44:01 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pAllocColor/pAllocColor.m +>># +>># Description: +>># Tests for AllocColor +>># +>># Modifications: +>># $Log: allcclr.m,v $ +>># Revision 1.2 2005-11-03 08:44:01 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:40 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:12 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:32 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:44 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:16 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:24 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:02:54 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE AllocColor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for AllocColor request */ +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorReply *reply; + +/* + intent: send an AllocColor request to the server and check + that the server sent an AllocColor reply back + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColor); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default AllocColor request\n", CLIENT); + if ((reply = (xAllocColorReply *) Expect_Reply(CLIENT, X_AllocColor)) == NULL) { + Log_Err("client %d failed to receive AllocColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocColor reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent AllocColor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong AllocColor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pAllocColorCells/pAllocColorCells.m b/xts5/Xproto/pAllocColorCells/pAllocColorCells.m new file mode 100644 index 00000000..6413390c --- /dev/null +++ b/xts5/Xproto/pAllocColorCells/pAllocColorCells.m @@ -0,0 +1,300 @@ +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/Xproto/pAllocColorCells/pAllocColorCells.m,v 1.2 2005-11-03 08:44:01 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pAllocColorCells/pAllocColorCells.m +>># +>># Description: +>># Tests for AllocColorCells +>># +>># Modifications: +>># $Log: allcclrcll.m,v $ +>># Revision 1.2 2005-11-03 08:44:01 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:13 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:33 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:45 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:17 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:26 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:02:56 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE AllocColorCells Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for AllocColorCells request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorCellsReply *reply; +xError *err; + +/* + intent: send an AllocColorCells request to the server and check + that the server sent an AllocColorCells reply back if + colormap is supposed to allocate color cells, otherwise + check that an error was sent back. + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorCells); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default AllocColorCells request\n", CLIENT); + if (Allocatable (CLIENT)) + if ((reply = (xAllocColorCellsReply *) Expect_Reply(CLIENT, X_AllocColorCells)) == NULL) { + Log_Err("client %d failed to receive AllocColorCells reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocColorCells reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(reply); + } + else + if ((err = Expect_Error(CLIENT, BadAlloc)) == NULL) { + Log_Err("client %d failed to receive Alloc error\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Alloc error\n", CLIENT); + Free_Error(err); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent AllocColorCells request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong AllocColorCells request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good C +If the default visual class for screen zero is +.S DirectColor , +.S PseudoColor , +or +.S GrayScale : +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +Otherwise: +When a client sends a valid xname protocol request to the X server, +then the X server sends back a BadAlloc error to the client. +>>STRATEGY +Call library function testfunc() to do the following: + +If the default visual class for screen zero is +DirectColor, PseudoColor, or GrayScale : +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. + +Otherwise: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAlloc error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAlloc error. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pAllocColorPlanes/pAllocColorPlanes.m b/xts5/Xproto/pAllocColorPlanes/pAllocColorPlanes.m new file mode 100644 index 00000000..76c7502b --- /dev/null +++ b/xts5/Xproto/pAllocColorPlanes/pAllocColorPlanes.m @@ -0,0 +1,300 @@ +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/Xproto/pAllocColorPlanes/pAllocColorPlanes.m,v 1.2 2005-11-03 08:44:01 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pAllocColorPlanes/pAllocColorPlanes.m +>># +>># Description: +>># Tests for AllocColorPlanes +>># +>># Modifications: +>># $Log: allcclrpln.m,v $ +>># Revision 1.2 2005-11-03 08:44:01 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:13 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:34 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:45 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:17 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:27 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:02:59 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE AllocColorPlanes Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for AllocColorPlanes request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorPlanesReply *reply; +xError *err; + +/* + intent: send an AllocColorPlanes request to the server and check + that the server sent an AllocColorPlanes reply back if + colormap is supposed to allocate color planes, otherwise + check that an error was sent back. + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorPlanes); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default AllocColorPlanes request\n", CLIENT); + if (Allocatable (CLIENT)) + if ((reply = (xAllocColorPlanesReply *) Expect_Reply(CLIENT, X_AllocColorPlanes)) == NULL) { + Log_Err("client %d failed to receive AllocColorPlanes reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocColorPlanes reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(reply); + } + else + if ((err = Expect_Error(CLIENT, BadAlloc)) == NULL) { + Log_Err("client %d failed to receive Alloc error\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Alloc error\n", CLIENT); + Free_Error(err); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent AllocColorPlanes request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong AllocColorPlanes request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good C +If the default visual class for screen zero is +.S DirectColor , +.S PseudoColor , +or +.S GrayScale : +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +Otherwise: +When a client sends a valid xname protocol request to the X server, +then the X server sends back a BadAlloc error to the client. +>>STRATEGY +Call library function testfunc() to do the following: + +If the default visual class for screen zero is +DirectColor, PseudoColor, or GrayScale : +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. + +Otherwise: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAlloc error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAlloc error. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pAllocNamedColor/pAllocNamedColor.m b/xts5/Xproto/pAllocNamedColor/pAllocNamedColor.m new file mode 100644 index 00000000..3cdbae4f --- /dev/null +++ b/xts5/Xproto/pAllocNamedColor/pAllocNamedColor.m @@ -0,0 +1,265 @@ +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/Xproto/pAllocNamedColor/pAllocNamedColor.m,v 1.2 2005-11-03 08:44:01 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pAllocNamedColor/pAllocNamedColor.m +>># +>># Description: +>># Tests for AllocNamedColor +>># +>># Modifications: +>># $Log: allcnmdclr.m,v $ +>># Revision 1.2 2005-11-03 08:44:01 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:14 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:35 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:46 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:18 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:29 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:01 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE AllocNamedColor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for AllocNamedColor request */ +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocNamedColorReply *reply; + +/* + intent: send a AllocNamedColor request to the server and check + that the server sent an AllocNamedColor reply back + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_AllocNamedColor); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default AllocNamedColor request\n", CLIENT); + if ((reply = (xAllocNamedColorReply *) Expect_Reply(CLIENT, X_AllocNamedColor)) == NULL) { + Log_Err("client %d failed to receive AllocNamedColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocNamedColor reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent AllocNamedColor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong AllocNamedColor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Create colourmap with alloc set to AllocNone. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pAllowEvents/pAllowEvents.m b/xts5/Xproto/pAllowEvents/pAllowEvents.m new file mode 100644 index 00000000..57e6dcb2 --- /dev/null +++ b/xts5/Xproto/pAllowEvents/pAllowEvents.m @@ -0,0 +1,260 @@ +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/Xproto/pAllowEvents/pAllowEvents.m,v 1.2 2005-11-03 08:44:01 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pAllowEvents/pAllowEvents.m +>># +>># Description: +>># Tests for AllowEvents +>># +>># Modifications: +>># $Log: allwevnts.m,v $ +>># Revision 1.2 2005-11-03 08:44:01 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:14 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:36 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:46 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:18 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:30 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:03 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE AllowEvents Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for AllowEvents request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabPointerReq *gpr; +xGrabPointerReply *gprep; +xAllowEventsReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gpr = (xGrabPointerReq *) Make_Req(CLIENT, X_GrabPointer); + gpr->pointerMode = GrabModeSync; + Send_Req(CLIENT, (xReq *) gpr); + Log_Trace("client %d sent (pointerMode = GrabModeSync) GrabPointer request\n", CLIENT); + + if ((gprep = (xGrabPointerReply *) Expect_Reply(CLIENT, X_GrabPointer)) == NULL) { + Log_Err("client %d failed to receive GrabPointer reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GrabPointer reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(gprep); + } + (void) Expect_Nothing(CLIENT); + Free_Req(gpr); + + Set_Test_Type(CLIENT, test_type); + req = (xAllowEventsReq *) Make_Req(CLIENT, X_AllowEvents); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default AllowEvents request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent AllowEvents request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong AllowEvents request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pBadRequest/pBadRequest.m b/xts5/Xproto/pBadRequest/pBadRequest.m new file mode 100644 index 00000000..df03d1a7 --- /dev/null +++ b/xts5/Xproto/pBadRequest/pBadRequest.m @@ -0,0 +1,172 @@ +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/Xproto/pBadRequest/pBadRequest.m,v 1.2 2005-11-03 08:44:01 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pBadRequest/pBadRequest.m +>># +>># Description: +>># Tests for BadRequest +>># +>># Modifications: +>># $Log: bdrqst.m,v $ +>># Revision 1.2 2005-11-03 08:44:01 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:15 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:37 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:47 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:19 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:31 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:05 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE BadRequest Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Tests for the BadRequest protocol error */ + +#include "Xstlib.h" + +#define CLIENT 0 +xReq req; +xError *err; + +static +void +bad_request() +{ + Create_Client(CLIENT); + + req.reqType = Xst_BadType; + req.length = 1; + + Send_Req(CLIENT, (xReq *) &req); + Log_Trace("client %d sent request with bad type\n", CLIENT); + + if ((err = Expect_Error(CLIENT, BadRequest)) == NULL) { + Log_Err("client %d failed to receive Request error\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Request error\n", CLIENT); + if (err->majorCode == Xst_BadType && err->minorCode == 0) + Log_Trace("Op codes OK\n"); + else + Log_Err("Unexpected Op codes (%d,%d)\n", + err->majorCode, err->minorCode); + Free_Error(err); + } + + (void) Expect_Nothing(CLIENT); + + Exit_OK(); +} +>>ASSERTION Good A +When a client sends an invalid protocol request to the X server, +in which the major or minor opcode does not specify a valid request, +then the X server sends back a BadRequest error to the client. +>>STRATEGY +Open a connection to the X server using native byte sex. +Send an invalid protocol request to the X server + with major opcode 254 and minor opcode 0. +Verify that the X server sends back a BadRequest error. +Open a connection to the X server using reversed byte sex. +Send an invalid protocol request to the X server + with major opcode 254 and minor opcode 0. +Verify that the X server sends back a BadRequest error. +>>CODE + + /* Call a library function to exercise the test code */ + testfunc(bad_request); diff --git a/xts5/Xproto/pBell/pBell.m b/xts5/Xproto/pBell/pBell.m new file mode 100644 index 00000000..0b58a04d --- /dev/null +++ b/xts5/Xproto/pBell/pBell.m @@ -0,0 +1,237 @@ +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/Xproto/pBell/pBell.m,v 1.2 2005-11-03 08:44:02 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pBell/pBell.m +>># +>># Description: +>># Tests for Bell +>># +>># Modifications: +>># $Log: bll.m,v $ +>># Revision 1.2 2005-11-03 08:44:02 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:15 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:37 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:47 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:19 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:33 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:07 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE Bell Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for Bell request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xBellReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xBellReq *) Make_Req(CLIENT, X_Bell); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default Bell request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent Bell request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong Bell request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeActivePointerGrab/pChangeActivePointerGrab.m b/xts5/Xproto/pChangeActivePointerGrab/pChangeActivePointerGrab.m new file mode 100644 index 00000000..a2e0eec0 --- /dev/null +++ b/xts5/Xproto/pChangeActivePointerGrab/pChangeActivePointerGrab.m @@ -0,0 +1,256 @@ +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/Xproto/pChangeActivePointerGrab/pChangeActivePointerGrab.m,v 1.2 2005-11-03 08:44:02 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeActivePointerGrab/pChangeActivePointerGrab.m +>># +>># Description: +>># Tests for ChangeActivePointerGrab +>># +>># Modifications: +>># $Log: chngactvpn.m,v $ +>># Revision 1.2 2005-11-03 08:44:02 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:16 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:38 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:48 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:20 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:34 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:09 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeActivePointerGrab Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeActivePointerGrab request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabPointerReq *gpr; +xGrabPointerReply *gprep; +xChangeActivePointerGrabReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gpr = (xGrabPointerReq *) Make_Req(CLIENT, X_GrabPointer); + Send_Req(CLIENT, (xReq *) gpr); + Log_Trace("client %d sent default GrabPointer request\n", CLIENT); + + if ((gprep = (xGrabPointerReply *) Expect_Reply(CLIENT, X_GrabPointer)) == NULL) { + Log_Err("client %d failed to receive GrabPointer reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GrabPointer reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(gprep); + } + (void) Expect_Nothing(CLIENT); + Free_Req(gpr); + + Set_Test_Type(CLIENT, test_type); + req = (xChangeActivePointerGrabReq *) Make_Req(CLIENT, X_ChangeActivePointerGrab); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeActivePointerGrab request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeActivePointerGrab request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeActivePointerGrab request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeGC/pChangeGC.m b/xts5/Xproto/pChangeGC/pChangeGC.m new file mode 100644 index 00000000..cc80c0c6 --- /dev/null +++ b/xts5/Xproto/pChangeGC/pChangeGC.m @@ -0,0 +1,271 @@ +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/Xproto/pChangeGC/pChangeGC.m,v 1.2 2005-11-03 08:44:02 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeGC/pChangeGC.m +>># +>># Description: +>># Tests for ChangeGC() +>># +>># Modifications: +>># $Log: chnggc.m,v $ +>># Revision 1.2 2005-11-03 08:44:02 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:16 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:39 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:48 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:20 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:35 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:11 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeGC Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeGC request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xChangeGCReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xChangeGCReq *) Make_Req(CLIENT, X_ChangeGC); + if(test_type == BAD_VALUE) { + req->mask |= 1<<28; /* an unused mask bit */ + req->length += 1; + req = (xChangeGCReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeGC request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent ChangeGC request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeGC request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeGC request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeHosts/pChangeHosts.m b/xts5/Xproto/pChangeHosts/pChangeHosts.m new file mode 100644 index 00000000..00a4e3aa --- /dev/null +++ b/xts5/Xproto/pChangeHosts/pChangeHosts.m @@ -0,0 +1,321 @@ +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/Xproto/pChangeHosts/pChangeHosts.m,v 1.2 2005-11-03 08:44:02 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeHosts/pChangeHosts.m +>># +>># Description: +>># Tests for ChangeHosts +>># +>># Modifications: +>># $Log: chnghsts.m,v $ +>># Revision 1.2 2005-11-03 08:44:02 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:41 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:17 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:40 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:49 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:20 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:37 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:13 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeHosts Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeHosts request */ + +#include "Xstlib.h" +#include "xthost.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xCreateWindowReq *win_req; +xListHostsReq *hosts_req; +xListHostsReply *hosts_rep; +xChangeHostsReq *req; +unsigned char *hp; +XHostAddress *host = xthosts; + +/* + * Routine: main - touch test for ChangeHosts + * + * Input: + * + * Output: + * + * Returns: + * + * Globals used: + * + * Side Effects: + * + * Methods: this test depends on having at least one host on the + * access control list. HOST item that hp points to looks like + * + * byte entity + * 0 family + * 1 unused + * 2 length of address (2 bytes) + * 4 address (n bytes) + * + * hence length starts at hp + 2, and address starts at hp + 4. + * Can't cast hp with XHostAddress because fields don't match up. + * + */ + +static +void +tester() +{ + int mode; + extern int Xst_error_count; + + Create_Client(CLIENT); + + /* find out if use of access control list is enabled */ + + hosts_req = (xListHostsReq *) Make_Req(CLIENT, X_ListHosts); + Send_Req(CLIENT, (xReq *) hosts_req); + Log_Trace("client %d sent default ListHosts request\n", CLIENT); + + if ((hosts_rep = (xListHostsReply *) Expect_Reply(CLIENT, X_ListHosts)) == NULL) { + Log_Del("client %d failed to receive ListHosts reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListHosts reply\n", CLIENT); + } + + if (hosts_rep->nHosts < 1) + mode = HostInsert; + else + mode = HostDelete; + + + /* Delete/Insert host from/to access control list */ + + Set_Test_Type(CLIENT, test_type); + req = (xChangeHostsReq *) Make_Req(CLIENT, X_ChangeHosts); +debug(3,"length of req = %d, req at 0x%lx\n",req->length,(unsigned long)req); + if ((req->mode = mode) == HostDelete) { + hp = (unsigned char *) ((unsigned char *) hosts_rep + sizeof (xListHostsReply)); + req = (xChangeHostsReq *) + Add_Counted_Bytes (req, hp + 4, * (unsigned short *) (hp + 2)); + } else { + req = (xChangeHostsReq *) + Add_Counted_Bytes (req, host->address, host->length); + req->hostFamily = host->family; + } +debug(3,"pre-send length of req = %d, req at 0x%lx\n",req->length,(unsigned long)req); + + Send_Req(CLIENT, (xReq *) req); +debug(3,"post-send length of req = %d, req at 0x%lx\n",req->length,(unsigned long)req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeHosts request\n", CLIENT); + Log_Trace("\t(BadAccess probably indicates not on local/privileged machine)\n"); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeHosts request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeHosts request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + /* tidy up by undoing the change */ + if (!isdeleted() && ( + (Xst_error_count == 0 && test_type == GOOD) || + (Xst_error_count > 0 && test_type != GOOD) + ) ) { + Set_Test_Type(CLIENT, SETUP); + req->mode = (mode == HostInsert) ? HostDelete : HostInsert; + Send_Req(CLIENT, (xReq *) req); + (void) Expect_Nothing(CLIENT); + } + + Free_Req(hosts_req); + Free_Reply(hosts_rep); + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeKeyboardControl/pChangeKeyboardControl.m b/xts5/Xproto/pChangeKeyboardControl/pChangeKeyboardControl.m new file mode 100644 index 00000000..974c3d99 --- /dev/null +++ b/xts5/Xproto/pChangeKeyboardControl/pChangeKeyboardControl.m @@ -0,0 +1,284 @@ +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/Xproto/pChangeKeyboardControl/pChangeKeyboardControl.m,v 1.2 2005-11-03 08:44:02 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeKeyboardControl/pChangeKeyboardControl.m +>># +>># Description: +>># Tests for ChangeKeyboardControl +>># +>># Modifications: +>># $Log: chngkybrdc.m,v $ +>># Revision 1.2 2005-11-03 08:44:02 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:44 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:17 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:41 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:49 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:21 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:39 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:15 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeKeyboardControl Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeKeyboardControl request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gkcr; +xGetKeyboardControlReply *gkcrep; +xChangeKeyboardControlReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + gkcr = (xReq *) Make_Req(CLIENT, X_GetKeyboardControl); + Send_Req(CLIENT, (xReq *) gkcr); + Log_Trace("client %d sent default GetKeyboardControl request\n", CLIENT); + + if ((gkcrep = (xGetKeyboardControlReply *) Expect_Reply(CLIENT, X_GetKeyboardControl)) == NULL) { + Log_Err("client %d failed to receive GetKeyboardControl reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetKeyboardControl reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xChangeKeyboardControlReq *) Make_Req(CLIENT, X_ChangeKeyboardControl); + req = (xChangeKeyboardControlReq *) Add_Masked_Value(req, KBKeyClickPercent, gkcrep->keyClickPercent); + if(test_type == BAD_VALUE) { + req->mask |= 1<<28; /* an unused mask bit */ + req->length += 1; + req = (xChangeKeyboardControlReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeKeyboardControl request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent ChangeKeyboardControl request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeKeyboardControl request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeKeyboardControl request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeKeyboardMapping/pChangeKeyboardMapping.m b/xts5/Xproto/pChangeKeyboardMapping/pChangeKeyboardMapping.m new file mode 100644 index 00000000..730dca9e --- /dev/null +++ b/xts5/Xproto/pChangeKeyboardMapping/pChangeKeyboardMapping.m @@ -0,0 +1,282 @@ +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/Xproto/pChangeKeyboardMapping/pChangeKeyboardMapping.m,v 1.2 2005-11-03 08:44:02 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeKeyboardMapping/pChangeKeyboardMapping.m +>># +>># Description: +>># Tests for ChangeKeyboardMapping +>># +>># Modifications: +>># $Log: chngkybrdm.m,v $ +>># Revision 1.2 2005-11-03 08:44:02 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:45 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:18 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:42 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:50 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:21 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:40 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:18 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeKeyboardMapping Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeKeyboardMapping request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGetKeyboardMappingReq *gkmr; +xGetKeyboardMappingReply *gkmrep; +xChangeKeyboardMappingReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + /* Get the existing mapping... */ + + gkmr = (xGetKeyboardMappingReq *) Make_Req(CLIENT, X_GetKeyboardMapping); + Send_Req(CLIENT, (xReq *) gkmr); + Log_Trace("client %d sent default GetKeyboardMapping request\n", CLIENT); + + if ((gkmrep = (xGetKeyboardMappingReply *) Expect_Reply(CLIENT, X_GetKeyboardMapping)) == NULL) { + Log_Err("client %d failed to receive GetKeyboardMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetKeyboardMapping reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + /* ... then make a request to duplicate that mapping. */ + + Set_Test_Type(CLIENT, test_type); + req = (xChangeKeyboardMappingReq *) Make_Req(CLIENT, X_ChangeKeyboardMapping); + req->keyCodes = gkmr->count; + req->firstKeyCode = gkmr->firstKeyCode; + req->keySymsPerKeyCode = gkmrep->keySymsPerKeyCode; + req->length += req->keyCodes * req->keySymsPerKeyCode; + req = (xChangeKeyboardMappingReq *) Xstrealloc((char *) req, req->length<<2); + { + unsigned char *p, *q, *r; + + p = (unsigned char *) (gkmrep + 1); + q = (unsigned char *) (req + 1); + r = ((unsigned char *) req) + (int)(req->length<<2); /* endptr */ + while (q < r) + *q++ = *p++; + } + + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeKeyboardMapping request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, MappingNotify)) == NULL) { + Log_Err("client %d failed to receive MappingNotify\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received MappingNotify\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeKeyboardMapping request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeKeyboardMapping request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a +.S MappingNotify +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a MappingNotify event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a MappingNotify event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangePointerControl/pChangePointerControl.m b/xts5/Xproto/pChangePointerControl/pChangePointerControl.m new file mode 100644 index 00000000..67c3d320 --- /dev/null +++ b/xts5/Xproto/pChangePointerControl/pChangePointerControl.m @@ -0,0 +1,255 @@ +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/Xproto/pChangePointerControl/pChangePointerControl.m,v 1.2 2005-11-03 08:44:03 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangePointerControl/pChangePointerControl.m +>># +>># Description: +>># Tests for ChangePointerControl +>># +>># Modifications: +>># $Log: chngpntrcn.m,v $ +>># Revision 1.2 2005-11-03 08:44:03 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:45 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:18 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:43 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:50 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:22 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:42 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:20 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangePointerControl Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangePointerControl request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gpcr; +xGetPointerControlReply *gpcrep; +xChangePointerControlReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + gpcr = (xReq *) Make_Req(CLIENT, X_GetPointerControl); + Send_Req(CLIENT, (xReq *) gpcr); + Log_Trace("client %d sent default GetPointerControl request\n", CLIENT); + + if ((gpcrep = (xGetPointerControlReply *) Expect_Reply(CLIENT, X_GetPointerControl)) == NULL) { + Log_Err("client %d failed to receive GetPointerControl reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetPointerControl reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xChangePointerControlReq *) Make_Req(CLIENT, X_ChangePointerControl); + req->accelNum = gpcrep->accelNumerator; + req->accelDenum = gpcrep->accelDenominator; + req->threshold = gpcrep->threshold; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangePointerControl request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangePointerControl request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangePointerControl request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeProperty/pChangeProperty.m b/xts5/Xproto/pChangeProperty/pChangeProperty.m new file mode 100644 index 00000000..b2ecb082 --- /dev/null +++ b/xts5/Xproto/pChangeProperty/pChangeProperty.m @@ -0,0 +1,245 @@ +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/Xproto/pChangeProperty/pChangeProperty.m,v 1.2 2005-11-03 08:44:03 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeProperty/pChangeProperty.m +>># +>># Description: +>># Tests for ChangeProperty +>># +>># Modifications: +>># $Log: chngprprty.m,v $ +>># Revision 1.2 2005-11-03 08:44:03 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:46 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:19 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:44 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:51 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:22 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:43 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:22 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeProperty Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeProperty request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Atom Test_Property; +xChangePropertyReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Test_Property = Create_Default_Atom(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xChangePropertyReq *) Make_Req(CLIENT, X_ChangeProperty); + req->property = Test_Property; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeProperty request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeProperty request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeProperty request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeSaveSet/pChangeSaveSet.m b/xts5/Xproto/pChangeSaveSet/pChangeSaveSet.m new file mode 100644 index 00000000..a61edbe4 --- /dev/null +++ b/xts5/Xproto/pChangeSaveSet/pChangeSaveSet.m @@ -0,0 +1,245 @@ +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/Xproto/pChangeSaveSet/pChangeSaveSet.m,v 1.2 2005-11-03 08:44:03 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeSaveSet/pChangeSaveSet.m +>># +>># Description: +>># Tests for ChangeSaveSet +>># +>># Modifications: +>># $Log: chngsvst.m,v $ +>># Revision 1.2 2005-11-03 08:44:03 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:46 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:19 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:45 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:51 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:23 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:44 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:24 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeSaveSet Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeSaveSet request */ + +#include "Xstlib.h" + +#define CLIENT 0 +#define CLIENT1 1 +static TestType test_type = SETUP; +Window win; +xChangeSaveSetReq *req; +xEvent *ev; +xError *err; + +static +void +tester() +{ + Create_Client(CLIENT); + Create_Client(CLIENT1); + + win = Create_Default_Window(CLIENT1); + + Set_Test_Type(CLIENT, test_type); + req = (xChangeSaveSetReq *) Make_Req(CLIENT, X_ChangeSaveSet); + req->window = win; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeSaveSet request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeSaveSet request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeSaveSet request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pChangeWindowAttributes/pChangeWindowAttributes.m b/xts5/Xproto/pChangeWindowAttributes/pChangeWindowAttributes.m new file mode 100644 index 00000000..08d51666 --- /dev/null +++ b/xts5/Xproto/pChangeWindowAttributes/pChangeWindowAttributes.m @@ -0,0 +1,273 @@ +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/Xproto/pChangeWindowAttributes/pChangeWindowAttributes.m,v 1.2 2005-11-03 08:44:03 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pChangeWindowAttributes/pChangeWindowAttributes.m +>># +>># Description: +>># Tests for ChangeWindowAttributes +>># +>># Modifications: +>># $Log: chngwdwatt.m,v $ +>># Revision 1.2 2005-11-03 08:44:03 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:46 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:20 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:46 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:51 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:23 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:46 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:26 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ChangeWindowAttributes Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ChangeWindowAttributes request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xChangeWindowAttributesReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xChangeWindowAttributesReq *) Make_Req(CLIENT, X_ChangeWindowAttributes); + if(test_type == BAD_VALUE) { + req->valueMask |= 1<<28; /* an unused mask bit */ + req->length += 1; + req = (xChangeWindowAttributesReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ChangeWindowAttributes request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent ChangeWindowAttributes request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ChangeWindowAttributes request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ChangeWindowAttributes request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCirculateWindow/pCirculateWindow.m b/xts5/Xproto/pCirculateWindow/pCirculateWindow.m new file mode 100644 index 00000000..41f8338f --- /dev/null +++ b/xts5/Xproto/pCirculateWindow/pCirculateWindow.m @@ -0,0 +1,309 @@ +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/Xproto/pCirculateWindow/pCirculateWindow.m,v 1.2 2005-11-03 08:44:05 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCirculateWindow/pCirculateWindow.m +>># +>># Description: +>># Tests for CirculateWindow +>># +>># Modifications: +>># $Log: crcltwdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:05 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:50 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:25 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:57 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:56 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:27 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:59 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:45 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CirculateWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CirculateWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xCreateWindowReq *cwr; +xResourceReq *mwr; +xCirculateWindowReq *req; +xEvent *ev; +Bool haveSecondEvent; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + cwr->parent = Default_Window; + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent additional CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cwr); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + cwr->parent = Default_Window; + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent additional CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cwr); + + mwr = (xResourceReq *) Make_Req(CLIENT, X_MapWindow); + Send_Req(CLIENT, (xReq *) mwr); + Log_Trace("client %d sent default MapWindow\n", CLIENT); + + if ((ev = (xEvent *) Expect_Event(CLIENT, Expose)) == NULL) { + Log_Err("client %d failed to receive Expose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Expose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + Free_Req(mwr); + + mwr = (xResourceReq *) Make_Req(CLIENT, X_MapSubwindows); + Send_Req(CLIENT, (xReq *) mwr); + Log_Trace("client %d sent default MapSubwindows\n", CLIENT); + + if ((ev = (xEvent *) Expect_Event(CLIENT, Expose)) == NULL) { + Log_Err("client %d failed to receive Expose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Expose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + if ((ev = (xEvent *) Expect_01Event(CLIENT, Expose)) == NULL) { + haveSecondEvent = False; + } else { + haveSecondEvent = True; + Log_Trace("client %d received second Expose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + (void) Expect_Nothing(CLIENT); + } + Free_Req(mwr); + + Set_Test_Type(CLIENT, test_type); + req = (xCirculateWindowReq *) Make_Req(CLIENT, X_CirculateWindow); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CirculateWindow request\n", CLIENT); + if (!haveSecondEvent) { + if ((ev = (xEvent *) Expect_Event(CLIENT, Expose)) == NULL) { + Log_Err("client %d failed to receive Expose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Expose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CirculateWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CirculateWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and regions of formerly obscured windows are exposed, +then the X server sends back an +.S Expose +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an Expose event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an Expose event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pClearArea/pClearArea.m b/xts5/Xproto/pClearArea/pClearArea.m new file mode 100644 index 00000000..a7139683 --- /dev/null +++ b/xts5/Xproto/pClearArea/pClearArea.m @@ -0,0 +1,258 @@ +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/Xproto/pClearArea/pClearArea.m,v 1.2 2005-11-03 08:44:03 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pClearArea/pClearArea.m +>># +>># Description: +>># Tests for ClearArea +>># +>># Modifications: +>># $Log: clrar.m,v $ +>># Revision 1.2 2005-11-03 08:44:03 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:48 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:20 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:47 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:52 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:23 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:47 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:28 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ClearArea Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ClearArea request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xClearAreaReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + Map_Window(CLIENT, Default_Window); + + Set_Test_Type(CLIENT, test_type); + req = (xClearAreaReq *) Make_Req(CLIENT, X_ClearArea); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ClearArea request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, Expose)) == NULL) { + Log_Err("client %d failed to receive Expose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Expose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ClearArea request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ClearArea request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and +.M exposures +is +.S True , +then the X server sends back an +.S Expose +event to the client +for regions of the rectangle that are either visible or are being retained in +backing store. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an Expose event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an Expose event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCloseFont/pCloseFont.m b/xts5/Xproto/pCloseFont/pCloseFont.m new file mode 100644 index 00000000..6461b13e --- /dev/null +++ b/xts5/Xproto/pCloseFont/pCloseFont.m @@ -0,0 +1,244 @@ +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/Xproto/pCloseFont/pCloseFont.m,v 1.2 2005-11-03 08:44:03 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCloseFont/pCloseFont.m +>># +>># Description: +>># Tests for CloseFont +>># +>># Modifications: +>># $Log: clsfnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:03 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:48 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:21 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:48 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:52 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:24 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:49 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:30 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CloseFont Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for CloseFont request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Font Default_Font; +xResourceReq *req; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + Default_Font = Create_Default_Font(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_CloseFont); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CloseFont request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CloseFont request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CloseFont request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pConfigureWindow/pConfigureWindow.m b/xts5/Xproto/pConfigureWindow/pConfigureWindow.m new file mode 100644 index 00000000..00619779 --- /dev/null +++ b/xts5/Xproto/pConfigureWindow/pConfigureWindow.m @@ -0,0 +1,273 @@ +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/Xproto/pConfigureWindow/pConfigureWindow.m,v 1.2 2005-11-03 08:44:04 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pConfigureWindow/pConfigureWindow.m +>># +>># Description: +>># Tests for ConfigureWindow +>># +>># Modifications: +>># $Log: cnfgrwdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:04 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:48 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:21 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:49 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:53 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:24 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:50 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:32 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ConfigureWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ConfigureWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xConfigureWindowReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xConfigureWindowReq *) Make_Req(CLIENT, X_ConfigureWindow); + if(test_type == BAD_VALUE) { + req->mask |= 1<<12; /* an unused mask bit */ + req->length += 1; + req = (xConfigureWindowReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ConfigureWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent ConfigureWindow request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ConfigureWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ConfigureWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pConvertSelection/pConvertSelection.m b/xts5/Xproto/pConvertSelection/pConvertSelection.m new file mode 100644 index 00000000..5af5e058 --- /dev/null +++ b/xts5/Xproto/pConvertSelection/pConvertSelection.m @@ -0,0 +1,255 @@ +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/Xproto/pConvertSelection/pConvertSelection.m,v 1.2 2005-11-03 08:44:04 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pConvertSelection/pConvertSelection.m +>># +>># Description: +>># Tests for ConvertSelection +>># +>># Modifications: +>># $Log: cnvrtslctn.m,v $ +>># Revision 1.2 2005-11-03 08:44:04 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:49 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:22 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:51 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:53 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:25 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:52 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:34 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ConvertSelection Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ConvertSelection request */ + +/* Expect to get a SelectionNotify event with property None, since a + selection that is not set is being requested. */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Atom Test_Property; +xConvertSelectionReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Test_Property = Create_Default_Atom(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xConvertSelectionReq *) Make_Req(CLIENT, X_ConvertSelection); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ConvertSelection request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, SelectionNotify)) == NULL) { + Log_Err("client %d failed to receive SelectionNotify\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received SelectionNotify\n", CLIENT); + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ConvertSelection request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ConvertSelection request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and no client currently owns the selection, +then the X server sends back a +.S SelectionNotify +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a SelectionNotify event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a SelectionNotify event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCopyArea/pCopyArea.m b/xts5/Xproto/pCopyArea/pCopyArea.m new file mode 100644 index 00000000..2b97c282 --- /dev/null +++ b/xts5/Xproto/pCopyArea/pCopyArea.m @@ -0,0 +1,258 @@ +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/Xproto/pCopyArea/pCopyArea.m,v 1.2 2005-11-03 08:44:04 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCopyArea/pCopyArea.m +>># +>># Description: +>># Tests for CopyArea +>># +>># Modifications: +>># $Log: cpyar.m,v $ +>># Revision 1.2 2005-11-03 08:44:04 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:49 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:22 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:52 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:54 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:25 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:53 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:36 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CopyArea Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CopyArea request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xCreateWindowReq *cwr; +xCopyAreaReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xCopyAreaReq *) Make_Req(CLIENT, X_CopyArea); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CopyArea request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, GraphicsExpose)) == NULL) { + Log_Err("client %d failed to receive GraphicsExpose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GraphicsExpose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CopyArea request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CopyArea request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and +.M graphics-exposures +in the graphics context is +.S True , +then the X server sends back a +.S GraphicsExpose +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a GraphicsExpose event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a GraphicsExpose event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCopyColormapAndFree/pCopyColormapAndFree.m b/xts5/Xproto/pCopyColormapAndFree/pCopyColormapAndFree.m new file mode 100644 index 00000000..be32bcc8 --- /dev/null +++ b/xts5/Xproto/pCopyColormapAndFree/pCopyColormapAndFree.m @@ -0,0 +1,333 @@ +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/Xproto/pCopyColormapAndFree/pCopyColormapAndFree.m,v 1.2 2005-11-03 08:44:04 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCopyColormapAndFree/pCopyColormapAndFree.m +>># +>># Description: +>># Tests for CopyColormapAndFree +>># +>># Modifications: +>># $Log: cpyclrmpan.m,v $ +>># Revision 1.2 2005-11-03 08:44:04 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:49 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:23 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:53 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:54 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:25 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:55 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:38 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CopyColormapAndFree Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CopyColormapAndFree request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorCellsReply *reply; + +/* + intent: send a CopyColormapAndFree request to the server and check + that nothing was sent back. + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* Allocate color cells if client hasn't got any */ + + if (Allocatable (CLIENT)) { + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorCells); + Send_Req(CLIENT, (xReq *) req); + if ((reply = (xAllocColorCellsReply *) Expect_Reply(CLIENT, X_AllocColorCells)) == NULL) { + Log_Err("client %d failed to receive AllocColorCells reply\n", CLIENT); + Exit(); + } + else { + Log_Trace("client %d received AllocColorCells reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(reply); + } + Free_Req(req); + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_CopyColormapAndFree); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CopyColormapAndFree request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->id = 0xffffffff; /* top 2 bits set ==> invalid */ + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CopyColormapAndFree request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CopyColormapAndFree request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CopyColormapAndFree request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CopyColormapAndFree request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CopyColormapAndFree request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCopyGC/pCopyGC.m b/xts5/Xproto/pCopyGC/pCopyGC.m new file mode 100644 index 00000000..700ec518 --- /dev/null +++ b/xts5/Xproto/pCopyGC/pCopyGC.m @@ -0,0 +1,280 @@ +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/Xproto/pCopyGC/pCopyGC.m,v 1.2 2005-11-03 08:44:04 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCopyGC/pCopyGC.m +>># +>># Description: +>># Tests for CopyGC +>># +>># Modifications: +>># $Log: cpygc.m,v $ +>># Revision 1.2 2005-11-03 08:44:04 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:49 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:23 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:54 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:55 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:26 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:57 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:40 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CopyGC Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CopyGC request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +GContext gc1, gc2; +xChangeGCReq *cgcr; +xCopyGCReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + gc1 = Create_Default_GContext(CLIENT); + gc2 = Create_GContext(CLIENT); + + cgcr = (xChangeGCReq *) Make_Req(CLIENT, X_ChangeGC); + Send_Req(CLIENT, (xReq *) cgcr); + Log_Trace("client %d sent default ChangeGC request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cgcr); + + Set_Test_Type(CLIENT, test_type); + req = (xCopyGCReq *) Make_Req(CLIENT, X_CopyGC); + req->dstGC = gc2; + if(test_type == BAD_VALUE) { + req->mask |= 1<<28; /* an unused mask bit */ + req = (xCopyGCReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CopyGC request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent CopyGC request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CopyGC request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CopyGC request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCopyPlane/pCopyPlane.m b/xts5/Xproto/pCopyPlane/pCopyPlane.m new file mode 100644 index 00000000..ce761bd6 --- /dev/null +++ b/xts5/Xproto/pCopyPlane/pCopyPlane.m @@ -0,0 +1,257 @@ +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/Xproto/pCopyPlane/pCopyPlane.m,v 1.2 2005-11-03 08:44:04 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCopyPlane/pCopyPlane.m +>># +>># Description: +>># Tests for CopyPlane +>># +>># Modifications: +>># $Log: cpypln.m,v $ +>># Revision 1.2 2005-11-03 08:44:04 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:50 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:24 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:55 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:55 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:26 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:04:58 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:43 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CopyPlane Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CopyPlane request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xCopyPlaneReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xCopyPlaneReq *) Make_Req(CLIENT, X_CopyPlane); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CopyPlane request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, GraphicsExpose)) == NULL) { + Log_Err("client %d failed to receive GraphicsExpose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GraphicsExpose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CopyPlane request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CopyPlane request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and +.M graphics-exposures +in the graphics context is +.S True , +then the X server sends back a +.S GraphicsExpose +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a GraphicsExpose event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a GraphicsExpose event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCreateColormap/pCreateColormap.m b/xts5/Xproto/pCreateColormap/pCreateColormap.m new file mode 100644 index 00000000..3775419b --- /dev/null +++ b/xts5/Xproto/pCreateColormap/pCreateColormap.m @@ -0,0 +1,313 @@ +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/Xproto/pCreateColormap/pCreateColormap.m,v 1.2 2005-11-03 08:44:05 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCreateColormap/pCreateColormap.m +>># +>># Description: +>># Tests for CreateColormap +>># +>># Modifications: +>># $Log: crtclrmp.m,v $ +>># Revision 1.2 2005-11-03 08:44:05 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:50 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:25 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:58 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:56 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:27 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:01 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:47 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CreateColormap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CreateColormap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xCreateColormapReq *req; + +/* + intent: send a CreateColormap request to the server and check + for the correct response + input: + output: + global input: + side effects: creates a window resource and a colormap resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xCreateColormapReq *) Make_Req(CLIENT, X_CreateColormap); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CreateColormap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->mid = 0xffffffff; /* top 2 bits set ==> invalid */ + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CreateColormap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CreateColormap request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CreateColormap request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CreateColormap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CreateColormap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCreateCursor/pCreateCursor.m b/xts5/Xproto/pCreateCursor/pCreateCursor.m new file mode 100644 index 00000000..ebf535a5 --- /dev/null +++ b/xts5/Xproto/pCreateCursor/pCreateCursor.m @@ -0,0 +1,306 @@ +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/Xproto/pCreateCursor/pCreateCursor.m,v 1.2 2005-11-03 08:44:05 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCreateCursor/pCreateCursor.m +>># +>># Description: +>># Tests for CreateCursor +>># +>># Modifications: +>># $Log: crtcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:44:05 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:50 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:26 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:52:59 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:56 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:28 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:03 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:50 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CreateCursor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CreateCursor request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +Pixmap pix; +xCreateCursorReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + pix = Create_Default_Cursor_Pixmap(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xCreateCursorReq *) Make_Req(CLIENT, X_CreateCursor); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CreateCursor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->cid = 0xffffffff; /* top 2 bits set ==> invalid */ + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CreateCursor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CreateCursor request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CreateCursor request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CreateCursor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CreateCursor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCreateGC/pCreateGC.m b/xts5/Xproto/pCreateGC/pCreateGC.m new file mode 100644 index 00000000..beeed2b4 --- /dev/null +++ b/xts5/Xproto/pCreateGC/pCreateGC.m @@ -0,0 +1,334 @@ +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/Xproto/pCreateGC/pCreateGC.m,v 1.2 2005-11-03 08:44:05 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCreateGC/pCreateGC.m +>># +>># Description: +>># Tests for CreateGC +>># +>># Modifications: +>># $Log: crtgc.m,v $ +>># Revision 1.2 2005-11-03 08:44:05 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:51 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:26 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:00 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:57 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:28 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:04 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:52 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CreateGC Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CreateGC request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xCreateGCReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xCreateGCReq *) Make_Req(CLIENT, X_CreateGC); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CreateGC request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->gc = 0xffffffff; /* top 2 bits set ==> invalid */ + } + if(test_type == BAD_VALUE) { + req->mask |= 1<<28; /* an unused mask bit */ + req->length += 1; + req = (xCreateGCReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CreateGC request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CreateGC request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CreateGC request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent CreateGC request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CreateGC request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CreateGC request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCreateGlyphCursor/pCreateGlyphCursor.m b/xts5/Xproto/pCreateGlyphCursor/pCreateGlyphCursor.m new file mode 100644 index 00000000..29b0bd8e --- /dev/null +++ b/xts5/Xproto/pCreateGlyphCursor/pCreateGlyphCursor.m @@ -0,0 +1,308 @@ +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/Xproto/pCreateGlyphCursor/pCreateGlyphCursor.m,v 1.2 2005-11-03 08:44:05 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCreateGlyphCursor/pCreateGlyphCursor.m +>># +>># Description: +>># Tests for CreateGlyphCursor +>># +>># Modifications: +>># $Log: crtglyphcr.m,v $ +>># Revision 1.2 2005-11-03 08:44:05 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:52 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:27 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:01 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:57 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:29 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:06 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:56 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CreateGlyphCursor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for CreateGlyphCursor request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xCreateGlyphCursorReq *req; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Font(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xCreateGlyphCursorReq *) Make_Req(CLIENT, X_CreateGlyphCursor); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CreateGlyphCursor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->cid = 0xffffffff; /* top 2 bits set ==> invalid */ + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CreateGlyphCursor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CreateGlyphCursor request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CreateGlyphCursor request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CreateGlyphCursor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CreateGlyphCursor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCreatePixmap/pCreatePixmap.m b/xts5/Xproto/pCreatePixmap/pCreatePixmap.m new file mode 100644 index 00000000..b8440a37 --- /dev/null +++ b/xts5/Xproto/pCreatePixmap/pCreatePixmap.m @@ -0,0 +1,303 @@ +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/Xproto/pCreatePixmap/pCreatePixmap.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCreatePixmap/pCreatePixmap.m +>># +>># Description: +>># Tests for CreatePixmap +>># +>># Modifications: +>># $Log: crtpxmp.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:53 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:27 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:02 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:58 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:29 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:08 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:03:58 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CreatePixmap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CreatePixmap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xCreatePixmapReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xCreatePixmapReq *) Make_Req(CLIENT, X_CreatePixmap); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CreatePixmap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->pid = 0xffffffff; /* top 2 bits set ==> invalid */ + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CreatePixmap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CreatePixmap request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CreatePixmap request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CreatePixmap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CreatePixmap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pCreateWindow/pCreateWindow.m b/xts5/Xproto/pCreateWindow/pCreateWindow.m new file mode 100644 index 00000000..3164af5f --- /dev/null +++ b/xts5/Xproto/pCreateWindow/pCreateWindow.m @@ -0,0 +1,339 @@ +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/Xproto/pCreateWindow/pCreateWindow.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pCreateWindow/pCreateWindow.m +>># +>># Description: +>># Tests for CreateWindow +>># +>># Modifications: +>># $Log: crtwdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:53 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:28 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:03 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:58 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:30 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:10 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:00 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE CreateWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for CreateWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xCreateWindowReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + req->parent = Default_Window; + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->wid = 0xffffffff; /* top 2 bits set ==> invalid */ + } + if(test_type == BAD_VALUE) { + req->mask |= 1<<28; /* an unused mask bit */ + req->length += 1; + req = (xCreateWindowReq *) Xstrealloc((char *) req, req->length<<2); + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent CreateWindow request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent CreateWindow request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_VALUE: + Log_Trace("client %d sent CreateWindow request with illegal mask\n", CLIENT); + (void) Expect_BadValue(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent CreateWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong CreateWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the mask value contains an unused bit, +then the X server sends back a BadValue error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with a mask value + containing an unused bit. +Verify that the X server sends back a BadValue error. +>>CODE + + test_type = BAD_VALUE; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pDeleteProperty/pDeleteProperty.m b/xts5/Xproto/pDeleteProperty/pDeleteProperty.m new file mode 100644 index 00000000..eb470af7 --- /dev/null +++ b/xts5/Xproto/pDeleteProperty/pDeleteProperty.m @@ -0,0 +1,253 @@ +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/Xproto/pDeleteProperty/pDeleteProperty.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pDeleteProperty/pDeleteProperty.m +>># +>># Description: +>># Tests for DeleteProperty +>># +>># Modifications: +>># $Log: dltprprty.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:54 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:28 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:04 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:59 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:30 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:11 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:03 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE DeleteProperty Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for DeleteProperty request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Atom Test_Property; +xChangePropertyReq *cpr; +xDeletePropertyReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Test_Property = Create_Default_Atom(CLIENT); + + cpr = (xChangePropertyReq *) Make_Req(CLIENT, X_ChangeProperty); + cpr->property = Test_Property; + Send_Req(CLIENT, (xReq *) cpr); + Log_Trace("client %d sent default ChangeProperty request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cpr); + + Set_Test_Type(CLIENT, test_type); + req = (xDeletePropertyReq *) Make_Req(CLIENT, X_DeleteProperty); + req->property = Test_Property; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default DeleteProperty request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent DeleteProperty request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong DeleteProperty request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pDestroySubwindows/pDestroySubwindows.m b/xts5/Xproto/pDestroySubwindows/pDestroySubwindows.m new file mode 100644 index 00000000..c2ced1b8 --- /dev/null +++ b/xts5/Xproto/pDestroySubwindows/pDestroySubwindows.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/Xproto/pDestroySubwindows/pDestroySubwindows.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pDestroySubwindows/pDestroySubwindows.m +>># +>># Description: +>># Tests for DestroySubwindows +>># +>># Modifications: +>># $Log: dstrysbws.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:54 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:29 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:04 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:23:59 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:31 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:13 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:05 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE DestroySubwindows Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for DestroySubwindows request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xCreateWindowReq *cwr; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + cwr->parent = Default_Window; + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent additional CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cwr); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_DestroySubwindows); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default DestroySubwindows request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent DestroySubwindows request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong DestroySubwindows request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pDestroyWindow/pDestroyWindow.m b/xts5/Xproto/pDestroyWindow/pDestroyWindow.m new file mode 100644 index 00000000..9e34c444 --- /dev/null +++ b/xts5/Xproto/pDestroyWindow/pDestroyWindow.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/Xproto/pDestroyWindow/pDestroyWindow.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pDestroyWindow/pDestroyWindow.m +>># +>># Description: +>># Tests for DestroyWindow +>># +>># Modifications: +>># $Log: dstrywdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:55 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:29 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:05 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:00 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:31 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:14 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:07 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE DestroyWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for DestroyWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_DestroyWindow); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default DestroyWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent DestroyWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong DestroyWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pFillPoly/pFillPoly.m b/xts5/Xproto/pFillPoly/pFillPoly.m new file mode 100644 index 00000000..42d784fa --- /dev/null +++ b/xts5/Xproto/pFillPoly/pFillPoly.m @@ -0,0 +1,230 @@ +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/Xproto/pFillPoly/pFillPoly.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pFillPoly/pFillPoly.m +>># +>># Description: +>># Tests for FillPoly +>># +>># Modifications: +>># $Log: fllply.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:55 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:30 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:06 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:00 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:32 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:16 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:08 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE FillPoly Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for FillPoly request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xFillPolyReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xFillPolyReq *) Make_Req(CLIENT, X_FillPoly); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default FillPoly request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent FillPoly request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong FillPoly request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request +plus zero or more vertices, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero vertices. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero vertices. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pForceScreenSaver/pForceScreenSaver.m b/xts5/Xproto/pForceScreenSaver/pForceScreenSaver.m new file mode 100644 index 00000000..14b1ea30 --- /dev/null +++ b/xts5/Xproto/pForceScreenSaver/pForceScreenSaver.m @@ -0,0 +1,239 @@ +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/Xproto/pForceScreenSaver/pForceScreenSaver.m,v 1.2 2005-11-03 08:44:07 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pForceScreenSaver/pForceScreenSaver.m +>># +>># Description: +>># Tests for ForceScreenSaver +>># +>># Modifications: +>># $Log: frcscrnsvr.m,v $ +>># Revision 1.2 2005-11-03 08:44:07 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:57 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:32 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:10 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:02 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:34 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:21 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:16 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ForceScreenSaver Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ForceScreenSaver request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xForceScreenSaverReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + /* Activate screen saver */ + Set_Test_Type(CLIENT, test_type); + req = (xForceScreenSaverReq *) Make_Req(CLIENT, X_ForceScreenSaver); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ForceScreenSaver request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ForceScreenSaver request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ForceScreenSaver request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pFreeColormap/pFreeColormap.m b/xts5/Xproto/pFreeColormap/pFreeColormap.m new file mode 100644 index 00000000..6a6296dd --- /dev/null +++ b/xts5/Xproto/pFreeColormap/pFreeColormap.m @@ -0,0 +1,252 @@ +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/Xproto/pFreeColormap/pFreeColormap.m,v 1.2 2005-11-03 08:44:06 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pFreeColormap/pFreeColormap.m +>># +>># Description: +>># Tests for FreeColormap +>># +>># Modifications: +>># $Log: frclrmp.m,v $ +>># Revision 1.2 2005-11-03 08:44:06 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:56 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:30 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:07 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:01 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:32 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:17 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:10 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE FreeColormap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for FreeColormap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; + +/* + intent: send a FreeColormap request to the server and check + that the server sent nothing back + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_FreeColormap); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default FreeColormap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent FreeColormap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong FreeColormap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pFreeColors/pFreeColors.m b/xts5/Xproto/pFreeColors/pFreeColors.m new file mode 100644 index 00000000..8286d9a8 --- /dev/null +++ b/xts5/Xproto/pFreeColors/pFreeColors.m @@ -0,0 +1,260 @@ +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/Xproto/pFreeColors/pFreeColors.m,v 1.2 2005-11-03 08:44:07 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pFreeColors/pFreeColors.m +>># +>># Description: +>># Tests for FreeColors +>># +>># Modifications: +>># $Log: frclrs.m,v $ +>># Revision 1.2 2005-11-03 08:44:07 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:56 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:31 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:08 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.1 1998/08/04 22:51:03 andy +>># Changed type of reply_pixel from unsigned long to CARD32 to match +>># declaration in libproto/pMakeReq.c. +>># +>># Revision 6.0 1998/03/02 05:24:01 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:33 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:18 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:12 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE FreeColors Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for FreeColors request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocNamedColorReply *alloc_reply; +extern CARD32 reply_pixel; + +/* + intent: send a FreeColors request to the server and check + that the server sent nothing back. + input: + output: none + global input: + side effects: creates a window resource + writes to global reply_pixel + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* allocate a color and store pixel from reply in global */ + + req = (xResourceReq *) Make_Req(CLIENT, X_AllocNamedColor); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default AllocNamedColor request\n", CLIENT); + if ((alloc_reply = (xAllocNamedColorReply *) Expect_Reply(CLIENT, X_AllocNamedColor)) == NULL) { + Log_Err("client %d failed to receive AllocNamedColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocNamedColor reply\n", CLIENT); + } + reply_pixel = alloc_reply->pixel; + (void) Expect_Nothing(CLIENT); + + /* free the allocated color cell */ + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_FreeColors); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default FreeColors request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent FreeColors request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong FreeColors request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good C +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pFreeCursor/pFreeCursor.m b/xts5/Xproto/pFreeCursor/pFreeCursor.m new file mode 100644 index 00000000..5fd5d279 --- /dev/null +++ b/xts5/Xproto/pFreeCursor/pFreeCursor.m @@ -0,0 +1,241 @@ +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/Xproto/pFreeCursor/pFreeCursor.m,v 1.2 2005-11-03 08:44:07 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pFreeCursor/pFreeCursor.m +>># +>># Description: +>># Tests for FreeCursor +>># +>># Modifications: +>># $Log: frcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:44:07 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:56 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:31 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:09 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:02 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:33 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:20 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:14 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE FreeCursor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for FreeCursor request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Cursor_Pixmap(CLIENT); + (void) Create_Default_Cursor(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_FreeCursor); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default FreeCursor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent FreeCursor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong FreeCursor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pFreeGC/pFreeGC.m b/xts5/Xproto/pFreeGC/pFreeGC.m new file mode 100644 index 00000000..083da14c --- /dev/null +++ b/xts5/Xproto/pFreeGC/pFreeGC.m @@ -0,0 +1,240 @@ +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/Xproto/pFreeGC/pFreeGC.m,v 1.2 2005-11-03 08:44:07 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pFreeGC/pFreeGC.m +>># +>># Description: +>># Tests for FreeGC +>># +>># Modifications: +>># $Log: frgc.m,v $ +>># Revision 1.2 2005-11-03 08:44:07 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:57 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:32 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:11 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:03 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:34 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:22 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:18 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE FreeGC Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for FreeGC request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_FreeGC); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default FreeGC request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent FreeGC request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong FreeGC request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pFreePixmap/pFreePixmap.m b/xts5/Xproto/pFreePixmap/pFreePixmap.m new file mode 100644 index 00000000..4fbee113 --- /dev/null +++ b/xts5/Xproto/pFreePixmap/pFreePixmap.m @@ -0,0 +1,241 @@ +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/Xproto/pFreePixmap/pFreePixmap.m,v 1.2 2005-11-03 08:44:07 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pFreePixmap/pFreePixmap.m +>># +>># Description: +>># Tests for FreePixmap +>># +>># Modifications: +>># $Log: frpxmp.m,v $ +>># Revision 1.2 2005-11-03 08:44:07 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:57 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:33 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:12 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:03 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:35 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:24 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:20 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE FreePixmap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for FreePixmap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Pixmap Default_Pixmap; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Default_Pixmap = Create_Default_Pixmap(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_FreePixmap); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default FreePixmap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent FreePixmap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong FreePixmap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetAtomName/pGetAtomName.m b/xts5/Xproto/pGetAtomName/pGetAtomName.m new file mode 100644 index 00000000..f7d6d7c3 --- /dev/null +++ b/xts5/Xproto/pGetAtomName/pGetAtomName.m @@ -0,0 +1,247 @@ +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/Xproto/pGetAtomName/pGetAtomName.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetAtomName/pGetAtomName.m +>># +>># Description: +>># Tests for GetAtomName +>># +>># Modifications: +>># $Log: gtatmnm.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:36 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:18 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:37 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:32 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:32 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetAtomName Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetAtomName request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xGetAtomNameReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_GetAtomName); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetAtomName request\n", CLIENT); + if ((rep = (xGetAtomNameReply *) Expect_Reply(CLIENT, X_GetAtomName)) == NULL) { + Log_Err("client %d failed to receive GetAtomName reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetAtomName reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetAtomName request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetAtomName request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetFontPath/pGetFontPath.m b/xts5/Xproto/pGetFontPath/pGetFontPath.m new file mode 100644 index 00000000..ed10553b --- /dev/null +++ b/xts5/Xproto/pGetFontPath/pGetFontPath.m @@ -0,0 +1,247 @@ +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/Xproto/pGetFontPath/pGetFontPath.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetFontPath/pGetFontPath.m +>># +>># Description: +>># Tests for GetFontPath +>># +>># Modifications: +>># $Log: gtfntpth.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:36 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:19 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:06 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:38 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:33 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:34 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetFontPath Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetFontPath request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetFontPathReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetFontPath); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetFontPath request\n", CLIENT); + if ((rep = (xGetFontPathReply *) Expect_Reply(CLIENT, X_GetFontPath)) == NULL) { + Log_Err("client %d failed to receive GetFontPath reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetFontPath reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetFontPath request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetFontPath request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetGeometry/pGetGeometry.m b/xts5/Xproto/pGetGeometry/pGetGeometry.m new file mode 100644 index 00000000..63d28257 --- /dev/null +++ b/xts5/Xproto/pGetGeometry/pGetGeometry.m @@ -0,0 +1,249 @@ +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/Xproto/pGetGeometry/pGetGeometry.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetGeometry/pGetGeometry.m +>># +>># Description: +>># Tests for GetGeometry +>># +>># Modifications: +>># $Log: gtgmtry.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:37 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:19 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:07 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:38 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:34 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:36 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetGeometry Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetGeometry request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xGetGeometryReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_GetGeometry); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetGeometry request\n", CLIENT); + if ((rep = (xGetGeometryReply *) Expect_Reply(CLIENT, X_GetGeometry)) == NULL) { + Log_Err("client %d failed to receive GetGeometry reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetGeometry reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetGeometry request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetGeometry request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetImage/pGetImage.m b/xts5/Xproto/pGetImage/pGetImage.m new file mode 100644 index 00000000..28ce0937 --- /dev/null +++ b/xts5/Xproto/pGetImage/pGetImage.m @@ -0,0 +1,257 @@ +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/Xproto/pGetImage/pGetImage.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetImage/pGetImage.m +>># +>># Description: +>># Tests for GetImage +>># +>># Modifications: +>># $Log: gtimg.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:37 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:20 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:07 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:39 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:35 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:38 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetImage Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetImage request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyRectangleReq *prr; +xGetImageReq *req; +xGetImageReply *rep; + +static +void +tester() +{ + unsigned char *from; + unsigned char *to; + unsigned int len; + + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + prr = (xPolyRectangleReq *) Make_Req(CLIENT, X_PolyRectangle); + Send_Req(CLIENT, (xReq *) prr); + Log_Trace("client %d sent pixmap PolyRectangle request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + Set_Test_Type(CLIENT, test_type); + req = (xGetImageReq *) Make_Req(CLIENT, X_GetImage); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetImage request\n", CLIENT); + rep = (xGetImageReply *) Expect_Reply(CLIENT, X_GetImage); + (void) Expect_Nothing(CLIENT); + Free_Reply(rep); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetImage request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetImage request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetInputFocus/pGetInputFocus.m b/xts5/Xproto/pGetInputFocus/pGetInputFocus.m new file mode 100644 index 00000000..57bb97c9 --- /dev/null +++ b/xts5/Xproto/pGetInputFocus/pGetInputFocus.m @@ -0,0 +1,247 @@ +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/Xproto/pGetInputFocus/pGetInputFocus.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetInputFocus/pGetInputFocus.m +>># +>># Description: +>># Tests for GetInputFocus +>># +>># Modifications: +>># $Log: gtinptfcs.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:38 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:21 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:07 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:39 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:37 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:41 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetInputFocus Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetInputFocus request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetInputFocusReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetInputFocus); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetInputFocus request\n", CLIENT); + if ((rep = (xGetInputFocusReply *) Expect_Reply(CLIENT, X_GetInputFocus)) == NULL) { + Log_Err("client %d failed to receive GetInputFocus reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetInputFocus reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetInputFocus request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetInputFocus request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetKeyboardControl/pGetKeyboardControl.m b/xts5/Xproto/pGetKeyboardControl/pGetKeyboardControl.m new file mode 100644 index 00000000..124b8833 --- /dev/null +++ b/xts5/Xproto/pGetKeyboardControl/pGetKeyboardControl.m @@ -0,0 +1,247 @@ +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/Xproto/pGetKeyboardControl/pGetKeyboardControl.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetKeyboardControl/pGetKeyboardControl.m +>># +>># Description: +>># Tests for GetKeyboardControl +>># +>># Modifications: +>># $Log: gtkybrdcnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:38 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:22 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:08 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:40 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:38 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:43 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetKeyboardControl Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetKeyboardControl request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetKeyboardControlReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetKeyboardControl); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetKeyboardControl request\n", CLIENT); + if ((rep = (xGetKeyboardControlReply *) Expect_Reply(CLIENT, X_GetKeyboardControl)) == NULL) { + Log_Err("client %d failed to receive GetKeyboardControl reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetKeyboardControl reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetKeyboardControl request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetKeyboardControl request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetKeyboardMapping/pGetKeyboardMapping.m b/xts5/Xproto/pGetKeyboardMapping/pGetKeyboardMapping.m new file mode 100644 index 00000000..34f0301c --- /dev/null +++ b/xts5/Xproto/pGetKeyboardMapping/pGetKeyboardMapping.m @@ -0,0 +1,247 @@ +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/Xproto/pGetKeyboardMapping/pGetKeyboardMapping.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetKeyboardMapping/pGetKeyboardMapping.m +>># +>># Description: +>># Tests for GetKeyboardMapping +>># +>># Modifications: +>># $Log: gtkybrdmpp.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:39 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:23 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:08 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:40 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:39 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:45 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetKeyboardMapping Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetKeyboardMapping request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGetKeyboardMappingReq *req; +xGetKeyboardMappingReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xGetKeyboardMappingReq *) Make_Req(CLIENT, X_GetKeyboardMapping); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetKeyboardMapping request\n", CLIENT); + if ((rep = (xGetKeyboardMappingReply *) Expect_Reply(CLIENT, X_GetKeyboardMapping)) == NULL) { + Log_Err("client %d failed to receive GetKeyboardMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetKeyboardMapping reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetKeyboardMapping request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetKeyboardMapping request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetModifierMapping/pGetModifierMapping.m b/xts5/Xproto/pGetModifierMapping/pGetModifierMapping.m new file mode 100644 index 00000000..0ff1cc6f --- /dev/null +++ b/xts5/Xproto/pGetModifierMapping/pGetModifierMapping.m @@ -0,0 +1,247 @@ +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/Xproto/pGetModifierMapping/pGetModifierMapping.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetModifierMapping/pGetModifierMapping.m +>># +>># Description: +>># Tests for GetModifierMapping +>># +>># Modifications: +>># $Log: gtmdfrmppn.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:39 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:24 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:09 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:41 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:41 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:47 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetModifierMapping Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetModifierMapping request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetModifierMappingReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetModifierMapping); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetModifierMapping request\n", CLIENT); + if ((rep = (xGetModifierMappingReply *) Expect_Reply(CLIENT, X_GetModifierMapping)) == NULL) { + Log_Err("client %d failed to receive GetModifierMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetModifierMapping reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetModifierMapping request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetModifierMapping request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetMotionEvents/pGetMotionEvents.m b/xts5/Xproto/pGetMotionEvents/pGetMotionEvents.m new file mode 100644 index 00000000..17ef6663 --- /dev/null +++ b/xts5/Xproto/pGetMotionEvents/pGetMotionEvents.m @@ -0,0 +1,249 @@ +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/Xproto/pGetMotionEvents/pGetMotionEvents.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetMotionEvents/pGetMotionEvents.m +>># +>># Description: +>># Tests for GetMotionEvents +>># +>># Modifications: +>># $Log: gtmtnevnts.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:40 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:26 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:09 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:41 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:42 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:49 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetMotionEvents Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetMotionEvents request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGetMotionEventsReq *req; +xGetMotionEventsReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xGetMotionEventsReq *) Make_Req(CLIENT, X_GetMotionEvents); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetMotionEvents request\n", CLIENT); + if ((rep = (xGetMotionEventsReply *) Expect_Reply(CLIENT, X_GetMotionEvents)) == NULL) { + Log_Err("client %d failed to receive GetMotionEvents reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetMotionEvents reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetMotionEvents request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetMotionEvents request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetPointerControl/pGetPointerControl.m b/xts5/Xproto/pGetPointerControl/pGetPointerControl.m new file mode 100644 index 00000000..163ae95c --- /dev/null +++ b/xts5/Xproto/pGetPointerControl/pGetPointerControl.m @@ -0,0 +1,247 @@ +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/Xproto/pGetPointerControl/pGetPointerControl.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetPointerControl/pGetPointerControl.m +>># +>># Description: +>># Tests for GetPointerControl +>># +>># Modifications: +>># $Log: gtpntrcntr.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:41 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:27 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:10 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:41 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:43 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:51 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetPointerControl Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetPointerControl request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetPointerControlReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetPointerControl); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetPointerControl request\n", CLIENT); + if ((rep = (xGetPointerControlReply *) Expect_Reply(CLIENT, X_GetPointerControl)) == NULL) { + Log_Err("client %d failed to receive GetPointerControl reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetPointerControl reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetPointerControl request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetPointerControl request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetPointerMapping/pGetPointerMapping.m b/xts5/Xproto/pGetPointerMapping/pGetPointerMapping.m new file mode 100644 index 00000000..e7184ed1 --- /dev/null +++ b/xts5/Xproto/pGetPointerMapping/pGetPointerMapping.m @@ -0,0 +1,247 @@ +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/Xproto/pGetPointerMapping/pGetPointerMapping.m,v 1.2 2005-11-03 08:44:09 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetPointerMapping/pGetPointerMapping.m +>># +>># Description: +>># Tests for GetPointerMapping +>># +>># Modifications: +>># $Log: gtpntrmppn.m,v $ +>># Revision 1.2 2005-11-03 08:44:09 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:41 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:28 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:10 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:42 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:45 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:54 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetPointerMapping Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetPointerMapping request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetPointerMappingReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetPointerMapping); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetPointerMapping request\n", CLIENT); + if ((rep = (xGetPointerMappingReply *) Expect_Reply(CLIENT, X_GetPointerMapping)) == NULL) { + Log_Err("client %d failed to receive GetPointerMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetPointerMapping reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetPointerMapping request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetPointerMapping request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetProperty/pGetProperty.m b/xts5/Xproto/pGetProperty/pGetProperty.m new file mode 100644 index 00000000..6d8d657a --- /dev/null +++ b/xts5/Xproto/pGetProperty/pGetProperty.m @@ -0,0 +1,260 @@ +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/Xproto/pGetProperty/pGetProperty.m,v 1.2 2005-11-03 08:44:10 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetProperty/pGetProperty.m +>># +>># Description: +>># Tests for GetProperty +>># +>># Modifications: +>># $Log: gtprprty.m,v $ +>># Revision 1.2 2005-11-03 08:44:10 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:42 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:29 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:11 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:43 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:46 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:56 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetProperty Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetProperty request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Atom Test_Property; +xChangePropertyReq *cpr; +xGetPropertyReq *req; +xGetPropertyReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Test_Property = Create_Default_Atom(CLIENT); + + cpr = (xChangePropertyReq *) Make_Req(CLIENT, X_ChangeProperty); + cpr->property = Test_Property; + Send_Req(CLIENT, (xReq *) cpr); + Log_Trace("client %d sent default ChangeProperty request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cpr); + + Set_Test_Type(CLIENT, test_type); + req = (xGetPropertyReq *) Make_Req(CLIENT, X_GetProperty); + req->property = Test_Property; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetProperty request\n", CLIENT); + if ((rep = (xGetPropertyReply *) Expect_Reply(CLIENT, X_GetProperty)) == NULL) { + Log_Err("client %d failed to receive GetProperty reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetProperty reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetProperty request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetProperty request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetScreenSaver/pGetScreenSaver.m b/xts5/Xproto/pGetScreenSaver/pGetScreenSaver.m new file mode 100644 index 00000000..65d9401d --- /dev/null +++ b/xts5/Xproto/pGetScreenSaver/pGetScreenSaver.m @@ -0,0 +1,247 @@ +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/Xproto/pGetScreenSaver/pGetScreenSaver.m,v 1.2 2005-11-03 08:44:10 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetScreenSaver/pGetScreenSaver.m +>># +>># Description: +>># Tests for GetScreenSaver +>># +>># Modifications: +>># $Log: gtscrnsvr.m,v $ +>># Revision 1.2 2005-11-03 08:44:10 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:42 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:30 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:11 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:43 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:47 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:58 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetScreenSaver Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetScreenSaver request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xGetScreenSaverReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GetScreenSaver); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetScreenSaver request\n", CLIENT); + if ((rep = (xGetScreenSaverReply *) Expect_Reply(CLIENT, X_GetScreenSaver)) == NULL) { + Log_Err("client %d failed to receive GetScreenSaver reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetScreenSaver reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetScreenSaver request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetScreenSaver request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetSelectionOwner/pGetSelectionOwner.m b/xts5/Xproto/pGetSelectionOwner/pGetSelectionOwner.m new file mode 100644 index 00000000..2dc1be77 --- /dev/null +++ b/xts5/Xproto/pGetSelectionOwner/pGetSelectionOwner.m @@ -0,0 +1,257 @@ +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/Xproto/pGetSelectionOwner/pGetSelectionOwner.m,v 1.2 2005-11-03 08:44:10 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetSelectionOwner/pGetSelectionOwner.m +>># +>># Description: +>># Tests for GetSelectionOwner +>># +>># Modifications: +>># $Log: gtslctnown.m,v $ +>># Revision 1.2 2005-11-03 08:44:10 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:43 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:31 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:12 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:44 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:49 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:00 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetSelectionOwner Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetSelectionOwner request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Atom Test_Property; +xResourceReq *req; +xSetSelectionOwnerReq *ssor; +xGetSelectionOwnerReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Test_Property = Create_Default_Atom(CLIENT); + + ssor = (xSetSelectionOwnerReq *) Make_Req(CLIENT, X_SetSelectionOwner); + Send_Req(CLIENT, (xReq *) ssor); + Log_Trace("client %d sent default SetSelectionOwner request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(ssor); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_GetSelectionOwner); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetSelectionOwner request\n", CLIENT); + if ((rep = (xGetSelectionOwnerReply *) Expect_Reply(CLIENT, X_GetSelectionOwner)) == NULL) { + Log_Err("client %d failed to receive GetSelectionOwner reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetSelectionOwner reply\n", CLIENT); + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetSelectionOwner request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetSelectionOwner request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGetWindowAttributes/pGetWindowAttributes.m b/xts5/Xproto/pGetWindowAttributes/pGetWindowAttributes.m new file mode 100644 index 00000000..d7999541 --- /dev/null +++ b/xts5/Xproto/pGetWindowAttributes/pGetWindowAttributes.m @@ -0,0 +1,249 @@ +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/Xproto/pGetWindowAttributes/pGetWindowAttributes.m,v 1.2 2005-11-03 08:44:10 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGetWindowAttributes/pGetWindowAttributes.m +>># +>># Description: +>># Tests for GetWindowAttributes +>># +>># Modifications: +>># $Log: gtwdwattrb.m,v $ +>># Revision 1.2 2005-11-03 08:44:10 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:43 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:32 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:12 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:44 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:50 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:02 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GetWindowAttributes Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GetWindowAttributes request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xGetWindowAttributesReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_GetWindowAttributes); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GetWindowAttributes request\n", CLIENT); + if ((rep = (xGetWindowAttributesReply *) Expect_Reply(CLIENT, X_GetWindowAttributes)) == NULL) { + Log_Err("client %d failed to receive GetWindowAttributes reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetWindowAttributes reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GetWindowAttributes request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GetWindowAttributes request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGrabButton/pGrabButton.m b/xts5/Xproto/pGrabButton/pGrabButton.m new file mode 100644 index 00000000..d91e0357 --- /dev/null +++ b/xts5/Xproto/pGrabButton/pGrabButton.m @@ -0,0 +1,239 @@ +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/Xproto/pGrabButton/pGrabButton.m,v 1.2 2005-11-03 08:44:07 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGrabButton/pGrabButton.m +>># +>># Description: +>># Tests for GrabButton +>># +>># Modifications: +>># $Log: grbbttn.m,v $ +>># Revision 1.2 2005-11-03 08:44:07 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:58 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:33 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:13 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:04 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:35 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:25 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:22 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GrabButton Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GrabButton request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabButtonReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xGrabButtonReq *) Make_Req(CLIENT, X_GrabButton); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GrabButton request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GrabButton request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GrabButton request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGrabKey/pGrabKey.m b/xts5/Xproto/pGrabKey/pGrabKey.m new file mode 100644 index 00000000..f87e9ceb --- /dev/null +++ b/xts5/Xproto/pGrabKey/pGrabKey.m @@ -0,0 +1,239 @@ +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/Xproto/pGrabKey/pGrabKey.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGrabKey/pGrabKey.m +>># +>># Description: +>># Tests for GrabKey +>># +>># Modifications: +>># $Log: grbky.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:58 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:34 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:14 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:04 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:35 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:26 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:24 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GrabKey Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GrabKey request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabKeyReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xGrabKeyReq *) Make_Req(CLIENT, X_GrabKey); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GrabKey request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GrabKey request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GrabKey request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGrabKeyboard/pGrabKeyboard.m b/xts5/Xproto/pGrabKeyboard/pGrabKeyboard.m new file mode 100644 index 00000000..b2bc4db6 --- /dev/null +++ b/xts5/Xproto/pGrabKeyboard/pGrabKeyboard.m @@ -0,0 +1,249 @@ +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/Xproto/pGrabKeyboard/pGrabKeyboard.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGrabKeyboard/pGrabKeyboard.m +>># +>># Description: +>># Tests for GrabKeyboard +>># +>># Modifications: +>># $Log: grbkybrd.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:58 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:34 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:15 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:04 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:36 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:27 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:26 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GrabKeyboard Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GrabKeyboard request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabKeyboardReq *req; +xGrabKeyboardReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xGrabKeyboardReq *) Make_Req(CLIENT, X_GrabKeyboard); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GrabKeyboard request\n", CLIENT); + if ((rep = (xGrabKeyboardReply *) Expect_Reply(CLIENT, X_GrabKeyboard)) == NULL) { + Log_Err("client %d failed to receive GrabKeyboard reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GrabKeyboard reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GrabKeyboard request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GrabKeyboard request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGrabPointer/pGrabPointer.m b/xts5/Xproto/pGrabPointer/pGrabPointer.m new file mode 100644 index 00000000..65bb58b8 --- /dev/null +++ b/xts5/Xproto/pGrabPointer/pGrabPointer.m @@ -0,0 +1,249 @@ +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/Xproto/pGrabPointer/pGrabPointer.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGrabPointer/pGrabPointer.m +>># +>># Description: +>># Tests for GrabPointer +>># +>># Modifications: +>># $Log: grbpntr.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:58 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:35 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:16 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:05 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:36 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:29 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:28 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GrabPointer Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GrabPointer request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabPointerReq *req; +xGrabPointerReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xGrabPointerReq *) Make_Req(CLIENT, X_GrabPointer); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GrabPointer request\n", CLIENT); + if ((rep = (xGrabPointerReply *) Expect_Reply(CLIENT, X_GrabPointer)) == NULL) { + Log_Err("client %d failed to receive GrabPointer reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GrabPointer reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GrabPointer request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GrabPointer request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pGrabServer/pGrabServer.m b/xts5/Xproto/pGrabServer/pGrabServer.m new file mode 100644 index 00000000..4e6ec842 --- /dev/null +++ b/xts5/Xproto/pGrabServer/pGrabServer.m @@ -0,0 +1,239 @@ +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/Xproto/pGrabServer/pGrabServer.m,v 1.2 2005-11-03 08:44:08 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pGrabServer/pGrabServer.m +>># +>># Description: +>># Tests for GrabServer +>># +>># Modifications: +>># $Log: grbsrvr.m,v $ +>># Revision 1.2 2005-11-03 08:44:08 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:35 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:17 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:05 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:37 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:30 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:04:30 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE GrabServer Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for GrabServer request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_GrabServer); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default GrabServer request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent GrabServer request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong GrabServer request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pImageText16/pImageText16.m b/xts5/Xproto/pImageText16/pImageText16.m new file mode 100644 index 00000000..29e0e5c9 --- /dev/null +++ b/xts5/Xproto/pImageText16/pImageText16.m @@ -0,0 +1,279 @@ +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/Xproto/pImageText16/pImageText16.m,v 1.2 2005-11-03 08:44:10 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pImageText16/pImageText16.m +>># +>># Description: +>># Tests for ImageText16 +>># +>># Modifications: +>># $Log: imgtxt16.m,v $ +>># Revision 1.2 2005-11-03 08:44:10 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:44 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:33 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:13 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:45 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:52 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:04 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ImageText16 Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for ImageText16 request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xImageText16Req *req; +xCreateGCReq *gc_req; +xOpenFontReq *font_req; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + + /* open the xtfont2 font to get its resource id for GContext */ + + font_req = (xOpenFontReq *) Make_Req(CLIENT, X_OpenFont); + font_req = (xOpenFontReq *) Clear_Counted_Value (font_req); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'x'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 't'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'f'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'o'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'n'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 't'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, '2'); + Send_Req(CLIENT, (xReq *) font_req); + Log_Trace("client %d sent default OpenFont request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + + /* create a default GContext with xtfont2 as the font */ + + gc_req = (xCreateGCReq *) Make_Req (CLIENT, X_CreateGC); + gc_req = (xCreateGCReq *) Add_Masked_Value (gc_req, GCFont, font_req->fid); + Send_Req (CLIENT, (xReq *) gc_req); + Log_Trace ("client %d sent CreateGC request\n", CLIENT); + Expect_Nothing (CLIENT); + Set_Default_GContext (CLIENT, gc_req->gc); + Free_Req (gc_req); + Free_Req (font_req); + + /* map window, send ImageText16 request, and check results visually */ + + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xImageText16Req *) Make_Req(CLIENT, X_ImageText16); + + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ImageText16 request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ImageText16 request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ImageText16 request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length +accepted by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + greater than that accepted by the X server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + greater than that accepted by the X server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pImageText8/pImageText8.m b/xts5/Xproto/pImageText8/pImageText8.m new file mode 100644 index 00000000..3a100b54 --- /dev/null +++ b/xts5/Xproto/pImageText8/pImageText8.m @@ -0,0 +1,243 @@ +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/Xproto/pImageText8/pImageText8.m,v 1.2 2005-11-03 08:44:11 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pImageText8/pImageText8.m +>># +>># Description: +>># Tests for ImageText8 +>># +>># Modifications: +>># $Log: imgtxt8.m,v $ +>># Revision 1.2 2005-11-03 08:44:11 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:44 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:34 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:13 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:45 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:53 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:06 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ImageText8 Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ImageText8 request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xImageText8Req *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xImageText8Req *) Make_Req(CLIENT, X_ImageText8); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ImageText8 request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ImageText8 request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ImageText8 request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pInstallColormap/pInstallColormap.m b/xts5/Xproto/pInstallColormap/pInstallColormap.m new file mode 100644 index 00000000..771f89df --- /dev/null +++ b/xts5/Xproto/pInstallColormap/pInstallColormap.m @@ -0,0 +1,275 @@ +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/Xproto/pInstallColormap/pInstallColormap.m,v 1.2 2005-11-03 08:44:11 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pInstallColormap/pInstallColormap.m +>># +>># Description: +>># Tests for InstallColormap +>># +>># Modifications: +>># $Log: instllclrm.m,v $ +>># Revision 1.2 2005-11-03 08:44:11 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:45 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:35 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:14 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:46 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:54 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:09 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE InstallColormap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for InstallColormap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorCellsReply *reply; + +/* + intent: send a InstallColormap request to the server and check + that nothing was sent back. + input: + output: none + global input: + side effects: creates a window resource. + installs a color map. + methods: +*/ + +static +void +tester() +{ + + + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* Allocate color cells if client hasn't got any */ + + if (Allocatable (CLIENT)) { + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorCells); + Send_Req(CLIENT, (xReq *) req); + if ((reply = (xAllocColorCellsReply *) Expect_Reply(CLIENT, X_AllocColorCells)) == NULL) { + Log_Err("client %d failed to receive AllocColorCells reply\n", CLIENT); + Exit(); + } + else { + Log_Trace("client %d received AllocColorCells reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(reply); + } + Free_Req(req); + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_InstallColormap); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default InstallColormap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent InstallColormap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong InstallColormap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pInternAtom/pInternAtom.m b/xts5/Xproto/pInternAtom/pInternAtom.m new file mode 100644 index 00000000..d61e2c7c --- /dev/null +++ b/xts5/Xproto/pInternAtom/pInternAtom.m @@ -0,0 +1,247 @@ +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/Xproto/pInternAtom/pInternAtom.m,v 1.2 2005-11-03 08:44:11 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pInternAtom/pInternAtom.m +>># +>># Description: +>># Tests for InternAtom +>># +>># Modifications: +>># $Log: intrnatm.m,v $ +>># Revision 1.2 2005-11-03 08:44:11 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:05:59 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:45 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:36 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:14 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:46 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:56 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:11 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE InternAtom Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for InternAtom request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xInternAtomReq *req; +xInternAtomReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xInternAtomReq *) Make_Req(CLIENT, X_InternAtom); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default InternAtom request\n", CLIENT); + if ((rep = (xInternAtomReply *) Expect_Reply(CLIENT, X_InternAtom)) == NULL) { + Log_Err("client %d failed to receive InternAtom reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received InternAtom reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent InternAtom request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong InternAtom request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pKillClient/pKillClient.m b/xts5/Xproto/pKillClient/pKillClient.m new file mode 100644 index 00000000..6bad55fd --- /dev/null +++ b/xts5/Xproto/pKillClient/pKillClient.m @@ -0,0 +1,248 @@ +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/Xproto/pKillClient/pKillClient.m,v 1.2 2005-11-03 08:44:11 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pKillClient/pKillClient.m +>># +>># Description: +>># Tests for KillClient() +>># +>># Modifications: +>># $Log: kllclnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:11 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:46 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:37 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:15 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:46 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:57 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:13 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE KillClient Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for KillClient request */ + +#include "Xstlib.h" + +#define VICTIM 0 +#define CLIENT 1 +static TestType test_type = SETUP; +Window win; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(VICTIM); + Create_Client(CLIENT); + + win = Create_Default_Window(VICTIM); + (void) Create_Default_GContext(VICTIM); + + /* We can't send anything on the VICTIM client to see if it's + really been killed. If we do, the library will see "Connection + reset by peer" and blow off the test. */ + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_KillClient); + req->id = win; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default KillClient request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent KillClient request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong KillClient request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pListExtensions/pListExtensions.m b/xts5/Xproto/pListExtensions/pListExtensions.m new file mode 100644 index 00000000..48198eb4 --- /dev/null +++ b/xts5/Xproto/pListExtensions/pListExtensions.m @@ -0,0 +1,247 @@ +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/Xproto/pListExtensions/pListExtensions.m,v 1.2 2005-11-03 08:44:12 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pListExtensions/pListExtensions.m +>># +>># Description: +>># Tests for ListExtensions +>># +>># Modifications: +>># $Log: lstextnsns.m,v $ +>># Revision 1.2 2005-11-03 08:44:12 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:47 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:39 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:15 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:47 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:00 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:17 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ListExtensions Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ListExtensions request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xListExtensionsReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_ListExtensions); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ListExtensions request\n", CLIENT); + if ((rep = (xListExtensionsReply *) Expect_Reply(CLIENT, X_ListExtensions)) == NULL) { + Log_Err("client %d failed to receive ListExtensions reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListExtensions reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ListExtensions request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ListExtensions request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pListFonts/pListFonts.m b/xts5/Xproto/pListFonts/pListFonts.m new file mode 100644 index 00000000..bc24c1fa --- /dev/null +++ b/xts5/Xproto/pListFonts/pListFonts.m @@ -0,0 +1,247 @@ +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/Xproto/pListFonts/pListFonts.m,v 1.2 2005-11-03 08:44:12 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pListFonts/pListFonts.m +>># +>># Description: +>># Tests for ListFonts +>># +>># Modifications: +>># $Log: lstfnts.m,v $ +>># Revision 1.2 2005-11-03 08:44:12 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:48 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:41 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:16 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:48 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:01 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:19 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ListFonts Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ListFonts request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xListFontsReq *req; +xListFontsReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xListFontsReq *) Make_Req(CLIENT, X_ListFonts); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ListFonts request\n", CLIENT); + if ((rep = (xListFontsReply *) Expect_Reply(CLIENT, X_ListFonts)) == NULL) { + Log_Err("client %d failed to receive ListFonts reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListFonts reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ListFonts request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ListFonts request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pListFontsWithInfo/pListFontsWithInfo.m b/xts5/Xproto/pListFontsWithInfo/pListFontsWithInfo.m new file mode 100644 index 00000000..0c7fc10b --- /dev/null +++ b/xts5/Xproto/pListFontsWithInfo/pListFontsWithInfo.m @@ -0,0 +1,258 @@ +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/Xproto/pListFontsWithInfo/pListFontsWithInfo.m,v 1.2 2005-11-03 08:44:12 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pListFontsWithInfo/pListFontsWithInfo.m +>># +>># Description: +>># Tests for ListFontsWithInfo +>># +>># Modifications: +>># $Log: lstfntswth.m,v $ +>># Revision 1.2 2005-11-03 08:44:12 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:48 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:41 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:16 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:48 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:03 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:22 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ListFontsWithInfo Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ListFontsWithInfo request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xCreateWindowReq *cwr; +xListFontsWithInfoReq *req; +xListFontsWithInfoReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xListFontsWithInfoReq *) Make_Req(CLIENT, X_ListFontsWithInfo); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ListFontsWithInfo request\n", CLIENT); + if ((rep = (xListFontsWithInfoReply *) Expect_Reply(CLIENT, X_ListFontsWithInfo)) == NULL) { + Log_Err("client %d failed to receive ListFontsWithInfo reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListFontsWithInfo reply\n", CLIENT); + /* do any reply checking here */ + } + while (rep->nameLength != 0) { + Free_Reply(rep); + if ((rep = (xListFontsWithInfoReply *) Expect_Reply(CLIENT, X_ListFontsWithInfo)) == NULL) { + Log_Err("client %d failed to receive ListFontsWithInfo reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListFontsWithInfo reply\n", CLIENT); + /* do any reply checking here */ + } + } + Free_Reply(rep); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ListFontsWithInfo request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ListFontsWithInfo request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back replies to the client +until a reply with a zero length name is returned. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pListHosts/pListHosts.m b/xts5/Xproto/pListHosts/pListHosts.m new file mode 100644 index 00000000..8797e9ba --- /dev/null +++ b/xts5/Xproto/pListHosts/pListHosts.m @@ -0,0 +1,247 @@ +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/Xproto/pListHosts/pListHosts.m,v 1.2 2005-11-03 08:44:12 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pListHosts/pListHosts.m +>># +>># Description: +>># Tests for ListHosts +>># +>># Modifications: +>># $Log: lsthsts.m,v $ +>># Revision 1.2 2005-11-03 08:44:12 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:49 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:42 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:17 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:49 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:04 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:25 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ListHosts Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ListHosts request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xListHostsReq *req; +xListHostsReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xListHostsReq *) Make_Req(CLIENT, X_ListHosts); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ListHosts request\n", CLIENT); + if ((rep = (xListHostsReply *) Expect_Reply(CLIENT, X_ListHosts)) == NULL) { + Log_Err("client %d failed to receive ListHosts reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListHosts reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ListHosts request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ListHosts request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pListInstalledColormaps/pListInstalledColormaps.m b/xts5/Xproto/pListInstalledColormaps/pListInstalledColormaps.m new file mode 100644 index 00000000..2aa5196b --- /dev/null +++ b/xts5/Xproto/pListInstalledColormaps/pListInstalledColormaps.m @@ -0,0 +1,261 @@ +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/Xproto/pListInstalledColormaps/pListInstalledColormaps.m,v 1.2 2005-11-03 08:44:12 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pListInstalledColormaps/pListInstalledColormaps.m +>># +>># Description: +>># Tests for ListInstalledColormaps +>># +>># Modifications: +>># $Log: lstinstlld.m,v $ +>># Revision 1.2 2005-11-03 08:44:12 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:49 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:43 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:17 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:49 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:06 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:27 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ListInstalledColormaps Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ListInstalledColormaps request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xListInstalledColormapsReply *reply; + +/* + intent: send a ListInstalledColormaps request to the server and check + that the server sent a ListInstalledColormaps reply back. + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + + + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_ListInstalledColormaps); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ListInstalledColormaps request\n", CLIENT); + if ((reply = (xListInstalledColormapsReply *) Expect_Reply(CLIENT, X_ListInstalledColormaps)) == NULL) { + Log_Err("client %d failed to receive ListInstalledColormaps reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListInstalledColormaps reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(reply); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ListInstalledColormaps request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ListInstalledColormaps request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pListProperties/pListProperties.m b/xts5/Xproto/pListProperties/pListProperties.m new file mode 100644 index 00000000..2e9ea034 --- /dev/null +++ b/xts5/Xproto/pListProperties/pListProperties.m @@ -0,0 +1,249 @@ +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/Xproto/pListProperties/pListProperties.m,v 1.2 2005-11-03 08:44:13 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pListProperties/pListProperties.m +>># +>># Description: +>># Tests for ListProperties +>># +>># Modifications: +>># $Log: lstprprts.m,v $ +>># Revision 1.2 2005-11-03 08:44:13 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:50 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:44 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:18 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:50 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:07 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:29 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ListProperties Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ListProperties request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xListPropertiesReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_ListProperties); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ListProperties request\n", CLIENT); + if ((rep = (xListPropertiesReply *) Expect_Reply(CLIENT, X_ListProperties)) == NULL) { + Log_Err("client %d failed to receive ListProperties reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ListProperties reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ListProperties request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ListProperties request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pLookupColor/pLookupColor.m b/xts5/Xproto/pLookupColor/pLookupColor.m new file mode 100644 index 00000000..4ecf8404 --- /dev/null +++ b/xts5/Xproto/pLookupColor/pLookupColor.m @@ -0,0 +1,259 @@ +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/Xproto/pLookupColor/pLookupColor.m,v 1.2 2005-11-03 08:44:11 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pLookupColor/pLookupColor.m +>># +>># Description: +>># Tests for LookupColor +>># +>># Modifications: +>># $Log: lkpclr.m,v $ +>># Revision 1.2 2005-11-03 08:44:11 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:46 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:38 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:15 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:47 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:05:59 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:15 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE LookupColor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for LookupColor request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xLookupColorReply *rep; + +/* + intent: send a LookupColor request to the server and check + that the server sent a reply back + input: + output: none + global input: + side effects: creates a window resource + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_LookupColor); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default LookupColor request\n", CLIENT); + if ((rep = (xLookupColorReply *) Expect_Reply(CLIENT, X_LookupColor)) == NULL) { + Log_Err("client %d failed to receive LookupColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received LookupColor reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent LookupColor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong LookupColor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pMapSubwindows/pMapSubwindows.m b/xts5/Xproto/pMapSubwindows/pMapSubwindows.m new file mode 100644 index 00000000..b361d7ce --- /dev/null +++ b/xts5/Xproto/pMapSubwindows/pMapSubwindows.m @@ -0,0 +1,252 @@ +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/Xproto/pMapSubwindows/pMapSubwindows.m,v 1.2 2005-11-03 08:44:13 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pMapSubwindows/pMapSubwindows.m +>># +>># Description: +>># Tests for MapSubwindows +>># +>># Modifications: +>># $Log: mpsbws.m,v $ +>># Revision 1.2 2005-11-03 08:44:13 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:50 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:45 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:18 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:50 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:08 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:32 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE MapSubwindows Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for MapSubwindows request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xCreateWindowReq *cwr; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + cwr->parent = Default_Window; + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent additional CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cwr); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_MapSubwindows); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default MapSubwindows request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent MapSubwindows request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong MapSubwindows request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the parent window is not mapped, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pMapWindow/pMapWindow.m b/xts5/Xproto/pMapWindow/pMapWindow.m new file mode 100644 index 00000000..c85239e5 --- /dev/null +++ b/xts5/Xproto/pMapWindow/pMapWindow.m @@ -0,0 +1,249 @@ +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/Xproto/pMapWindow/pMapWindow.m,v 1.2 2005-11-03 08:44:13 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pMapWindow/pMapWindow.m +>># +>># Description: +>># Tests for MapWindow +>># +>># Modifications: +>># $Log: mpwdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:13 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:51 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:45 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:19 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:51 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:09 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:34 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE MapWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for MapWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_MapWindow); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default MapWindow request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, Expose)) == NULL) { + Log_Err("client %d failed to receive Expose\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received Expose\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent MapWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong MapWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and backing store has not been maintained while the window was unmapped, +then the X server sends back an Expose event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an Expose event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an Expose event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pNoOperation/pNoOperation.m b/xts5/Xproto/pNoOperation/pNoOperation.m new file mode 100644 index 00000000..28dca8cd --- /dev/null +++ b/xts5/Xproto/pNoOperation/pNoOperation.m @@ -0,0 +1,253 @@ +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/Xproto/pNoOperation/pNoOperation.m,v 1.2 2005-11-03 08:44:13 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pNoOperation/pNoOperation.m +>># +>># Description: +>># Tests for NoOperation +>># +>># Modifications: +>># $Log: noprtn.m,v $ +>># Revision 1.2 2005-11-03 08:44:13 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:51 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:46 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:19 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:51 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:11 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:36 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE NoOperation Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for NoOperation request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_NoOperation); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default NoOperation request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent NoOperation request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case JUST_TOO_LONG: + /* special for NoOperation, excess bytes allowed and ignored */ + Log_Trace("client %d sent excess length NoOperation request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + Log_Trace("client %d sent overlong NoOperation request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Good A +>># N.B. NoOperation is special: length can be >= minimum (1 word). +When a client sends a valid xname protocol request to the X server, +in which the length field of the request is greater than the minimum length +required to contain the request but +does not exceed the maximum length accepted +by the X server, +then the X server does not send back an error, event or reply to the client. +>># N.B. NoOperation is special: length can be >= minimum (1 word). +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is less than the minimum length +required to contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pOpenDisplay/pOpenDisplay.m b/xts5/Xproto/pOpenDisplay/pOpenDisplay.m new file mode 100644 index 00000000..a94dce48 --- /dev/null +++ b/xts5/Xproto/pOpenDisplay/pOpenDisplay.m @@ -0,0 +1,205 @@ +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/Xproto/pOpenDisplay/pOpenDisplay.m,v 1.2 2005-11-03 08:44:13 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pOpenDisplay/pOpenDisplay.m +>># +>># Description: +>># Tests for OpenDisplay +>># +>># Modifications: +>># $Log: opndsply.m,v $ +>># Revision 1.2 2005-11-03 08:44:13 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:52 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:48 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:20 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:52 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:12 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:38 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE OpenDisplay Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for OpenDisplay request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; + +/* + intent: send an OpenDisplay request to the server and check + that the server sent an OpenDisplay reply back + input: + output: none + global input: + side effects: + methods: +*/ + +static +void +tester() +{ + int status = Create_Client_Tested(CLIENT, test_type); + + if(!status) { + switch(test_type) { + case OPEN_DISPLAY: + Log_Err("Expected connection to fail, but it didn't"); + break; + default: + Log_Err("Expected connection not to fail, but it did"); + break; + } + Exit(); + } + + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a valid authorisation-accepted +reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a valid authorisation-accepted reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a valid authorisation-accepted reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +>># Assertion changed, 11th March 1992, to expect other than valid +>># auth.-accepted reply. It's wrong to expect a valid auth.-fail +>># reply as if byte order unknown then the 2-byte major & minor +>># protocol versions can't be sent properly: client byte-sex is +>># unknown to the server. We therefore will accept anything but +>># a valid reply: nothing; connection closed or reply with first +>># byte False (0). See bug report 0223. +>># This was not noticed at initial assertion review time. +When a client sends an invalid xname protocol request to the X server, +in which the +.M byte_order +is not 0x42 or 0x6C, +then the X server does not +send back a valid authorisation-accepted reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server. +Send an invalid xname protocol request to the X server with byte_order + other than 0x42 (and not 0x6C, either). +Verify that the X server does not send back a valid authorisation-accepted reply. +Open a connection to the X server. +Send an invalid xname protocol request to the X server with byte_order + other than 0x6C (and not 0x42, either). +Verify that the X server does not send back a valid authorisation-accepted reply. +>>CODE + + test_type = OPEN_DISPLAY; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pOpenFont/pOpenFont.m b/xts5/Xproto/pOpenFont/pOpenFont.m new file mode 100644 index 00000000..7c9aa496 --- /dev/null +++ b/xts5/Xproto/pOpenFont/pOpenFont.m @@ -0,0 +1,305 @@ +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/Xproto/pOpenFont/pOpenFont.m,v 1.2 2005-11-03 08:44:13 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pOpenFont/pOpenFont.m +>># +>># Description: +>># Tests for OpenFont +>># +>># Modifications: +>># $Log: opnfnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:13 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:52 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:49 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:20 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:52 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:14 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:41 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE OpenFont Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for OpenFont request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xOpenFontReq *req; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xOpenFontReq *) Make_Req(CLIENT, X_OpenFont); + if(test_type == BAD_IDCHOICE1) { + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent OpenFont request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + } + if(test_type == BAD_IDCHOICE2) { + req->fid = 0xffffffff; /* top 2 bits set ==> invalid */ + } + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default OpenFont request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE1: + Log_Trace("client %d sent OpenFont request with same resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_IDCHOICE2: + Log_Trace("client %d sent OpenFont request with out-of-range resource ID\n", CLIENT); + (void) Expect_BadIDChoice(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent OpenFont request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong OpenFont request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is already in use, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request with identical resource ID + to the X server. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE1; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the resource ID is outside the range assigned to the client, +then the X server sends back a BadIDChoice error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Send an invalid xname protocol request to the X server with a resource ID + outside the range assigned to the client. +Verify that the X server sends back a BadIDChoice error. +>>CODE + + test_type = BAD_IDCHOICE2; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyArc/pPolyArc.m b/xts5/Xproto/pPolyArc/pPolyArc.m new file mode 100644 index 00000000..9be88563 --- /dev/null +++ b/xts5/Xproto/pPolyArc/pPolyArc.m @@ -0,0 +1,244 @@ +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/Xproto/pPolyArc/pPolyArc.m,v 1.2 2005-11-03 08:44:14 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyArc/pPolyArc.m +>># +>># Description: +>># Tests for PolyArc +>># +>># Modifications: +>># $Log: plyarc.m,v $ +>># Revision 1.2 2005-11-03 08:44:14 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:53 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:50 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:20 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:53 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:15 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:43 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyArc Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyArc request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyArcReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyArcReq *) Make_Req(CLIENT, X_PolyArc); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyArc request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyArc request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyArc request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request +plus zero or more arcs, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero arcs. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero arcs. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n arcs. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n arcs. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum + n arcs */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length +accepted by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + greater than that accepted by the X server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + greater than that accepted by the X server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyFillArc/pPolyFillArc.m b/xts5/Xproto/pPolyFillArc/pPolyFillArc.m new file mode 100644 index 00000000..bc77e0e9 --- /dev/null +++ b/xts5/Xproto/pPolyFillArc/pPolyFillArc.m @@ -0,0 +1,244 @@ +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/Xproto/pPolyFillArc/pPolyFillArc.m,v 1.2 2005-11-03 08:44:14 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyFillArc/pPolyFillArc.m +>># +>># Description: +>># Tests for PolyFillArc +>># +>># Modifications: +>># $Log: plyfllarc.m,v $ +>># Revision 1.2 2005-11-03 08:44:14 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:53 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:51 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:21 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:53 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:17 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:46 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyFillArc Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyFillArc request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyFillArcReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyFillArcReq *) Make_Req(CLIENT, X_PolyFillArc); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyFillArc request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyFillArc request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyFillArc request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request +plus zero or more arcs, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero arcs. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero arcs. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n arcs. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n arcs. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum + n arcs */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyFillRectangle/pPolyFillRectangle.m b/xts5/Xproto/pPolyFillRectangle/pPolyFillRectangle.m new file mode 100644 index 00000000..8e517bbf --- /dev/null +++ b/xts5/Xproto/pPolyFillRectangle/pPolyFillRectangle.m @@ -0,0 +1,243 @@ +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/Xproto/pPolyFillRectangle/pPolyFillRectangle.m,v 1.2 2005-11-03 08:44:14 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyFillRectangle/pPolyFillRectangle.m +>># +>># Description: +>># Tests for PolyFillRectangle +>># +>># Modifications: +>># $Log: plyfllrctn.m,v $ +>># Revision 1.2 2005-11-03 08:44:14 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:54 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:52 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:21 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:53 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:18 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:48 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyFillRectangle Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyFillRectangle request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyFillRectangleReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyFillRectangleReq *) Make_Req(CLIENT, X_PolyFillRectangle); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyFillRectangle request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyFillRectangle request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyFillRectangle request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyLine/pPolyLine.m b/xts5/Xproto/pPolyLine/pPolyLine.m new file mode 100644 index 00000000..094e0427 --- /dev/null +++ b/xts5/Xproto/pPolyLine/pPolyLine.m @@ -0,0 +1,229 @@ +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/Xproto/pPolyLine/pPolyLine.m,v 1.2 2005-11-03 08:44:14 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyLine/pPolyLine.m +>># +>># Description: +>># Tests for PolyLine +>># +>># Modifications: +>># $Log: plyln.m,v $ +>># Revision 1.2 2005-11-03 08:44:14 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:54 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:53 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:22 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:54 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:19 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:50 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyLine Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyLine request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyLineReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyLineReq *) Make_Req(CLIENT, X_PolyLine); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyLine request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyLine request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyLine request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyPoint/pPolyPoint.m b/xts5/Xproto/pPolyPoint/pPolyPoint.m new file mode 100644 index 00000000..e3527a5b --- /dev/null +++ b/xts5/Xproto/pPolyPoint/pPolyPoint.m @@ -0,0 +1,229 @@ +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/Xproto/pPolyPoint/pPolyPoint.m,v 1.2 2005-11-03 08:44:14 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyPoint/pPolyPoint.m +>># +>># Description: +>># Tests for PolyPoint +>># +>># Modifications: +>># $Log: plypnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:14 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:55 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:54 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:22 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:55 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:21 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:52 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyPoint Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyPoint request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyPointReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyPointReq *) Make_Req(CLIENT, X_PolyPoint); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyPoint request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyPoint request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyPoint request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyRectangle/pPolyRectangle.m b/xts5/Xproto/pPolyRectangle/pPolyRectangle.m new file mode 100644 index 00000000..9197c217 --- /dev/null +++ b/xts5/Xproto/pPolyRectangle/pPolyRectangle.m @@ -0,0 +1,243 @@ +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/Xproto/pPolyRectangle/pPolyRectangle.m,v 1.2 2005-11-03 08:44:15 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyRectangle/pPolyRectangle.m +>># +>># Description: +>># Tests for PolyRectangle +>># +>># Modifications: +>># $Log: plyrctngl.m,v $ +>># Revision 1.2 2005-11-03 08:44:15 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:55 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:55 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:23 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:55 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:22 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:55 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyRectangle Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyRectangle request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyRectangleReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyRectangleReq *) Make_Req(CLIENT, X_PolyRectangle); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyRectangle request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyRectangle request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyRectangle request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolySegment/pPolySegment.m b/xts5/Xproto/pPolySegment/pPolySegment.m new file mode 100644 index 00000000..cc550d58 --- /dev/null +++ b/xts5/Xproto/pPolySegment/pPolySegment.m @@ -0,0 +1,243 @@ +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/Xproto/pPolySegment/pPolySegment.m,v 1.2 2005-11-03 08:44:15 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolySegment/pPolySegment.m +>># +>># Description: +>># Tests for PolySegment +>># +>># Modifications: +>># $Log: plysgmnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:15 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:56 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:56 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:23 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:56 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:23 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:57 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolySegment Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolySegment request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolySegmentReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolySegmentReq *) Make_Req(CLIENT, X_PolySegment); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolySegment request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolySegment request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolySegment request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request plus zero or more segments, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + 0 segs. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + 0 segs. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n segs. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n segs. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum + n segs */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length +accepted by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + greater than that accepted by the X server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + greater than that accepted by the X server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyText16/pPolyText16.m b/xts5/Xproto/pPolyText16/pPolyText16.m new file mode 100644 index 00000000..b06e6d00 --- /dev/null +++ b/xts5/Xproto/pPolyText16/pPolyText16.m @@ -0,0 +1,277 @@ +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/Xproto/pPolyText16/pPolyText16.m,v 1.2 2005-11-03 08:44:15 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyText16/pPolyText16.m +>># +>># Description: +>># Tests for PolyText16 +>># +>># Modifications: +>># $Log: plytxt16.m,v $ +>># Revision 1.2 2005-11-03 08:44:15 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:56 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:57 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:24 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:56 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:25 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:05:59 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyText16 Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for PolyText16 request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyText16Req *req; +xCreateGCReq *gc_req; +xOpenFontReq *font_req; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + + /* open the xtfont2 font to get its resource id for GContext */ + + font_req = (xOpenFontReq *) Make_Req(CLIENT, X_OpenFont); + font_req = (xOpenFontReq *) Clear_Counted_Value (font_req); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'x'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 't'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'f'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'o'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 'n'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, 't'); + font_req = (xOpenFontReq *) Add_Counted_Value (font_req, '2'); + Send_Req(CLIENT, (xReq *) font_req); + Log_Trace("client %d sent default OpenFont request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + + /* create a default GContext with xtfont2 as the font */ + + gc_req = (xCreateGCReq *) Make_Req (CLIENT, X_CreateGC); + gc_req = (xCreateGCReq *) Add_Masked_Value (gc_req, GCFont, font_req->fid); + Send_Req (CLIENT, (xReq *) gc_req); + Log_Trace ("client %d sent CreateGC request\n", CLIENT); + Expect_Nothing (CLIENT); + Set_Default_GContext (CLIENT, gc_req->gc); + Free_Req (gc_req); + Free_Req (font_req); + + /* map window, send PolyText16 request, and check results visually */ + + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyText16Req *) Make_Req(CLIENT, X_PolyText16); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyText16 request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyText16 request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyText16 request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPolyText8/pPolyText8.m b/xts5/Xproto/pPolyText8/pPolyText8.m new file mode 100644 index 00000000..90b31167 --- /dev/null +++ b/xts5/Xproto/pPolyText8/pPolyText8.m @@ -0,0 +1,245 @@ +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/Xproto/pPolyText8/pPolyText8.m,v 1.2 2005-11-03 08:44:16 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPolyText8/pPolyText8.m +>># +>># Description: +>># Tests for PolyText8 +>># +>># Modifications: +>># $Log: plytxt8.m,v $ +>># Revision 1.2 2005-11-03 08:44:16 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:57 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:58 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:24 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:56 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:26 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:02 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PolyText8 Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PolyText8 request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyText8Req *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + req = (xPolyText8Req *) Make_Req(CLIENT, X_PolyText8); + Log_Err_Detail("Request was:"); + Show_Req(req); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PolyText8 request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PolyText8 request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PolyText8 request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pPutImage/pPutImage.m b/xts5/Xproto/pPutImage/pPutImage.m new file mode 100644 index 00000000..36110c30 --- /dev/null +++ b/xts5/Xproto/pPutImage/pPutImage.m @@ -0,0 +1,317 @@ +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/Xproto/pPutImage/pPutImage.m,v 1.3 2005-11-03 08:44:16 jmichael Exp $ + +Copyright (c) 1999 The Open Group +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pPutImage/pPutImage.m +>># +>># Description: +>># Tests for PutImage +>># +>># Modifications: +>># $Log: ptimg.m,v $ +>># Revision 1.3 2005-11-03 08:44:16 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 12:08:31 gwc +>># Updated copyright notice +>># +>># Revision 8.1 1999/12/03 11:33:31 vsx +>># TSD4W.00165: in TOO_LONG test don't try to allocate image buffer when Big-Requests are enabled +>># +>># Revision 8.0 1998/12/23 23:32:57 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:53:59 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:25 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:57 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/18 02:41:19 tbr +>># Branch point for release 5.0.0. +>># +>># Revision 3.2 1995/12/18 02:40:30 tbr +>># changed bcopy to wbcopy +>># +>># Revision 3.1 1995/12/15 01:06:04 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE PutImage Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for PutImage request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xPolyRectangleReq *prr; +xGetImageReq *req; +xGetImageReply *rep; +xPutImageReq *pir; + +static +void +tester() +{ + unsigned char *from; + unsigned char *to; + unsigned int len; + + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + Map_Window(CLIENT, win); + + prr = (xPolyRectangleReq *) Make_Req(CLIENT, X_PolyRectangle); + Send_Req(CLIENT, (xReq *) prr); + Log_Trace("client %d sent pixmap PolyRectangle request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + req = (xGetImageReq *) Make_Req(CLIENT, X_GetImage); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default GetImage request\n", CLIENT); + + if ((rep = (xGetImageReply *) Expect_Reply(CLIENT, X_GetImage)) == NULL) { + Log_Del("client %d failed to receive GetImage reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetImage reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + win = Create_Default_Window(CLIENT); + Map_Window(CLIENT, win); + + Set_Test_Type(CLIENT, test_type); + pir = (xPutImageReq *) Make_Req(CLIENT, X_PutImage); + pir->dstX = 0; + pir->dstY = 0; + pir->width = req->width; + pir->height = req->height; + if (test_type != BAD_LENGTH) { + switch (test_type) { + case JUST_TOO_LONG: + pir->length += 10; /* ensure we're well over + w*h*depth_and_format_and_pad_stuff/4 */ + /* now fall through */ + default: + pir->length += rep->length; + break; + case TOO_LONG: + /* Send_Req() won't access any request data, so + no need to allocate it */ + pir->length = 0; + break; + } + len = pir->length<<2; + if (len != 0) { + pir = (xPutImageReq *) Xstrealloc((char *) pir, len); + if (pir == NULL) { + Log_Del ("client %d could not reallocate %d bytes for request buffer\n", CLIENT, len); + Exit (); + } + to = (unsigned char *) (pir+1); + from = (unsigned char *) (rep+1); + wbcopy(from, to, rep->length << 2); + } + } + + Send_Req(CLIENT, (xReq *) pir); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default PutImage request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Visual_Check(); + break; + case BAD_LENGTH: + Log_Trace("client %d sent PutImage request with bad length (%d)\n", CLIENT, pir->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong PutImage request (%d)\n", CLIENT, pir->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Free_Reply(rep); + Free_Req(pir); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryBestSize/pQueryBestSize.m b/xts5/Xproto/pQueryBestSize/pQueryBestSize.m new file mode 100644 index 00000000..478cf4a9 --- /dev/null +++ b/xts5/Xproto/pQueryBestSize/pQueryBestSize.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/Xproto/pQueryBestSize/pQueryBestSize.m,v 1.2 2005-11-03 08:44:16 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryBestSize/pQueryBestSize.m +>># +>># Description: +>># Tests for QueryBestSize +>># +>># Modifications: +>># $Log: qrybstsz.m,v $ +>># Revision 1.2 2005-11-03 08:44:16 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:58 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:00 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:25 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:57 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:29 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:07 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryBestSize Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for QueryBestSize request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window win; +xQueryBestSizeReq *req; +xQueryBestSizeReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + win = Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xQueryBestSizeReq *) Make_Req(CLIENT, X_QueryBestSize); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryBestSize request\n", CLIENT); + if ((rep = (xQueryBestSizeReply *) Expect_Reply(CLIENT, X_QueryBestSize)) == NULL) { + Log_Err("client %d failed to receive QueryBestSize reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryBestSize reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryBestSize request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryBestSize request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryColors/pQueryColors.m b/xts5/Xproto/pQueryColors/pQueryColors.m new file mode 100644 index 00000000..0ccafdf8 --- /dev/null +++ b/xts5/Xproto/pQueryColors/pQueryColors.m @@ -0,0 +1,272 @@ +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/Xproto/pQueryColors/pQueryColors.m,v 1.3 2005-11-03 08:44:16 jmichael Exp $ + +Copyright (c) 2001 The Open Group +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryColors/pQueryColors.m +>># +>># Description: +>># Tests for QueryColors +>># +>># Modifications: +>># $Log: qryclrs.m,v $ +>># Revision 1.3 2005-11-03 08:44:16 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 12:09:35 gwc +>># Updated copyright notice +>># +>># Revision 8.1 2001/01/05 17:22:54 vsx +>># TSD4W.00169: changed reply_pixel from unsigned long to CARD32 +>># +>># Revision 8.0 1998/12/23 23:32:59 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:01 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:25 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:58 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:30 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:09 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryColors Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for QueryColors request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocNamedColorReply *alloc_reply; +xQueryColorsReply *query_reply; +xError *err; +extern CARD32 reply_pixel; + +/* + intent: send a QueryColors request to the server and check + that the server sent a QueryColors reply back. + input: + output: none + global input: + side effects: creates a window resource + writes to global reply_pixel + methods: +*/ + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* allocate a color and store pixel from reply in global */ + + req = (xResourceReq *) Make_Req(CLIENT, X_AllocNamedColor); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default AllocNamedColor request\n", CLIENT); + if ((alloc_reply = (xAllocNamedColorReply *) Expect_Reply(CLIENT, X_AllocNamedColor)) == NULL) { + Log_Err("client %d failed to receive AllocNamedColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocNamedColor reply\n", CLIENT); + } + reply_pixel = alloc_reply->pixel; + (void) Expect_Nothing(CLIENT); + + /* query colors */ + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_QueryColors); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryColors request\n", CLIENT); + if ((query_reply = (xQueryColorsReply *) Expect_Reply(CLIENT, X_QueryColors)) == NULL) { + Log_Err("client %d failed to receive QueryColors reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryColors reply\n", CLIENT); + Free_Reply(query_reply); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryColors request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryColors request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryExtension/pQueryExtension.m b/xts5/Xproto/pQueryExtension/pQueryExtension.m new file mode 100644 index 00000000..70cad750 --- /dev/null +++ b/xts5/Xproto/pQueryExtension/pQueryExtension.m @@ -0,0 +1,247 @@ +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/Xproto/pQueryExtension/pQueryExtension.m,v 1.2 2005-11-03 08:44:16 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryExtension/pQueryExtension.m +>># +>># Description: +>># Tests for QueryExtension +>># +>># Modifications: +>># $Log: qryextnsn.m,v $ +>># Revision 1.2 2005-11-03 08:44:16 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:00 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:32:59 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:02 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:26 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:58 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:32 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:12 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryExtension Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for QueryExtension request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xQueryExtensionReq *req; +xQueryExtensionReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xQueryExtensionReq *) Make_Req(CLIENT, X_QueryExtension); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryExtension request\n", CLIENT); + if ((rep = (xQueryExtensionReply *) Expect_Reply(CLIENT, X_QueryExtension)) == NULL) { + Log_Err("client %d failed to receive QueryExtension reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryExtension reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryExtension request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryExtension request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryFont/pQueryFont.m b/xts5/Xproto/pQueryFont/pQueryFont.m new file mode 100644 index 00000000..e9a4f49d --- /dev/null +++ b/xts5/Xproto/pQueryFont/pQueryFont.m @@ -0,0 +1,254 @@ +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/Xproto/pQueryFont/pQueryFont.m,v 1.2 2005-11-03 08:44:17 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryFont/pQueryFont.m +>># +>># Description: +>># Tests for QueryFont +>># +>># Modifications: +>># $Log: qryfnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:17 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:00 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:03 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:26 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:59 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:33 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:14 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryFont Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for QueryFont request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Font Default_Font; +xResourceReq *req; +xQueryFontReply *rep; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + Default_Font = Create_Default_Font(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_QueryFont); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryFont request\n", CLIENT); + if ((rep = (xQueryFontReply *) Expect_Reply(CLIENT, X_QueryFont)) == NULL) { + Log_Err("client %d failed to receive QueryFont reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryFont reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryFont request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryFont request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryKeymap/pQueryKeymap.m b/xts5/Xproto/pQueryKeymap/pQueryKeymap.m new file mode 100644 index 00000000..0da2da7e --- /dev/null +++ b/xts5/Xproto/pQueryKeymap/pQueryKeymap.m @@ -0,0 +1,247 @@ +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/Xproto/pQueryKeymap/pQueryKeymap.m,v 1.2 2005-11-03 08:44:17 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryKeymap/pQueryKeymap.m +>># +>># Description: +>># Tests for QueryKeymap +>># +>># Modifications: +>># $Log: qrykymp.m,v $ +>># Revision 1.2 2005-11-03 08:44:17 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:00 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:04 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:27 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:20:59 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:34 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:16 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryKeymap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for QueryKeymap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *req; +xQueryKeymapReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_QueryKeymap); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryKeymap request\n", CLIENT); + if ((rep = (xQueryKeymapReply *) Expect_Reply(CLIENT, X_QueryKeymap)) == NULL) { + Log_Err("client %d failed to receive QueryKeymap reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryKeymap reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryKeymap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryKeymap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryPointer/pQueryPointer.m b/xts5/Xproto/pQueryPointer/pQueryPointer.m new file mode 100644 index 00000000..0232168b --- /dev/null +++ b/xts5/Xproto/pQueryPointer/pQueryPointer.m @@ -0,0 +1,249 @@ +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/Xproto/pQueryPointer/pQueryPointer.m,v 1.2 2005-11-03 08:44:17 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryPointer/pQueryPointer.m +>># +>># Description: +>># Tests for QueryPointer +>># +>># Modifications: +>># $Log: qrypntr.m,v $ +>># Revision 1.2 2005-11-03 08:44:17 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:01 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:05 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:27 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:00 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:36 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:20 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryPointer Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for QueryPointer request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xQueryPointerReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_QueryPointer); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryPointer request\n", CLIENT); + if ((rep = (xQueryPointerReply *) Expect_Reply(CLIENT, X_QueryPointer)) == NULL) { + Log_Err("client %d failed to receive QueryPointer reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryPointer reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryPointer request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryPointer request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryTextExtents/pQueryTextExtents.m b/xts5/Xproto/pQueryTextExtents/pQueryTextExtents.m new file mode 100644 index 00000000..a79f3147 --- /dev/null +++ b/xts5/Xproto/pQueryTextExtents/pQueryTextExtents.m @@ -0,0 +1,240 @@ +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/Xproto/pQueryTextExtents/pQueryTextExtents.m,v 1.2 2005-11-03 08:44:17 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryTextExtents/pQueryTextExtents.m +>># +>># Description: +>># Tests for QueryTextExtents +>># +>># Modifications: +>># $Log: qrytxtextn.m,v $ +>># Revision 1.2 2005-11-03 08:44:17 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:02 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:07 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:28 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:01 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:38 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:24 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryTextExtents Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>SET tpstartup tpfontstartup +>>SET tpcleanup tpfontcleanup +>>EXTERN +/* Touch test for QueryTextExtents request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Font Default_Font; +xQueryTextExtentsReq *req; +xQueryTextExtentsReply *rep; + +static +void +tester() +{ + Set_Init_Timer(); + + Create_Client(CLIENT); + + Default_Font = Create_Default_Font(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xQueryTextExtentsReq *) Make_Req(CLIENT, X_QueryTextExtents); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryTextExtents request\n", CLIENT); + if ((rep = (xQueryTextExtentsReply *) Expect_Reply(CLIENT, X_QueryTextExtents)) == NULL) { + Log_Err("client %d failed to receive QueryTextExtents reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryTextExtents reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryTextExtents request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryTextExtents request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pQueryTree/pQueryTree.m b/xts5/Xproto/pQueryTree/pQueryTree.m new file mode 100644 index 00000000..683e01fe --- /dev/null +++ b/xts5/Xproto/pQueryTree/pQueryTree.m @@ -0,0 +1,249 @@ +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/Xproto/pQueryTree/pQueryTree.m,v 1.2 2005-11-03 08:44:17 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pQueryTree/pQueryTree.m +>># +>># Description: +>># Tests for QueryTree +>># +>># Modifications: +>># $Log: qrytr.m,v $ +>># Revision 1.2 2005-11-03 08:44:17 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:01 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:06 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:28 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:00 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:37 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:22 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE QueryTree Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for QueryTree request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xQueryTreeReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_QueryTree); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default QueryTree request\n", CLIENT); + if ((rep = (xQueryTreeReply *) Expect_Reply(CLIENT, X_QueryTree)) == NULL) { + Log_Err("client %d failed to receive QueryTree reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received QueryTree reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent QueryTree request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong QueryTree request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pRecolorCursor/pRecolorCursor.m b/xts5/Xproto/pRecolorCursor/pRecolorCursor.m new file mode 100644 index 00000000..bf840c9d --- /dev/null +++ b/xts5/Xproto/pRecolorCursor/pRecolorCursor.m @@ -0,0 +1,241 @@ +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/Xproto/pRecolorCursor/pRecolorCursor.m,v 1.2 2005-11-03 08:44:17 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pRecolorCursor/pRecolorCursor.m +>># +>># Description: +>># Tests for RecolorCursor +>># +>># Modifications: +>># $Log: rclrcrsr.m,v $ +>># Revision 1.2 2005-11-03 08:44:17 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:02 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:08 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:29 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:01 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:40 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:26 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE RecolorCursor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for RecolorCursor request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xRecolorCursorReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Cursor_Pixmap(CLIENT); + (void) Create_Default_Cursor(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xRecolorCursorReq *) Make_Req(CLIENT, X_RecolorCursor); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default RecolorCursor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent RecolorCursor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong RecolorCursor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pReparentWindow/pReparentWindow.m b/xts5/Xproto/pReparentWindow/pReparentWindow.m new file mode 100644 index 00000000..1b826b39 --- /dev/null +++ b/xts5/Xproto/pReparentWindow/pReparentWindow.m @@ -0,0 +1,252 @@ +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/Xproto/pReparentWindow/pReparentWindow.m,v 1.2 2005-11-03 08:44:18 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pReparentWindow/pReparentWindow.m +>># +>># Description: +>># Tests for ReparentWindow +>># +>># Modifications: +>># $Log: rprntwdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:18 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:03 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:09 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:29 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:02 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:41 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:29 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE ReparentWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for ReparentWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xCreateWindowReq *cwr; +xReparentWindowReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + cwr->parent = Default_Window; + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent additional CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Default_Window = cwr->wid; + Free_Req(cwr); + + Set_Test_Type(CLIENT, test_type); + req = (xReparentWindowReq *) Make_Req(CLIENT, X_ReparentWindow); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default ReparentWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent ReparentWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong ReparentWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pRotateProperties/pRotateProperties.m b/xts5/Xproto/pRotateProperties/pRotateProperties.m new file mode 100644 index 00000000..2085f7ef --- /dev/null +++ b/xts5/Xproto/pRotateProperties/pRotateProperties.m @@ -0,0 +1,263 @@ +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/Xproto/pRotateProperties/pRotateProperties.m,v 1.2 2005-11-03 08:44:18 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pRotateProperties/pRotateProperties.m +>># +>># Description: +>># Tests for RotateProperties +>># +>># Modifications: +>># $Log: rttprprts.m,v $ +>># Revision 1.2 2005-11-03 08:44:18 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:03 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:10 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:30 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:02 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:43 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:31 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE RotateProperties Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for RotateProperties request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xChangePropertyReq *ch_req; +xRotatePropertiesReq *req; +xError *err; +extern Atom Test_Atom1; +extern Atom Test_Atom2; +extern char *Test_prop; +char *Test_prop1 = "__Test1_prop"; +char *Test_prop2 = "__Test2_prop"; + +static +void +tester() +{ + Create_Client(CLIENT); + (void) Create_Default_Window(CLIENT); + Test_prop = Test_prop1; + Test_Atom1 = Create_Default_Atom(CLIENT); + + ch_req = (xChangePropertyReq *)Make_Req(CLIENT, X_ChangeProperty); + Test_Atom1 = ch_req->property; + Send_Req(CLIENT, (xReq *)ch_req); + Expect_Nothing(CLIENT); + + Test_prop = Test_prop2; + ch_req->property = Test_Atom2 = Create_Default_Atom(CLIENT); + Send_Req(CLIENT, (xReq *)ch_req); + Expect_Nothing(CLIENT); + + Log_Trace("Test_Atom1 is 0x%x", Test_Atom1); + Log_Trace("Test_Atom2 is 0x%x", Test_Atom2); + + Set_Test_Type(CLIENT, test_type); + req = (xRotatePropertiesReq *) Make_Req(CLIENT, X_RotateProperties); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default RotateProperties request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent RotateProperties request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong RotateProperties request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSendEvent/pSendEvent.m b/xts5/Xproto/pSendEvent/pSendEvent.m new file mode 100644 index 00000000..173b45b1 --- /dev/null +++ b/xts5/Xproto/pSendEvent/pSendEvent.m @@ -0,0 +1,280 @@ +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/Xproto/pSendEvent/pSendEvent.m,v 1.2 2005-11-03 08:44:19 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSendEvent/pSendEvent.m +>># +>># Description: +>># Tests for SendEvent +>># +>># Modifications: +>># $Log: sndevnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:19 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:04 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:11 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:30 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:02 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:44 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:34 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SendEvent Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SendEvent request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xSendEventReq *req; +xEvent *ev; + +/* + * Routine: + * + * Input: + * + * Output: + * + * Returns: + * + * Globals used: + * + * Side Effects: + * + * Methods: + * + */ +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Atom(CLIENT); + (void) Create_Default_Event(CLIENT, ClientMessage); + + Set_Test_Type(CLIENT, test_type); + req = (xSendEventReq *) Make_Req(CLIENT, X_SendEvent); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SendEvent request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, ClientMessage)) == NULL) { + Log_Err("client %d failed to receive ClientMessage\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received ClientMessage\n", CLIENT); + /* Checking here that the MSBit of the event code is ON */ + if (!is_fake(ev->u.u.type)) + Log_Err("client %d Expected MSB set in event type ClientMessage; got %x\n", ev->u.u.type); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SendEvent request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SendEvent request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); + } + +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and +.M event.code +is +.S ClientMessage , +and +.M event_mask +is empty, +and +.M destination +is a window created by the client, +then the X server sends back a +.S ClientMessage +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a ClientMessage event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a ClientMessage event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetAccessControl/pSetAccessControl.m b/xts5/Xproto/pSetAccessControl/pSetAccessControl.m new file mode 100644 index 00000000..2e7c7861 --- /dev/null +++ b/xts5/Xproto/pSetAccessControl/pSetAccessControl.m @@ -0,0 +1,238 @@ +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/Xproto/pSetAccessControl/pSetAccessControl.m,v 1.2 2005-11-03 08:44:19 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetAccessControl/pSetAccessControl.m +>># +>># Description: +>># Tests for SetAccessControl +>># +>># Modifications: +>># $Log: staccsscnt.m,v $ +>># Revision 1.2 2005-11-03 08:44:19 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:04 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:12 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:31 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:03 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:45 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:36 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetAccessControl Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetAccessControl request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xSetAccessControlReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetAccessControlReq *) Make_Req(CLIENT, X_SetAccessControl); + req->mode = DisableAccess; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetAccessControl request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetAccessControl request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetAccessControl request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetClipRectangles/pSetClipRectangles.m b/xts5/Xproto/pSetClipRectangles/pSetClipRectangles.m new file mode 100644 index 00000000..e31908ef --- /dev/null +++ b/xts5/Xproto/pSetClipRectangles/pSetClipRectangles.m @@ -0,0 +1,240 @@ +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/Xproto/pSetClipRectangles/pSetClipRectangles.m,v 1.2 2005-11-03 08:44:19 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetClipRectangles/pSetClipRectangles.m +>># +>># Description: +>># Tests for SetClipRectangles +>># +>># Modifications: +>># $Log: stclprctng.m,v $ +>># Revision 1.2 2005-11-03 08:44:19 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:05 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:14 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:31 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:03 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:47 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:39 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetClipRectangles Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetClipRectangles request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xSetClipRectanglesReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetClipRectanglesReq *) Make_Req(CLIENT, X_SetClipRectangles); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetClipRectangles request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetClipRectangles request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetClipRectangles request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetCloseDownMode/pSetCloseDownMode.m b/xts5/Xproto/pSetCloseDownMode/pSetCloseDownMode.m new file mode 100644 index 00000000..12206278 --- /dev/null +++ b/xts5/Xproto/pSetCloseDownMode/pSetCloseDownMode.m @@ -0,0 +1,238 @@ +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/Xproto/pSetCloseDownMode/pSetCloseDownMode.m,v 1.2 2005-11-03 08:44:20 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetCloseDownMode/pSetCloseDownMode.m +>># +>># Description: +>># Tests for SetCloseDownMode +>># +>># Modifications: +>># $Log: stclsdwnmd.m,v $ +>># Revision 1.2 2005-11-03 08:44:20 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:05 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:15 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:32 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:04 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:48 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:41 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetCloseDownMode Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetCloseDownMode request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xSetCloseDownModeReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetCloseDownModeReq *) Make_Req(CLIENT, X_SetCloseDownMode); + req->mode = RetainPermanent; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetCloseDownMode request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetCloseDownMode request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetCloseDownMode request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetDashes/pSetDashes.m b/xts5/Xproto/pSetDashes/pSetDashes.m new file mode 100644 index 00000000..a6657e40 --- /dev/null +++ b/xts5/Xproto/pSetDashes/pSetDashes.m @@ -0,0 +1,240 @@ +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/Xproto/pSetDashes/pSetDashes.m,v 1.2 2005-11-03 08:44:20 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetDashes/pSetDashes.m +>># +>># Description: +>># Tests for SetDashes +>># +>># Modifications: +>># $Log: stdshs.m,v $ +>># Revision 1.2 2005-11-03 08:44:20 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:06 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:16 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:32 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:04 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:49 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:43 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetDashes Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetDashes request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xSetDashesReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_GContext(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetDashesReq *) Make_Req(CLIENT, X_SetDashes); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetDashes request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetDashes request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetDashes request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetFontPath/pSetFontPath.m b/xts5/Xproto/pSetFontPath/pSetFontPath.m new file mode 100644 index 00000000..a7d8666e --- /dev/null +++ b/xts5/Xproto/pSetFontPath/pSetFontPath.m @@ -0,0 +1,237 @@ +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/Xproto/pSetFontPath/pSetFontPath.m,v 1.2 2005-11-03 08:44:20 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetFontPath/pSetFontPath.m +>># +>># Description: +>># Tests for SetFontPath +>># +>># Modifications: +>># $Log: stfntpth.m,v $ +>># Revision 1.2 2005-11-03 08:44:20 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:06 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:17 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:33 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:05 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:51 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:46 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetFontPath Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetFontPath request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xSetFontPathReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetFontPathReq *) Make_Req(CLIENT, X_SetFontPath); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetFontPath request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetFontPath request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetFontPath request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetInputFocus/pSetInputFocus.m b/xts5/Xproto/pSetInputFocus/pSetInputFocus.m new file mode 100644 index 00000000..baab259e --- /dev/null +++ b/xts5/Xproto/pSetInputFocus/pSetInputFocus.m @@ -0,0 +1,254 @@ +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/Xproto/pSetInputFocus/pSetInputFocus.m,v 1.2 2005-11-03 08:44:20 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetInputFocus/pSetInputFocus.m +>># +>># Description: +>># Tests for SetInputFocus +>># +>># Modifications: +>># $Log: stinptfcs.m,v $ +>># Revision 1.2 2005-11-03 08:44:20 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:07 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:18 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:33 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:05 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:52 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:48 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetInputFocus Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetInputFocus request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gifr; +xGetInputFocusReply *gifrep; +xSetInputFocusReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + gifr = (xReq *) Make_Req(CLIENT, X_GetInputFocus); + Send_Req(CLIENT, (xReq *) gifr); + Log_Trace("client %d sent default GetInputFocus\n", CLIENT); + + if ((gifrep = (xGetInputFocusReply *) Expect_Reply(CLIENT, X_GetInputFocus)) == NULL) { + Log_Err("client %d failed to receive GetInputFocus reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetInputFocus reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetInputFocusReq *) Make_Req(CLIENT, X_SetInputFocus); + req->revertTo = gifrep->revertTo; + req->focus = gifrep->focus; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetInputFocus request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetInputFocus request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetInputFocus request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetModifierMapping/pSetModifierMapping.m b/xts5/Xproto/pSetModifierMapping/pSetModifierMapping.m new file mode 100644 index 00000000..acaeba6a --- /dev/null +++ b/xts5/Xproto/pSetModifierMapping/pSetModifierMapping.m @@ -0,0 +1,291 @@ +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/Xproto/pSetModifierMapping/pSetModifierMapping.m,v 1.2 2005-11-03 08:44:21 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetModifierMapping/pSetModifierMapping.m +>># +>># Description: +>># Tests for SetModifierMapping +>># +>># Modifications: +>># $Log: stmdfrmppn.m,v $ +>># Revision 1.2 2005-11-03 08:44:21 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:08 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:20 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:34 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:06 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:55 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:53 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetModifierMapping Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetModifierMapping request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gmmr; +xGetModifierMappingReply *gmmrep; +xSetModifierMappingReq *req; +xSetModifierMappingReply *rep; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + /* Get the existing mapping... */ + + gmmr = (xReq *) Make_Req(CLIENT, X_GetModifierMapping); + Send_Req(CLIENT, (xReq *) gmmr); + Log_Trace("client %d sent default GetModifierMapping request\n", CLIENT); + + if ((gmmrep = (xGetModifierMappingReply *) Expect_Reply(CLIENT, X_GetModifierMapping)) == NULL) { + Log_Err("client %d failed to receive GetModifierMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetModifierMapping reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + Free_Req(gmmr); + + /* ... then make a request to duplicate that mapping. */ + + Set_Test_Type(CLIENT, test_type); + req = (xSetModifierMappingReq *) Make_Req(CLIENT, X_SetModifierMapping); + req->numKeyPerModifier = gmmrep->numKeyPerModifier; + req->length += 2*req->numKeyPerModifier; + req = (xSetModifierMappingReq *) Xstrealloc((char *) req, req->length<<2); + { + unsigned char *p, *q, *r; + + p = (unsigned char *) (gmmrep + 1); + q = (unsigned char *) (req + 1); + r = ((unsigned char *)req) + (int)(req->length<<2); + while (q < r) + *q++ = *p++; + } + + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetModifierMapping request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, MappingNotify)) == NULL) { + Log_Err("client %d failed to receive MappingNotify\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received MappingNotify\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + if ((rep = (xSetModifierMappingReply *) Expect_Reply(CLIENT, X_SetModifierMapping)) == NULL) { + Log_Err("client %d failed to receive SetModifierMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received SetModifierMapping reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetModifierMapping request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetModifierMapping request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply and a +.S MappingNotify +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply and a MappingNotify event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply and a MappingNotify event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request +plus zero or more keycode groups, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero keycode groups. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero keycode groups. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n keycode groups. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n keycode groups. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum + n keycode groups */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetPointerMapping/pSetPointerMapping.m b/xts5/Xproto/pSetPointerMapping/pSetPointerMapping.m new file mode 100644 index 00000000..2f1bf69e --- /dev/null +++ b/xts5/Xproto/pSetPointerMapping/pSetPointerMapping.m @@ -0,0 +1,285 @@ +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/Xproto/pSetPointerMapping/pSetPointerMapping.m,v 1.2 2005-11-03 08:44:21 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetPointerMapping/pSetPointerMapping.m +>># +>># Description: +>># Tests for SetPointerMapping +>># +>># Modifications: +>># $Log: stpntrmppn.m,v $ +>># Revision 1.2 2005-11-03 08:44:21 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:01 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:08 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:21 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:35 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:07 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:56 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:55 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetPointerMapping Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetPointerMapping request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gpmr; +xGetPointerMappingReply *gpmrep; +xSetPointerMappingReq *req; +xSetPointerMappingReply *rep; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + gpmr = (xReq *) Make_Req(CLIENT, X_GetPointerMapping); + Send_Req(CLIENT, (xReq *) gpmr); + Log_Trace("client %d sent default GetPointerMapping request\n", CLIENT); + + if ((gpmrep = (xGetPointerMappingReply *) Expect_Reply(CLIENT, X_GetPointerMapping)) == NULL) { + Log_Err("client %d failed to receive GetPointerMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetPointerMapping reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetPointerMappingReq *) Make_Req(CLIENT, X_SetPointerMapping); + req->nElts = gpmrep->nElts; + req->length += ((3 + req->nElts) >> 2); + req = (xSetPointerMappingReq *) Xstrealloc((char *) req, req->length<<2); + { + unsigned char *p, *q, *r; + + p = (unsigned char *) (gpmrep + 1); + q = (unsigned char *) (req + 1); + r = ((unsigned char *)req) + (int)(req->length<<2); + while (q < r) + *q++ = *p++; + } + + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetPointerMapping request\n", CLIENT); + if ((ev = (xEvent *) Expect_Event(CLIENT, MappingNotify)) == NULL) { + Log_Err("client %d failed to receive MappingNotify\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received MappingNotify\n", CLIENT); + /* do any event checking here */ + Free_Event(ev); + } + if ((rep = (xSetPointerMappingReply *) Expect_Reply(CLIENT, X_SetPointerMapping)) == NULL) { + Log_Err("client %d failed to receive SetPointerMapping reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received SetPointerMapping reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetPointerMapping request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetPointerMapping request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply and a +.S MappingNotify +event to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply and a MappingNotify event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply and a MappingNotify event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetScreenSaver/pSetScreenSaver.m b/xts5/Xproto/pSetScreenSaver/pSetScreenSaver.m new file mode 100644 index 00000000..b68bba3d --- /dev/null +++ b/xts5/Xproto/pSetScreenSaver/pSetScreenSaver.m @@ -0,0 +1,256 @@ +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/Xproto/pSetScreenSaver/pSetScreenSaver.m,v 1.2 2005-11-03 08:44:22 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetScreenSaver/pSetScreenSaver.m +>># +>># Description: +>># Tests for SetScreenSaver +>># +>># Modifications: +>># $Log: stscrnsvr.m,v $ +>># Revision 1.2 2005-11-03 08:44:22 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:09 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:23 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:35 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:08 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:00 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:00 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetScreenSaver Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetScreenSaver request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gssr; +xGetScreenSaverReply *gssrep; +xSetScreenSaverReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + gssr = (xReq *) Make_Req(CLIENT, X_GetScreenSaver); + Send_Req(CLIENT, (xReq *) gssr); + Log_Trace("client %d sent default GetScreenSaver request\n", CLIENT); + + if ((gssrep = (xGetScreenSaverReply *) Expect_Reply(CLIENT, X_GetScreenSaver)) == NULL) { + Log_Err("client %d failed to receive GetScreenSaver reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GetScreenSaver reply\n", CLIENT); + /* do any reply checking here */ + } + (void) Expect_Nothing(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetScreenSaverReq *) Make_Req(CLIENT, X_SetScreenSaver); + req->timeout = gssrep->timeout; + req->interval = gssrep->interval; + req->preferBlank = gssrep->preferBlanking; + req->allowExpose = gssrep->allowExposures; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetScreenSaver request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetScreenSaver request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetScreenSaver request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pSetSelectionOwner/pSetSelectionOwner.m b/xts5/Xproto/pSetSelectionOwner/pSetSelectionOwner.m new file mode 100644 index 00000000..c83c311b --- /dev/null +++ b/xts5/Xproto/pSetSelectionOwner/pSetSelectionOwner.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/Xproto/pSetSelectionOwner/pSetSelectionOwner.m,v 1.2 2005-11-03 08:44:22 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pSetSelectionOwner/pSetSelectionOwner.m +>># +>># Description: +>># Tests for SetSelectionOwner +>># +>># Modifications: +>># $Log: stslctnown.m,v $ +>># Revision 1.2 2005-11-03 08:44:22 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:10 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:24 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:36 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:08 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:01 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:02 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE SetSelectionOwner Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for SetSelectionOwner request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Atom Test_Property; +xSetSelectionOwnerReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + Test_Property = Create_Default_Atom(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xSetSelectionOwnerReq *) Make_Req(CLIENT, X_SetSelectionOwner); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default SetSelectionOwner request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent SetSelectionOwner request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong SetSelectionOwner request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client does not currently own the selection, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pStoreColors/pStoreColors.m b/xts5/Xproto/pStoreColors/pStoreColors.m new file mode 100644 index 00000000..d8425866 --- /dev/null +++ b/xts5/Xproto/pStoreColors/pStoreColors.m @@ -0,0 +1,372 @@ +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/Xproto/pStoreColors/pStoreColors.m,v 1.3 2005-11-03 08:44:21 jmichael Exp $ + +Copyright (c) 2001 The Open Group +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pStoreColors/pStoreColors.m +>># +>># Description: +>># Tests for StoreColors +>># +>># Modifications: +>># $Log: strclrs.m,v $ +>># Revision 1.3 2005-11-03 08:44:21 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 12:10:18 gwc +>># Updated copyright notice +>># +>># Revision 8.1 2001/01/05 17:20:26 vsx +>># TSD4W.00169: changed reply_pixel from unsigned long to CARD32 +>># +>># Revision 8.0 1998/12/23 23:33:07 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:19 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:34 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:06 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:53 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:50 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE StoreColors Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for StoreColors request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorCellsReply *acreply; +xAllocNamedColorReply *anreply; +xError *err; +extern CARD32 reply_pixel; + +/* + intent: If a read-write color cell can be allocated: + Allocate read-write cell by sending an AllocColorCells request, + send a StoreColors request to the server and check no errors, + input: + output: none + global input: + side effects: creates a window resource + writes to global reply_pixel + methods: +*/ + +static +void +tester_rw() +{ + Create_Client(CLIENT); + if (!Allocatable (CLIENT)) { + unsupported("The visual class for screen zero is not writable"); + Exit_OK(); + } + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* allocate a color and store pixel from reply in global */ + + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorCells); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default AllocColorCells request\n", CLIENT); + if ((acreply = (xAllocColorCellsReply *) Expect_Reply(CLIENT, X_AllocColorCells)) == NULL) { + Log_Err("client %d failed to receive AllocColorCells reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocColorCells reply\n", CLIENT); + /* + * This line gets the first pixel value OR'd with + * zero of the returned masks + */ + reply_pixel = *(CARD32 *)(acreply + 1); + Free_Reply(acreply); + } + + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + /* store a color in the pixel from the reply */ + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_StoreColors); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + Log_Trace("client %d sent default StoreColors request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + Exit_OK(); +} + +/* + intent: Allocate read-only cell by sending an AllocNamedColor request, + send a StoreColors request to the server and check + that a BadAccess error is sent back. + input: + output: none + global input: + side effects: creates a window resource + writes to global reply_pixel + methods: +*/ +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* allocate a color and store pixel from reply in global */ + + req = (xResourceReq *) Make_Req(CLIENT, X_AllocNamedColor); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default AllocNamedColor request\n", CLIENT); + if ((anreply = (xAllocNamedColorReply *) Expect_Reply(CLIENT, X_AllocNamedColor)) == NULL) { + Log_Err("client %d failed to receive AllocNamedColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocNamedColor reply\n", CLIENT); + reply_pixel = anreply->pixel; + Free_Reply(anreply); + } + + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + /* store a color in the pixel from the reply */ + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_StoreColors); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + /* + * The default test code called Expect_Nothing() - this is + * not the case here, we expect BadAccess error. + */ + Log_Trace("client %d sent default StoreColors request\n", CLIENT); + (void) Expect_BadAccess(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent StoreColors request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong StoreColors request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good C +If the default visual class for screen zero is +.S DirectColor , +.S PseudoColor , +or +.S GrayScale : +When a client sends a valid xname protocol request to the X server, +and the colour cell is read-write, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +DirectColor, PseudoColor, or GrayScale : +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester_rw); + +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the colour cell is read-only, +then the X server sends back a BadAccess error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAccess error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAccess error. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request +plus zero or more colours, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero colours. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request + zero colours. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n colours. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request + n colours. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum + n colours */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pStoreNamedColor/pStoreNamedColor.m b/xts5/Xproto/pStoreNamedColor/pStoreNamedColor.m new file mode 100644 index 00000000..8064d87e --- /dev/null +++ b/xts5/Xproto/pStoreNamedColor/pStoreNamedColor.m @@ -0,0 +1,368 @@ +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/Xproto/pStoreNamedColor/pStoreNamedColor.m,v 1.3 2005-11-03 08:44:21 jmichael Exp $ + +Copyright (c) 2001 The Open Group +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pStoreNamedColor/pStoreNamedColor.m +>># +>># Description: +>># Tests for StoreNamedColor +>># +>># Modifications: +>># $Log: strnmdclr.m,v $ +>># Revision 1.3 2005-11-03 08:44:21 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 12:11:21 gwc +>># Updated copyright notice +>># +>># Revision 8.1 2001/01/05 17:24:19 vsx +>># TSD4W.00169: changed reply_pixel from unsigned long to CARD32 +>># +>># Revision 8.0 1998/12/23 23:33:09 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:22 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:35 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:07 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:06:58 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:06:57 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE StoreNamedColor Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for StoreNamedColor request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorCellsReply *acreply; +xAllocNamedColorReply *anreply; +xError *err; +extern CARD32 reply_pixel; + +/* + intent: If a read-write color cell can be allocated: + Allocate read-write cell by sending an AllocColorCells request, + send a StoreNamedColor request to the server and check no errors, + input: + output: none + global input: + side effects: creates a window resource + writes to global reply_pixel + methods: +*/ + +static +void +tester_rw() +{ + Create_Client(CLIENT); + if (!Allocatable (CLIENT)) { + unsupported("The visual class for screen zero is not writable"); + Exit_OK(); + } + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* allocate a color and store pixel from reply in global */ + + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorCells); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default AllocColorCells request\n", CLIENT); + if ((acreply = (xAllocColorCellsReply *) Expect_Reply(CLIENT, X_AllocColorCells)) == NULL) { + Log_Err("client %d failed to receive AllocColorCells reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocColorCells reply\n", CLIENT); + /* + * This line gets the first pixel value OR'd with + * zero of the returned masks + */ + reply_pixel = *(CARD32 *) (acreply + 1); + Free_Reply(acreply); + } + + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + /* store a color in the pixel from the reply */ + + req = (xResourceReq *) Make_Req(CLIENT, X_StoreNamedColor); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default StoreNamedColor request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + Exit_OK(); +} + +/* + intent: Allocate read-only cell by sending an AllocNamedColor request, + send a StoreNamedColor request to the server and check + that a BadAccess error is sent back. + input: + output: none + global input: + side effects: creates a window resource + writes to global reply_pixel + methods: +*/ +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* allocate a color and store pixel from reply in global */ + + req = (xResourceReq *) Make_Req(CLIENT, X_AllocNamedColor); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default AllocNamedColor request\n", CLIENT); + if ((anreply = (xAllocNamedColorReply *) Expect_Reply(CLIENT, X_AllocNamedColor)) == NULL) { + Log_Err("client %d failed to receive AllocNamedColor reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received AllocNamedColor reply\n", CLIENT); + reply_pixel = anreply->pixel; + Free_Reply(anreply); + } + + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + /* store a color in the pixel from the reply */ + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_StoreNamedColor); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + /* + * The default test code called Expect_Nothing() - this is + * not the case here, we expect BadAccess error. + */ + Log_Trace("client %d sent default StoreNamedColor request\n", CLIENT); + (void) Expect_BadAccess(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent StoreNamedColor request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong StoreNamedColor request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good C +If the default visual class for screen zero is +.S DirectColor , +.S PseudoColor , +or +.S GrayScale : +When a client sends a valid xname protocol request to the X server, +and the colour cell is read-write, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +DirectColor, PseudoColor, or GrayScale : +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester_rw); +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the colour cell is read-only, +then the X server sends back a BadAccess error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAccess error. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a BadAccess error. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pTranslateCoords/pTranslateCoords.m b/xts5/Xproto/pTranslateCoords/pTranslateCoords.m new file mode 100644 index 00000000..82c048ea --- /dev/null +++ b/xts5/Xproto/pTranslateCoords/pTranslateCoords.m @@ -0,0 +1,259 @@ +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/Xproto/pTranslateCoords/pTranslateCoords.m,v 1.2 2005-11-03 08:44:22 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pTranslateCoords/pTranslateCoords.m +>># +>># Description: +>># Tests for TranslateCoords +>># +>># Modifications: +>># $Log: trnsltcrds.m,v $ +>># Revision 1.2 2005-11-03 08:44:22 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:10 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:24 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:36 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:08 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:02 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:05 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE TranslateCoords Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for TranslateCoords request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Another_Window; +xCreateWindowReq *cwr; +xTranslateCoordsReq *req; +xTranslateCoordsReply *rep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent default CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Another_Window = cwr->wid; + Free_Req(cwr); + + Set_Test_Type(CLIENT, test_type); + req = (xTranslateCoordsReq *) Make_Req(CLIENT, X_TranslateCoords); + req->dstWid = Another_Window; + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default TranslateCoords request\n", CLIENT); + if ((rep = (xTranslateCoordsReply *) Expect_Reply(CLIENT, X_TranslateCoords)) == NULL) { + Log_Err("client %d failed to receive TranslateCoords reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received TranslateCoords reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(rep); + } + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent TranslateCoords request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong TranslateCoords request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server sends back a reply to the client +with the minimum required length. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back a reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUngrabButton/pUngrabButton.m b/xts5/Xproto/pUngrabButton/pUngrabButton.m new file mode 100644 index 00000000..8fea7815 --- /dev/null +++ b/xts5/Xproto/pUngrabButton/pUngrabButton.m @@ -0,0 +1,246 @@ +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/Xproto/pUngrabButton/pUngrabButton.m,v 1.2 2005-11-03 08:44:23 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUngrabButton/pUngrabButton.m +>># +>># Description: +>># Tests for UngrabButton +>># +>># Modifications: +>># $Log: ungrbbttn.m,v $ +>># Revision 1.2 2005-11-03 08:44:23 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:11 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:25 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:37 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:09 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:04 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:07 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UngrabButton Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UngrabButton request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabButtonReq *gbr; +xUngrabButtonReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gbr = (xGrabButtonReq *) Make_Req(CLIENT, X_GrabButton); + Send_Req(CLIENT, (xReq *) gbr); + Log_Trace("client %d sent default GrabButton request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(gbr); + + Set_Test_Type(CLIENT, test_type); + req = (xUngrabButtonReq *) Make_Req(CLIENT, X_UngrabButton); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UngrabButton request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UngrabButton request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UngrabButton request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUngrabKey/pUngrabKey.m b/xts5/Xproto/pUngrabKey/pUngrabKey.m new file mode 100644 index 00000000..ca547d56 --- /dev/null +++ b/xts5/Xproto/pUngrabKey/pUngrabKey.m @@ -0,0 +1,246 @@ +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/Xproto/pUngrabKey/pUngrabKey.m,v 1.2 2005-11-03 08:44:24 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUngrabKey/pUngrabKey.m +>># +>># Description: +>># Tests for UngrabKey +>># +>># Modifications: +>># $Log: ungrbky.m,v $ +>># Revision 1.2 2005-11-03 08:44:24 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:11 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:26 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:37 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:09 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:05 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:09 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UngrabKey Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UngrabKey request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabKeyReq *gkr; +xUngrabKeyReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gkr = (xGrabKeyReq *) Make_Req(CLIENT, X_GrabKey); + Send_Req(CLIENT, (xReq *) gkr); + Log_Trace("client %d sent default GrabKey request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(gkr); + + Set_Test_Type(CLIENT, test_type); + req = (xUngrabKeyReq *) Make_Req(CLIENT, X_UngrabKey); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UngrabKey request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UngrabKey request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UngrabKey request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUngrabKeyboard/pUngrabKeyboard.m b/xts5/Xproto/pUngrabKeyboard/pUngrabKeyboard.m new file mode 100644 index 00000000..0a669310 --- /dev/null +++ b/xts5/Xproto/pUngrabKeyboard/pUngrabKeyboard.m @@ -0,0 +1,259 @@ +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/Xproto/pUngrabKeyboard/pUngrabKeyboard.m,v 1.2 2005-11-03 08:44:24 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUngrabKeyboard/pUngrabKeyboard.m +>># +>># Description: +>># Tests for UngrabKeyboard +>># +>># Modifications: +>># $Log: ungrbkybrd.m,v $ +>># Revision 1.2 2005-11-03 08:44:24 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:12 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:27 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:38 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:10 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:06 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:11 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UngrabKeyboard Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UngrabKeyboard request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xGrabKeyboardReq *gkr; +xGrabKeyboardReply *gkrep; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gkr = (xGrabKeyboardReq *) Make_Req(CLIENT, X_GrabKeyboard); + Send_Req(CLIENT, (xReq *) gkr); + Log_Trace("client %d sent default GrabKeyboard request\n", CLIENT); + + if ((gkrep = (xGrabKeyboardReply *) Expect_Reply(CLIENT, X_GrabKeyboard)) == NULL) { + Log_Err("client %d failed to receive GrabKeyboard reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GrabKeyboard reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(gkrep); + } + (void) Expect_Nothing(CLIENT); + Free_Req(gkr); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_UngrabKeyboard); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UngrabKeyboard request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UngrabKeyboard request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UngrabKeyboard request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUngrabPointer/pUngrabPointer.m b/xts5/Xproto/pUngrabPointer/pUngrabPointer.m new file mode 100644 index 00000000..04033611 --- /dev/null +++ b/xts5/Xproto/pUngrabPointer/pUngrabPointer.m @@ -0,0 +1,259 @@ +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/Xproto/pUngrabPointer/pUngrabPointer.m,v 1.2 2005-11-03 08:44:24 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUngrabPointer/pUngrabPointer.m +>># +>># Description: +>># Tests for UngrabPointer +>># +>># Modifications: +>># $Log: ungrbpntr.m,v $ +>># Revision 1.2 2005-11-03 08:44:24 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:12 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:28 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:38 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:10 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:08 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:13 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UngrabPointer Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UngrabPointer request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xGrabPointerReq *gpr; +xGrabPointerReply *gprep; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gpr = (xGrabPointerReq *) Make_Req(CLIENT, X_GrabPointer); + Send_Req(CLIENT, (xReq *) gpr); + Log_Trace("client %d sent default GrabPointer request\n", CLIENT); + + if ((gprep = (xGrabPointerReply *) Expect_Reply(CLIENT, X_GrabPointer)) == NULL) { + Log_Err("client %d failed to receive GrabPointer reply\n", CLIENT); + Exit(); + } else { + Log_Trace("client %d received GrabPointer reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(gprep); + } + (void) Expect_Nothing(CLIENT); + Free_Req(gpr); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_UngrabPointer); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UngrabPointer request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UngrabPointer request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UngrabPointer request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUngrabServer/pUngrabServer.m b/xts5/Xproto/pUngrabServer/pUngrabServer.m new file mode 100644 index 00000000..1eb1405e --- /dev/null +++ b/xts5/Xproto/pUngrabServer/pUngrabServer.m @@ -0,0 +1,246 @@ +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/Xproto/pUngrabServer/pUngrabServer.m,v 1.2 2005-11-03 08:44:24 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUngrabServer/pUngrabServer.m +>># +>># Description: +>># Tests for UngrabServer +>># +>># Modifications: +>># $Log: ungrbsrvr.m,v $ +>># Revision 1.2 2005-11-03 08:44:24 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:13 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:29 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:39 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:11 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:09 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:16 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UngrabServer Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UngrabServer request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xReq *gsr; +xReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + + gsr = (xReq *) Make_Req(CLIENT, X_GrabServer); + Send_Req(CLIENT, (xReq *) gsr); + Log_Trace("client %d sent default GrabServer\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(gsr); + + Set_Test_Type(CLIENT, test_type); + req = (xReq *) Make_Req(CLIENT, X_UngrabServer); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UngrabServer request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UngrabServer request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UngrabServer request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUninstallColormap/pUninstallColormap.m b/xts5/Xproto/pUninstallColormap/pUninstallColormap.m new file mode 100644 index 00000000..01983fe8 --- /dev/null +++ b/xts5/Xproto/pUninstallColormap/pUninstallColormap.m @@ -0,0 +1,281 @@ +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/Xproto/pUninstallColormap/pUninstallColormap.m,v 1.2 2005-11-03 08:44:25 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUninstallColormap/pUninstallColormap.m +>># +>># Description: +>># Tests for UninstallColormap +>># +>># Modifications: +>># $Log: unnstllclr.m,v $ +>># Revision 1.2 2005-11-03 08:44:25 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:14 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:32 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:40 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:12 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:13 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:24 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UninstallColormap Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UninstallColormap request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xResourceReq *req; +xAllocColorCellsReply *reply; + +/* + intent: send an UninstallColormap request to the server and check + that nothing was sent back. + input: + output: none + global input: + side effects: creates a window resource. + installs and uninstalls a colormap. + methods: +*/ + +static +void +tester() +{ + + + Create_Client(CLIENT); + + (void) Create_Default_Window(CLIENT); + (void) Create_Default_Colormap(CLIENT); + + /* Allocate color cells if client hasn't got any */ + + if (Allocatable (CLIENT)) { + req = (xResourceReq *) Make_Req(CLIENT, X_AllocColorCells); + Send_Req(CLIENT, (xReq *) req); + if ((reply = (xAllocColorCellsReply *) Expect_Reply(CLIENT, X_AllocColorCells)) == NULL) { + Log_Err("client %d failed to receive AllocColorCells reply\n", CLIENT); + Exit(); + } + else { + Log_Trace("client %d received AllocColorCells reply\n", CLIENT); + /* do any reply checking here */ + Free_Reply(reply); + } + Free_Req(req); + } + (void) Expect_Nothing(CLIENT); + + req = (xResourceReq *) Make_Req(CLIENT, X_InstallColormap); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default InstallColormap request\n",CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_UninstallColormap); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UninstallColormap request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UninstallColormap request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UninstallColormap request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUnmapSubwindows/pUnmapSubwindows.m b/xts5/Xproto/pUnmapSubwindows/pUnmapSubwindows.m new file mode 100644 index 00000000..cc9ece83 --- /dev/null +++ b/xts5/Xproto/pUnmapSubwindows/pUnmapSubwindows.m @@ -0,0 +1,261 @@ +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/Xproto/pUnmapSubwindows/pUnmapSubwindows.m,v 1.2 2005-11-03 08:44:24 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUnmapSubwindows/pUnmapSubwindows.m +>># +>># Description: +>># Tests for UnmapSubwindows +>># +>># Modifications: +>># $Log: unmpsbws.m,v $ +>># Revision 1.2 2005-11-03 08:44:24 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:13 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:30 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:39 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:11 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:10 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:19 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UnmapSubwindows Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UnmapSubwindows request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xCreateWindowReq *cwr; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + + cwr = (xCreateWindowReq *) Make_Req(CLIENT, X_CreateWindow); + cwr->parent = Default_Window; + Send_Req(CLIENT, (xReq *) cwr); + Log_Trace("client %d sent additional CreateWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + Free_Req(cwr); + + req = (xResourceReq *) Make_Req(CLIENT, X_MapSubwindows); + Send_Req(CLIENT, (xReq *) req); + Log_Trace("client %d sent default MapSubwindows\n", CLIENT); + + /* Don't expect to see Expose event because the parent is not + mapped. */ + (void) Expect_Nothing(CLIENT); + Free_Req(req); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_UnmapSubwindows); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UnmapSubwindows request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UnmapSubwindows request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UnmapSubwindows request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the parent window is not mapped, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pUnmapWindow/pUnmapWindow.m b/xts5/Xproto/pUnmapWindow/pUnmapWindow.m new file mode 100644 index 00000000..d5fd8069 --- /dev/null +++ b/xts5/Xproto/pUnmapWindow/pUnmapWindow.m @@ -0,0 +1,244 @@ +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/Xproto/pUnmapWindow/pUnmapWindow.m,v 1.2 2005-11-03 08:44:25 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pUnmapWindow/pUnmapWindow.m +>># +>># Description: +>># Tests for UnmapWindow +>># +>># Modifications: +>># $Log: unmpwdw.m,v $ +>># Revision 1.2 2005-11-03 08:44:25 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:14 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:31 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:40 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:11 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:12 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:22 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE UnmapWindow Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for UnmapWindow request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +Window Default_Window; +xResourceReq *req; + +static +void +tester() +{ + Create_Client(CLIENT); + + Default_Window = Create_Default_Window(CLIENT); + Map_Window(CLIENT, Default_Window); + + Set_Test_Type(CLIENT, test_type); + req = (xResourceReq *) Make_Req(CLIENT, X_UnmapWindow); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default UnmapWindow request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent UnmapWindow request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong UnmapWindow request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an UnmapNotify event. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server sends back an UnmapNotify event. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); diff --git a/xts5/Xproto/pWarpPointer/pWarpPointer.m b/xts5/Xproto/pWarpPointer/pWarpPointer.m new file mode 100644 index 00000000..06b9504d --- /dev/null +++ b/xts5/Xproto/pWarpPointer/pWarpPointer.m @@ -0,0 +1,241 @@ +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/Xproto/pWarpPointer/pWarpPointer.m,v 1.2 2005-11-03 08:44:26 jmichael Exp $ + +Copyright (c) Applied Testing and Technology, Inc. 1995 +All Rights Reserved. + +>># Project: VSW5 +>># +>># File: xts5/tset/Xproto/pWarpPointer/pWarpPointer.m +>># +>># Description: +>># Tests for WarpPointer +>># +>># Modifications: +>># $Log: wrppntr.m,v $ +>># Revision 1.2 2005-11-03 08:44:26 jmichael +>># clean up all vsw5 paths to use xts5 instead. +>># +>># Revision 1.1.1.2 2005/04/15 14:06:02 anderson +>># Reimport of the base with the legal name in the copyright fixed. +>># +>># Revision 8.0 1998/12/23 23:33:15 mar +>># Branch point for Release 5.0.2 +>># +>># Revision 7.0 1998/10/30 22:54:33 mar +>># Branch point for Release 5.0.2b1 +>># +>># Revision 6.0 1998/03/02 05:24:40 tbr +>># Branch point for Release 5.0.1 +>># +>># Revision 5.0 1998/01/26 03:21:12 tbr +>># Branch point for Release 5.0.1b1 +>># +>># Revision 4.0 1995/12/15 09:07:15 tbr +>># Branch point for Release 5.0.0 +>># +>># Revision 3.1 1995/12/15 01:07:27 andy +>># Prepare for GA Release +>># +/* + +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. + +Copyright 1990, 1991 by UniSoft Group Limited. + +Permission to use, copy, modify, distribute, and sell this software and +its documentation for any purpose is hereby granted without fee, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the 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. + +Copyright 1989 by Sequent Computer Systems, Inc., Portland, Oregon + + All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appears in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the name of Sequent not be used +in advertising or publicity pertaining to distribution or use of the +software without specific, written prior permission. + +SEQUENT DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS; IN NO EVENT SHALL +SEQUENT BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. +*/ +>>TITLE WarpPointer Xproto +>>SET startup protostartup +>>SET cleanup protocleanup +>>EXTERN +/* Touch test for WarpPointer request */ + +#include "Xstlib.h" + +#define CLIENT 0 +static TestType test_type = SETUP; +xWarpPointerReq *req; +xEvent *ev; + +static +void +tester() +{ + Create_Client(CLIENT); + + Set_Test_Type(CLIENT, test_type); + req = (xWarpPointerReq *) Make_Req(CLIENT, X_WarpPointer); + Send_Req(CLIENT, (xReq *) req); + Set_Test_Type(CLIENT, GOOD); + switch(test_type) { + case GOOD: + Log_Trace("client %d sent default WarpPointer request\n", CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case BAD_LENGTH: + Log_Trace("client %d sent WarpPointer request with bad length (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + case TOO_LONG: + case JUST_TOO_LONG: + Log_Trace("client %d sent overlong WarpPointer request (%d)\n", CLIENT, req->length); + (void) Expect_BadLength(CLIENT); + (void) Expect_Nothing(CLIENT); + break; + default: + Log_Err("INTERNAL ERROR: test_type %d not one of GOOD(%d), BAD_LENGTH(%d), TOO_LONG(%d) or JUST_TOO_LONG(%d)\n", + test_type, GOOD, BAD_LENGTH, TOO_LONG, JUST_TOO_LONG); + Abort(); + /*NOTREACHED*/ + break; + } + Free_Req(req); + Exit_OK(); +} +>>ASSERTION Good A +When a client sends a valid xname protocol request to the X server, +and the client has no event selected in the +.M event_mask +for any window, +then the X server does not send back an error, event or reply to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +Open a connection to the X server using reversed byte sex. +Send a valid xname protocol request to the X server. +Verify that the X server does not send back an error, event or reply. +>>CODE + + test_type = GOOD; + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad A +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request is not the minimum length required to +contain the request, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one less than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. + +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the minimum length required to contain the request. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = BAD_LENGTH; /* < minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + + test_type = JUST_TOO_LONG; /* > minimum */ + + /* Call a library function to exercise the test code */ + testfunc(tester); + +>>ASSERTION Bad B 1 +When a client sends an invalid xname protocol request to the X server, +in which the length field of the request exceeds the maximum length accepted +by the X server, +then the X server sends back a BadLength error to the client. +>>STRATEGY +Call library function testfunc() to do the following: +Open a connection to the X server using native byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +Open a connection to the X server using reversed byte sex. +Send an invalid xname protocol request to the X server with length + one greater than the maximum length accepted by the server. +Verify that the X server sends back a BadLength error. +>>CODE + + test_type = TOO_LONG; + + /* Call a library function to exercise the test code */ + testfunc(tester); |