>># 
>># 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: rprntwdw.m,v 1.5 92/06/11 17:15:57 rws Exp $
>># 
>>#      SCCS:  @(#)  EWin.mc Rel 1.4	    (7/19/91)
>>#
>>TITLE XReparentWindow CH07
>>ASSERTION A XReparentWindow-1
A call to XReparentWindow removes the specified window from
its current position in the hierarchy, and inserts it as the
child of the specified parent window at the position
specified by x and y.
>>STRATEGY
Build a window tree.
Call XReparentWindow to reparent window.
Verify that parent of window has changed.
Verify that the old parent no longer has the specified window as a child.
>>ASSERTION A XReparentWindow-2
When the specified window is mapped, then a call to
XReparentWindow automatically performs an UnmapWindow first,
and an UnmapNotify event is generated.
>>STRATEGY
Build a window tree.
Enable StructureNotify events on window.
Enable SubstructureNotify events on original parent.
Reparent window.
Verify that an UnmapNotify is generated on the old parent.
Verify that an UnmapNotify is generated on the window.
>>ASSERTION A XReparentWindow-3
The window is placed at the top of the stacking order with
respect to sibling windows.
>>STRATEGY
Build a window tree.
Reparent window.
Verify that it has been placed at the top of the stacking order.
>>ASSERTION A XReparentWindow-4
A call to XReparentWindow generates a ReparentNotify event
on the window and on both the old and new parent windows.
>>STRATEGY
Build a window tree.
Enable SubstructureNotify events on new parent.
Enable SubstructureNotify events on old parent.
Enable StructureNotify events on window.
Reparent window.
Verify ReparentNotify event generated on new parent.
Verify ReparentNotify event generated on old parent.
Verify ReparentNotify event generated on reparented window.
>>ASSERTION A XReparentWindow-5
When the specified window was originally mapped, then a
call to XReparentWindow automatically performs a MapWindow
request on it after the window is reparented, and a
MapRequest or MapNotify event is generated.
>>STRATEGY
Build window tree.
Enable StructureNotify on window.
Enable SubstructureNotify on new parent.
Reparent window with XReparentWindow.
Verify that MapNotify is received on window.
Verify that MapNotify is received on parent.

Build window tree.
Create second client.
Enable SubstructureRedirect for second client on new parent.
Reparent window with XReparentWindow.
Verify that MapRequest is received for second client on parent.
>>ASSERTION A XReparentWindow-6
When a call to XReparentWindow uncovers part of any window
that was formerly obscured, then either Expose events are
generated or the contents are restored from backing store.
>>STRATEGY
Build window tree.
Use WinB as old parent and B1 and window.
Enable expose events on old parent window.
Set up old parent window with setforexpose.
Call XReparentWindow to reparent window.
Verify correct expose processing with checkexpose().
>>ASSERTION B XReparentWindow-7
A call to XReparentWindow may generate Expose events for
regions uncovered by the initial UnmapWindow request that
are immediately obscured by the final MapWindow request.
>>STRATEGY
Report UNTESTED
>>ASSERTION C XReparentWindow-8
If multiple screens are supported: When the new parent
window is not on the same screen as the old parent window,
then a BadMatch error occurs.
>>STRATEGY
If multiple screens supported
  Create window on default screen.
  Create a new parent window on alternate screen.
  Attempt to reparent to alternate screen.
  Verify BadMatch error occurs.
else
  UNSUPPORTED
>>ASSERTION A XReparentWindow-9
When the new parent window is the specified window, then a
BadMatch error occurs.
>>STRATEGY
Create window.
Call XReparentWindow with both window parameters set to this window.
Verify BadMatch error.
>>ASSERTION A XReparentWindow-10
When the new parent window is an inferior of the specified
window, then a BadMatch error occurs.
>>STRATEGY
Build window tree.
Set w.
Set parent to an inferior of w.
Call XReparentWindow.
Verify that a BadMatch error occurs.
>>ASSERTION C XReparentWindow-11
If multiple window depths are supported: When the specified
window has a ParentRelative background, and the new parent
window does not have the same depth as the specified window,
then a BadMatch error occurs.
>>STRATEGY
If only one window depth is supported
  UNSUPPORTED
Create window.
Set background to parent relative.
Create new parent window with depth not equal to window.
Call XReparentWindow.
Verify that BadMatch error occurs.
>>ASSERTION A XReparentWindow-12
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 XReparentWindow-13
When the new parent is InputOnly and the window is
InputOutput, then a BadMatch error occurs.
>>STRATEGY
Create an InputOnly window as the parent.
Create window.
Call XReparentWindow.
Verify that a BadMatch error occurs.
