>># 
>># 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: cnfgrwdw.m,v 1.11 92/06/11 16:04:01 rws Exp $
>># 
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#
>>TITLE XConfigureWindow CH03
>>ASSERTION A XConfigureWindow-1
When the CWX or the CWY bits are set in value_mask, then a
call to XConfigureWindow moves the window so that the
coordinates of the upper-left outer corner of the window are
x, y relative to the origin of the parent window.
>>STRATEGY
Create test window with background of W_FG.
Set x and y.
Call XConfigureWindow.
Verify that window has moved on screen with checkarea().
>>ASSERTION A XConfigureWindow-2
When the CWWidth or CWHeight bits are set in value_mask,
then on a call to XConfigureWindow the width and height of
the inside size of the window are set to width and height.
>>STRATEGY
Create test window with background of W_FG.
Set width and height.
Call XConfigureWindow.
Verify new size on screen with checkarea().
>>ASSERTION A XConfigureWindow-3
When a call to XConfigureWindow resizes the window, then
the subwindows of the window are repositioned according to
their win-gravity attribute and a GravityNotify event is
generated for each repositioned subwindow after the
ConfigureNotify event.
>>STRATEGY
For each win-gravity attribute (apart from UnmapGravity)
  Create window with subwindows.
  Enable SubstructureNotify|StructureNotify events on all windows.
  Set win-gravity on window.
  Call XConfigureWindow to resize window.
  Verify window positions by pixel check.
  Verify ConfigureNotify on resized window.
  Verify ConfigureNotify on parent of resized window.
  If NorthWestGravity || StaticGravity
    Verify that no gravity events are received.
  else
    Verify GravityNotify events received on each repositioned subwindow.
    Verify gravity events are received on the parent of each subwindow.
  Verify that configure events arrive before gravity events.
>>ASSERTION A XConfigureWindow-4
When a call to XConfigureWindow resizes the window and the
win-gravity of a subwindow is UnmapGravity and the subwindow
is already mapped, then the subwindow is unmapped without
being moved and an UnmapNotify event is generated.
>>STRATEGY
Create window with subwindows.
Enable events on all subwindows.
Enable events on window.
Set win-gravity to UnmapGravity.
Call XConfigureWindow to resize window.
Verify windows are removed from screen.
Verify window positions are unchanged.
Verify that UnmapNotify events received on each subwindow.
Verify that UnmapNotify events received on parent of each subwindow.
>>ASSERTION A XConfigureWindow-5
If the server uses the window's bit-gravity attribute: When
a call to XConfigureWindow resizes the window, then the
contents of the window are repositioned or discarded
according to the bit-gravity attribute. Otherwise: When a
call to XConfigureWindow resizes the window, then the
contents of the window are discarded.
>>STRATEGY
For each value of bit-gravity.
  Create window.
  Draw into window.
  Call XConfigureWindow to resize window.
  Verify that either:
	Window is clear.
  else
	Contents have been repositioned correctly.
>>ASSERTION A XConfigureWindow-6
When the CWBorderWidth bit is set in value_mask, then the
width of the border is set to border_width pixels.
>>STRATEGY
Create window.
Call XConfigureWindow to change border width.
Verify border by pixmap check.
>>ASSERTION A XConfigureWindow-7
When the CWSibling and CWStackMode bits are set in
value_mask and stack_mode is Above, then the window is
placed just above the sibling.
>>STRATEGY
Create stack of windows.
Set value to Above.
Set sibling to a window in the middle of the stacking order.
For each sibling of 'mid'.
  Call XConfigureWindow on the window.
  Verify that window is now one above sibling in stacking order.
  Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-8
When the CWSibling and CWStackMode bits are set in
value_mask and stack_mode is Below, then the window is
placed just below the sibling.
>>STRATEGY
Create stack of windows.
Set value to Below.
Set sibling to a window in the middle of the stacking order.
For each sibling window.
  Call XConfigureWindow on a window.
  Verify that window in now one below sibling in stacking order.
  Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-9
When the CWSibling and CWStackMode bits are set in
value_mask, stack_mode is TopIf and the sibling occludes
the window, then the window is placed at the top of the
stack.
>>STRATEGY
Create stack of windows.
Set value to TopIf.
Set sibling to a window in the middle of the stacking order.
Call XConfigureWindow on a window that is occluded by the sibling.
Verify that window in now at top of the stack.
Verify screen contents by pixmap checking.
Call XConfigureWindow on a window that is not occluded by the sibling.
Verify that window stacking position is unchanged.
>>ASSERTION A XConfigureWindow-10
When the CWSibling and CWStackMode bits are set in
value_mask, stack_mode is BottomIf and the window occludes
the sibling, then the window is placed at the bottom of the
stack.
>>STRATEGY
Create stack of windows.
Set value to BottomIf.
Set sibling to a window in the middle of the stacking order.
Call XConfigureWindow on a window that occludes the sibling.
Verify that window in now at bottom of the stack.
Verify screen contents by pixmap checking.
Call XConfigureWindow on a window that does not occlude the sibling.
Verify that window position is unchanged.
>>ASSERTION A XConfigureWindow-11
When the CWSibling and CWStackMode bits are set in
value_mask, stack_mode is Opposite and the window occludes
the sibling, then the window is placed at the bottom of the
stack.
>>STRATEGY
Create stack of windows.
Set value to Opposite.
Set sibling to a window in the middle of the stacking order.
Call XConfigureWindow on a window that occludes the sibling.
Verify that window is now at bottom of stack.
Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-12
When the CWSibling and CWStackMode bits are set in
value_mask, stack_mode is Opposite and the sibling occludes
the window, then the window is placed at the top of the
stack.
>>STRATEGY
Create stack of windows.
Set value to Opposite.
Set sibling to a window in the middle of the stacking order.
Call XConfigureWindow on a window that is occluded by the sibling.
Verify that window is at the top of the stack.
Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-13
When the CWStackMode bit is set and the CWSibling bit is
not set in value_mask and stack_mode is Above, then the
window is placed at the top of the stack.
>>STRATEGY
Create stack of windows.
Set value to Above.
Call XConfigureWindow on a window.
Verify that window is at top of stack.
Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-14
When the CWStackMode bit is set and the CWSibling bit is
not set in value_mask and stack_mode is Below, then the
window is placed at the bottom of the stack.
>>STRATEGY
Create stack of windows.
Set value to Below.
Call XConfigureWindow on a window.
Verify that window is at the bottom of the stack.
Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-15
When the CWStackMode bit is set and the CWSibling bit is
not set in value_mask, stack_mode is TopIf and a sibling
occludes the window, then the window is placed at the top of
the stack.
>>STRATEGY
Create stack of windows.
Set value to TopIf.
Call XConfigureWindow on a window that is occluded by a sibling.
Verify that window is at the top of the stack.
Verify screen contents by pixmap checking.
Call XConfigureWindow on a window that is not occluded by a sibling.
Verify that window stacking position is unchanged.
>>ASSERTION A XConfigureWindow-16
When the CWStackMode bit is set and the CWSibling bit is
not set in value_mask, stack_mode is BottomIf and the
window occludes a sibling, then the window is placed at the
bottom of the stack.
>>STRATEGY
Create stack of windows.
Set value to BottomIf.
Call XConfigureWindow on a window that occludes a sibling.
Verify that window is at the bottom of the stack.
Verify screen contents by pixmap checking.
Call XConfigureWindow on a window that does not occlude a sibling.
Verify that window stacking position is unchanged.
>>ASSERTION A XConfigureWindow-17
When the CWStackMode bit is set and the CWSibling bit is
not set in value_mask, stack_mode is Opposite and the
window occludes a sibling, then the window is placed at the
bottom of the stack.
>>STRATEGY
Create stack of windows.
Set value to Opposite.
Call XConfigureWindow on a window that occludes a sibling.
Verify that window is at the bottom of the stack.
Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-18
When the CWStackMode bit is set and the CWSibling bit is
not set in value_mask, stack_mode is Opposite and a sibling
occludes the window, then the window is placed at the top of
the stack.
>>STRATEGY
Create stack of windows.
Set value to Opposite.
Call XConfigureWindow on a window that is occluded by a sibling.
Verify that window is at the top of the stack.
Verify screen contents by pixmap checking.
>>ASSERTION A XConfigureWindow-19
When the geometry of the window is changed as well as a
restacking operation performed, then the window's final
geometry is used to determine whether the window occludes or
is occluded by siblings.
>>STRATEGY
Create stack of windows.
Set sibling to a window in the middle of the stack.
Choose window that is below sibling but is not currently occluded by it.
Set stack_mode to TopIf
Call XConfigureWindow to resize window so that it is now occluded by sibling.
Verify that the window is at the top of the stack.
>>ASSERTION - XConfigureWindow-20
Values not specified are taken from the existing geometry
of the window.
>>ASSERTION A XConfigureWindow-21
When the window is a root window, then a call to
XConfigureWindow has no effect.
>>STRATEGY
Call XConfigureWindow on root window.
Touch test only.
>>ASSERTION A XConfigureWindow-22
When the override-redirect attribute of the window is False
and some other client has selected SubstructureRedirectMask
on the parent window, then a ConfigureRequest event is
generated, and the window configuration is not changed.
>>STRATEGY
Create windows.
Set override-redirect to False.
Create second client.
Select SubstructureRedirectMask for second client on parent of window.
Set some parameters.
Call XConfigureWindow.
Verify that a ConfigureRequest event is generated.
Verify that window configuration has not changed on the screen.
>>ASSERTION A XConfigureWindow-23
When another client has selected ResizeRedirectMask on the
window and the size is being changed, then a ResizeRequest
event is generated and the size is not changed.
>>STRATEGY
Create windows.
Set override-redirect to False.
Create second client.
Select ResizeRedirectMask for second client on window.
Set parameters to move and resize window.
Call XConfigureWindow.
Verify that a ResizeRequest event is generated.
Verify that window has not changed size but that other changes have occurred.
>>ASSERTION A XConfigureWindow-24
When another client has selected ResizeRedirectMask on the
window and another client has selected
SubstructureRedirectMask on the parent window and the
override-redirect attribute of the window is False, then a
ConfigureRequest event is generated, and the window
configuration is not changed.
>>STRATEGY
Create windows.
Set override-redirect to False.
Create second client.
Select ResizeRedirectMask for second client on window.
Create third client.
Select SubstructureRedirectMask for third client on parent of window.
Call XConfigureWindow.
Verify that a ConfigureRequest event is generated for client 3.
Verify that no ResizeRequest event is generated for client 2.
Verify that window configuration is not changed.
>>ASSERTION A XConfigureWindow-25
When the configuration actually changes, then a
ConfigureNotify event is generated.
>>STRATEGY
Create windows.
Enable SubstructureNotify events.
Call XConfigureWindow such that the window configuration changes.
Verify that a ConfigureNotify event is generated.
Call XConfigureWindow again with the same parameters.
Verify that no ConfigureNotify event is generated.
>>ASSERTION A XConfigureWindow-26
When a call to XConfigureWindow changes the size of the
window, then Expose events are generated for regions that
are newly visible or for which the contents have been lost.
>>STRATEGY
Create windows.
Set test window background to W_BG.
Set up window with setforexpose().
Enable expose events.
Resize window with XConfigureWindow.
Verify that correct expose events were received with exposecheck().
>>ASSERTION A XConfigureWindow-27
When a call to XConfigureWindow uncovers part of any window
that was formerly obscured, then either Expose events are
generated or the contents are restored from backing store.
>>STRATEGY
Create windows.
Create second client to receive events on.
Call setforexpose() on unobscured window.
Create other windows to partially obscure this window.
Reconfigure window with XConfigureWindow, ensuring that first window is now unobscured.
Verify for correct expose or backing store behaviour with exposecheck().
>>ASSERTION A XConfigureWindow-28
When the window is moved without changing its size and the
window is mapped and the window is not obscured by
non-children, then the current window contents are not lost.
>>STRATEGY
Create window.
Draw pattern in window.
Move window without a size change.
Verify that window contents are unchanged.
>>ASSERTION D XConfigureWindow-29
If backing-store is supported when mapped: When the window
is moved without changing its size and the window is mapped
and backing store exists, then the current window contents
are not lost.
>>STRATEGY
Report UNTESTED
>>ASSERTION A XConfigureWindow-30
When CWSibling is set and CWStackMode is not set, then a
BadMatch error occurs.
>>STRATEGY
Set CWSibling only.
Call XConfigureWindow.
Verify that a BadMatch error occurs.
>>ASSERTION A XConfigureWindow-31
When sibling is specified and it is not actually a sibling,
then a BadMatch error occurs.
>>STRATEGY
Create windows.
Set sibling to parent of the child window.
Set stack_mode to Above.
Call XConfigureWindow.
Verify BadMatch error occurs.
>>ASSERTION A XConfigureWindow-32
When width or height is zero, then a BadValue error occurs.
>>STRATEGY
Set width to zero.
Call XConfigureWindow.
Verify BadValue error.
Set height to zero.
Call XConfigureWindow.
Verify BadValue error.
Set both width and height to zero.
Call XConfigureWindow.
Verify BadValue error.
>>ASSERTION A XConfigureWindow-33
When an attempt is made to set the border-width attribute
of an InputOnly window to a non-zero value, then a BadMatch
error occurs.
>>STRATEGY
Create input only window.
Attempt to set border-width.
Verify BadMatch error.
>>ASSERTION A XConfigureWindow-34
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.
