>># 
>># Copyright 1990, 1991 by the Massachusetts Institute of Technology and
>># UniSoft Group Limited.
>># 
>># Permission to use, copy, modify, distribute, and sell this software and
>># its documentation for any purpose is hereby granted without fee,
>># provided that the above copyright notice appear in all copies and that
>># both that copyright notice and this permission notice appear in
>># supporting documentation, and that the names of MIT and UniSoft not be
>># used in advertising or publicity pertaining to distribution of the
>># software without specific, written prior permission.  MIT and UniSoft
>># make no representations about the suitability of this software for any
>># purpose.  It is provided "as is" without express or implied warranty.
>># 
>># $XConsortium: chngwdwatt.m,v 1.16 92/06/11 16:03:25 rws Exp $
>># 
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#
>>TITLE XChangeWindowAttributes CH03
>>ASSERTION A XChangeWindowAttributes-1
A call to XChangeWindowAttributes changes the window
attributes specified in valuemask to the values in the
attributes structure.
>>STRATEGY
Create window with default attributes.
Change the window attributes to non-default values.
Get the window attributes with XGetWindowAttributes.
Verify that they are the same as the ones set.
>>ASSERTION A XChangeWindowAttributes-2
When the background is changed, then the window contents do
not change.
>>STRATEGY
Create a window.
Set the background-pixmap
Map window over a plain background.
Change background-pixmap to a patterned tile.
Verify that background has not changed.
>>ASSERTION A XChangeWindowAttributes-3
When the border is changed or the background set such that
the border tile origin changes, then the border is
repainted.
>>STRATEGY
Create a window.
Set the border-pixmap
Map window over a patterned background.
Change border-pixmap 
Verify that border has changed by pixel checking.
Create a window, with no border, and a tiled background.
Create a child window, with a parent relative background and a border pixmap.
Map windows.
Save image.
Change the child window background causing the border pixmap to be retiled
because the border_tile origin will change.
Verify the border changed.
>>ASSERTION B XChangeWindowAttributes-4
When the background-pixmap attribute of a root window is
set to None, then the default background pixmap is
restored.
>>STRATEGY
Report UNTESTED
>>ASSERTION B XChangeWindowAttributes-5
When the background-pixmap attribute of a root window is
set to ParentRelative, then the default background pixmap
is restored.
>>STRATEGY
Report UNTESTED
>>ASSERTION B XChangeWindowAttributes-6
When the border-pixmap attribute of a root window is set to
CopyFromParent, then the default border pixmap is restored.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XChangeWindowAttributes-7
When the win-gravity attribute is changed, then the current
position of the window is not changed.
>>STRATEGY
Create window
Ascertain window position by calling XGetWindowAttributes
Change win-gravity by calling XChangeWindowAttributes
Ascertain window position by calling XGetWindowAttributes
Verify window position is unchanged.
>>ASSERTION A XChangeWindowAttributes-8
When the colormap attribute of a window is changed, then a
ColormapNotify event is generated.
>>STRATEGY
Create window
Select ColormapNotify event
Create Colormap for the window
Change the window colormap by calling XChangeWindowAttributes
Verify that a ColormapNotify event was generated
>>ASSERTION A XChangeWindowAttributes-9
When more than one client sets a mask other than
SubstructureRedirectMask, ResizeRedirectMask, and
ButtonPressMask in the event-mask attribute, then the
selected events are delivered to each such client.
>>STRATEGY
Create client1.
Create window with client1.
Select MapNotify events with client1 on this window.
Create client2.
Select MapNotify events with client2 on this window.
Map window.
Verify that client1 received a single MapNotify event for this window.
Verify that client1 received no other events.
Verify that client2 received a single MapNotify event for this window.
Verify that client2 received no other events.
>>ASSERTION A XChangeWindowAttributes-10
When the event-mask attribute is changed, then the
event-mask attribute does not change for other clients.
>>STRATEGY
Create client1.
Create window with client1.
Select NoEventMask events with client1 on this window.
Call XGetWindowAttributes to get event mask for client1 for window.
Verify event mask is as expected.
Create client2.
Select ALLEVENTS events with client2 on this window.
Call XGetWindowAttributes to get event mask for client2 for window.
Verify event mask is as expected.
Call XGetWindowAttributes to get event mask for client1 for window.
Verify event mask has not changed.
Select KeyPressMask events with client1 on this window.
Call XGetWindowAttributes to get event mask for client1 for window.
Verify event mask is as expected.
Call XGetWindowAttributes to get event mask for client2 for window.
Verify event mask has not changed.
>>ASSERTION B XChangeWindowAttributes-11
When the cursor attribute of a root window is changed to
None, then the default cursor is restored.
>>STRATEGY
If extended testing is required:
  If the server supports two screens with the same default cursor:
    Set the root window cursor to a non-default cursor.
    Verify that the cursor was set correctly.
    Warp the pointer into the root window.
    Verify that the current cursor is that of the root window.
    Warp the pointer to the alternate root window.
    Verify that the current cursor is not the same as that of the default root window.
    Reset the cursor of the root window to the default cursor using XChangeWindowAttributes.
    Verify that the current cursor is the same as that of the default root window.
  Otherwise :
    Set the root window cursor to a non-default cursor.
    Verify that the cursor was set correctly.
    Warp the pointer to the root window.
    Verify that the current cursor is that of the root window.
    Reset the cursor of the root window to the default cursor using XChangeWindowAttributes.
    Verify that the root window cursor is no longer the non-default cursor.
>>ASSERTION A XChangeWindowAttributes-12
When the do-not-propagate-mask attribute is changed, then
the change is effective for all clients.
>>STRATEGY
Create client1.
Create window with client1.
Call XGetWindowAttributes to get do-not-propagate-mask for client1 for window.
Verify do-not-propagate-mask is as expected.
Create client2.
Call XGetWindowAttributes to get do-not-propagate-mask for client2 for window.
Verify do-not-propagate-mask is as expected.
Set do-not-propagate-mask to KeyPressMask events with client1 on this window.
Call XGetWindowAttributes to get do-not-propagate-mask for client1 for window.
Verify do-not-propagate-mask has changed.
Call XGetWindowAttributes to get do-not-propagate-mask for client2 for window.
Verify do-not-propagate-mask has changed.
>>ASSERTION A XChangeWindowAttributes-13
When the background-pixmap attribute is set to None and the
background_pixel attribute is not being set at the same
time, then the window has no defined background.
>>STRATEGY
Set background-pixmap attribute to None.
Map window over a patterned background.
Verify that contents of the window are the same as the parent's.
>>ASSERTION A XChangeWindowAttributes-14
When the background-pixmap attribute is set to
ParentRelative, then each time the background pixmap is
required it is taken from the parent window at the time that
it is required, with the background tile origin aligned with
the origin of the parent window.
>>STRATEGY
Set background-pixmap to ParentRelative.
For a variety of parent backgrounds
  Clear child window.
  Verify that background changes to that set for the parent.
>>ASSERTION A XChangeWindowAttributes-15
When both background_pixel and background_pixmap are
specified, then background_pixel overrides background_pixmap.
>>STRATEGY
Set both the background-pixel attribute and the background-pixmap attribute.
Map and clear window to ensure background is refreshed.
Verify that background is set to the pixel value.
>>ASSERTION A XChangeWindowAttributes-16
When background_pixel is specified, then it is truncated to
the depth of the window.
>>STRATEGY
For each visual
  Try variety of background pixel values.
  Verify that they are truncated to depth using checkarea.
>>ASSERTION A XChangeWindowAttributes-17
When border_pixmap is CopyFromParent, then the
border-pixmap attribute is copied from the parent window.
>>STRATEGY
Create parent window.
Set parent border-pixmap attribute.
Set child window border-pixmap to CopyFromParent.
Ensure that window is mapped.
Pixmap verify to check that border is correct.
>>ASSERTION A XChangeWindowAttributes-18
When border_pixel is specified, then the value is truncated
to the depth of the window.
>>STRATEGY
For each visual
  Set border-pixel to various values.
  Read one pixel back from the border.
  Verify that this pixel has been truncated to depth of window.
>>ASSERTION A XChangeWindowAttributes-19
When colormap is CopyFromParent, then the colormap
attribute is copied from the parent window.
>>STRATEGY
Set colormap attribute to CopyFromParent.
Get attribute values.
Verify that colormap is same as for parent.
>>ASSERTION B XChangeWindowAttributes-20
When the cursor attribute is set to None, then the cursor
of the parent window is used for the window and any change
in the parent window's cursor will cause an immediate change
in the window's cursor.
>>STRATEGY
If extended testing is required:
  Create a parent window.
  Set the parent's cursor to a non-default cursor.
  Verify that the parent's cursor was set correctly.
  If XCreateWindow:
    Create a child window using XChangeWindowAttributes.
  Otherwise:
    Create and map a child window.
    Change the cursor attribute of the window to None using XChangeWindowAttributes.
  Warp the pointer to the child window.
  Verify that the current cursor is that of the parent.
  Verify that the child's cursor was set correctly.
  Set the parent's cursor to a different cursor.
  Verify that the parent's cursor was set correctly.
  Verify that the current cursor has changed to that of the parent.
>>ASSERTION A XChangeWindowAttributes-21
When a window argument does not name a valid Window, then a
BadWindow error occurs.
>>STRATEGY
Create a bad window by creating and destroying a window.
Call test function using bad window as the window argument.
Verify that a BadWindow error occurs.
>>ASSERTION A XChangeWindowAttributes-22
When background_pixmap is not a valid pixmap, None, or
ParentRelative, then a BadPixmap error occurs.
>>STRATEGY
Call XChangeWindowAttributes with background_pixmap set to an invalid value.
Verify that a BadPixmap error occurs.
>>ASSERTION A XChangeWindowAttributes-23
When border_pixmap is not a valid pixmap or CopyFromParent,
then a BadPixmap error occurs.
>>STRATEGY
Call XChangeWindowAttributes with border_pixmap set to an invalid value.
Verify that a BadPixmap error occurs.
>>ASSERTION A XChangeWindowAttributes-24
When colormap is not a valid Colormap resource or
CopyFromParent, then a BadColor error occurs.
>>STRATEGY
Call XChangeWindowAttributes with colormap set to an invalid value.
Verify that a BadColor error occurs.
>>ASSERTION A XChangeWindowAttributes-25
When cursor is not a valid Cursor resource or None, then a
BadCursor error occurs.
>>STRATEGY
Call XChangeWindowAttributes with cursor set to an invalid value.
Verify that a BadCursor error occurs.
>>ASSERTION A XChangeWindowAttributes-26
When the window has class InputOnly and valuemask contains
a bit set other than CWWinGravity, CWEventMask,
CWDontPropagate, CWOverrideRedirect and CWCursor, then a
BadMatch error occurs.
>>STRATEGY
Set value mask to contain invalid bits.
Verify in each case, that a BadMatch error occurs.
>>ASSERTION C XChangeWindowAttributes-27
If windows with depth other than one are supported: When
background_pixmap and the window do not have the same depth,
then a BadMatch error occurs.
>>STRATEGY
Use depth of 1 for the pixmap.
Find a visual not of depth 1.
If not such a visual
  UNSUPPORTED
else
  Attempt to set background_pixmap to the depth 1 pixmap.
  Verify that a BadMatch error occurs.
>>ASSERTION C XChangeWindowAttributes-28
If multiple screens are supported: When background_pixmap
and the window are not created for the same screen, then a
BadMatch error occurs.
>>STRATEGY
If there is a pixmap depth on the alternate screen that has the same
depth as a visual on the test screen then
  Create pixmap on alternate screen.
  Attempt to set background-pixmap with the pixmap
  Verify that a BadMatch error occurs.
else
  UNSUPPORTED
>>ASSERTION C XChangeWindowAttributes-29
If multiple window depths are supported: When
background_pixmap is ParentRelative and the window and the
parent window do not have the same depth, then a BadMatch
error occurs.
>>STRATEGY
If two different depth windows are supported.
  Create window with different depth to parent.
  Attempt to set background_pixmap to ParentRelative.
  Verify that a BadMatch error occurs.
else
  UNSUPPORTED.
>>ASSERTION A XChangeWindowAttributes-30
When colormap and the window are not created for the same
screen, then a BadMatch error occurs.
>>STRATEGY
If multiple screens are supported:
  Obtain visual information about the alternate screen.
  Determine a visual type shared between the main and alternate screen.
  Create a colormap on the alternate screen.
  Attempt to set the colormap.
  Verify that a BadMatch error occurs.
else
  UNSUPPORTED
>>ASSERTION A XChangeWindowAttributes-31
When colormap and the window do not have the same visual
type, then a BadMatch error occurs.
>>STRATEGY
If two different visual types are supported:
  Create colour map of different visual to window.
  Attempt to set colourmap to created colour map.
  Verify that a BadMatch error occurs.
else
  UNSUPPORTED.
>>ASSERTION A XChangeWindowAttributes-32
When colormap is CopyFromParent and the parent window has a
colormap of None, then a BadMatch error occurs.
>>STRATEGY
Create a window with a colormap.
Free the colormap the window.
Call function with colormap of CopyFromParent.
Verify BadMatch error occurred.
>>ASSERTION A XChangeWindowAttributes-33
When the window has class InputOnly and border_width is not
zero, then a BadMatch error occurs.
>>STRATEGY
Set border_width to contain non zero.
Verify that a BadMatch error occurs.
>>ASSERTION A XChangeWindowAttributes-34
When bit_gravity is other than ForgetGravity,
NorthWestGravity, NorthGravity, NorthEastGravity,
WestGravity, CenterGravity, EastGravity, SouthWestGravity,
SouthGravity, SouthEastGravityor StaticGravity, then a
BadValue error occurs.
>>STRATEGY
Set bit_gravity to a bad value.
Verify that BadValue is generated.
>>ASSERTION A XChangeWindowAttributes-35
When win_gravity is other than UnmapGravity,
NorthWestGravity, NorthGravity, NorthEastGravity,
WestGravity, CenterGravity, EastGravity, SouthWestGravity,
SouthGravity, SouthEastGravityor StaticGravity, then a
BadValue error occurs.
>>STRATEGY
Set win_gravity to a bad value.
Verify that BadValue is generated.
>>ASSERTION A XChangeWindowAttributes-36
When backing_store is other than NotUseful, WhenMapped or
Always, then a BadValue error occurs.
>>STRATEGY
Set backing_store to a bad value.
Verify that BadValue is generated.
>>ASSERTION A XChangeWindowAttributes-37
When save_under is other than True or False, then a
BadValue error occurs.
>>STRATEGY
Set save_under to a bad value.
Verify that BadValue is generated.
>>ASSERTION A XChangeWindowAttributes-38
When event_mask is other than a bitwise OR of any of
NoEventMask, KeyPressMask, KeyReleaseMask,
ButtonPressMask, ButtonReleaseMask, EnterWindowMask,
LeaveWindowMask, PointerMotionMask, PointerMotionHintMask,
Button1MotionMask, Button2MotionMask, Button3MotionMask,
Button4MotionMask, Button5MotionMask, ButtonMotionMask,
KeymapStateMask, ExposureMask, VisibilityChangeMask,
StructureNotifyMask, ResizeRedirectMask,
SubstructureNotifyMask, SubstructureRedirectMask,
FocusChangeMask, PropertyChangeMask, ColormapChangeMask or
OwnerGrabButtonMask, then a BadValue error occurs.
>>STRATEGY
Set event_mask to a bad value.
Verify that BadValue is generated.
>>ASSERTION A XChangeWindowAttributes-39
When do_not_propagate_mask is other than a bitwise OR of
any of NoEventMask, KeyPressMask, KeyReleaseMask,
ButtonPressMask, ButtonReleaseMask, EnterWindowMask,
LeaveWindowMask, PointerMotionMask, PointerMotionHintMask,
Button1MotionMask, Button2MotionMask, Button3MotionMask,
Button4MotionMask, Button5MotionMask, ButtonMotionMask,
KeymapStateMask, ExposureMask, VisibilityChangeMask,
StructureNotifyMask, ResizeRedirectMask,
SubstructureNotifyMask, SubstructureRedirectMask,
FocusChangeMask, PropertyChangeMask, ColormapChangeMask or
OwnerGrabButtonMask, then a BadValue error occurs.
>>STRATEGY
Set do_not_propagate_mask to a bad value.
Verify that BadValue is generated.
>>ASSERTION A XChangeWindowAttributes-40
When override_redirect is other than True or False, then a
BadValue error occurs.
>>STRATEGY
Set override_redirect to a bad value.
Verify that BadValue is generated.
>>ASSERTION C XChangeWindowAttributes-41
If windows with depth other than one are supported: When
border_pixmap and the window do not have the same depth,
then a BadMatch error occurs.
>>STRATEGY
If a window with depth other than one is supported:
  Attempt to set border_pixmap with depth one.
  Verify that a BadMatch error occurs with a window depth other than one.
else
  UNSUPPORTED.
>>ASSERTION C XChangeWindowAttributes-42
If multiple window depths are supported: When border_pixmap
is CopyFromParent, and the window does not have the same
depth as the parent window, then a BadMatch error occurs.
>>STRATEGY
If two different depth windows are supported.
  Create window with different depth to parent.
  Attempt to set border_pixmap to CopyFromParent.
  Verify that a BadMatch error occurs.
else
  UNSUPPORTED.
>>ASSERTION A XChangeWindowAttributes-43
When colormap is CopyFromParent and the window does not
have the same visual type as the parent window, then a
BadMatch error occurs.
>>STRATEGY
If two different visual types are supported:
  Create a parent of one visual type
  Attempt to set colourmap to CopyFromParent on window of different visual type.
  Verify that a BadMatch error occurs.
else
  UNSUPPORTED.
>>ASSERTION A XChangeWindowAttributes-44
When another client has selected with an event mask
SubstructureRedirectMask, then on a call to
XChangeWindowAttributes with SubstructureRedirectMask bits
set in event_mask a BadAccess error occurs.
>>STRATEGY
Create window with client1.
Select SubstructureRedirectMask event mask with client1 on this window.
Create client2.
Call XChangeWindowAttributes with an event_mask set to SubstructureRedirectMask using client2
on this window.
Verify that a BadAccess error was generated.
>>ASSERTION A XChangeWindowAttributes-45
When another client has selected with an event mask
ResizeRedirectMask, then on a call to
XChangeWindowAttributes with ResizeRedirectMask bits set in
event_mask a BadAccess error occurs.
>>STRATEGY
Create client1.
Create window with client1.
Select ResizeRedirectMask event mask with client1 on this window.
Create client2.
Call XChangeWindowAttributes with an event_mask of ResizeRedirectMask using client2 on
this window.
Verify that a BadAccess error was generated.
>>ASSERTION A XChangeWindowAttributes-46
When another client has selected with an event mask
ButtonPressMask, then on a call to XChangeWindowAttributes
with ButtonPressMask bits set in event_mask a BadAccess
error occurs.
>>STRATEGY
Create client1.
Create window with client1.
Select ButtonPressMask event mask with client1 on this window.
Create client2.
Call XChangeWindowAttributes with event_mask ButtonPressMask using client2 on this window.
Verify that a BadAccess error was generated.
