>># 
>># 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: opndsply.m,v 1.16 92/06/11 16:00:58 rws Exp $
>># 
>>#
>>TITLE XOpenDisplay CH02
>>ASSERTION C XOpenDisplay-1
If the system is POSIX compliant and supports DECnet: When
the display_name argument is a string of the form
hostname::number.screen_num, then a call to XOpenDisplay
returns a pointer to a display structure and opens a
connection to display server number number on hostname with
default screen screen_number.
>>STRATEGY
If the system is POSIX compliant and supports DECnet transport:
  Obtain the display and screen numbers by parsing the XT_DISPLAY config variable.
  Open a connection using XOpenDisplay.
  Verify that the call did not return NULL.
  Issue a NoOperation request using XNoOp.
  Flush the Output buffer using XFlush.
  Close the display using XCloseDisplay.
>>ASSERTION C XOpenDisplay-2
If the system is POSIX compliant and supports DECnet: When
the display_name argument is a string of the form
hostname::number, then a call to XOpenDisplay returns a
pointer to a display structure and opens a connection to
display server number number on hostname with default screen
0.
>>STRATEGY
If the system is POSIX compliant and supports DECnet transport:
  Obtain the display numbers by parsing the XT_DISPLAY config variable.
  Open a connection of the form host::number using XOpenDisplay.
  Verify that the call did not return NULL.
  Obtain the screen number using XDefaultScreen.
  Verify that the screen number is 0.
  Close the display using XCloseDisplay.
>>ASSERTION C XOpenDisplay-3
If the system is POSIX compliant and supports TCP: When the
display_name argument is a string of the form
hostname:number.screen_num, then a call to XOpenDisplay
returns a pointer to a display structure and opens a
connection to display server number number on hostname with
default screen screen_number.
>>STRATEGY
If the system is POSIX compliant and supports TCP transport:
  Obtain the display and screen numbers by parsing the XT_DISPLAY config variable.
  Open a connection using XOpenDisplay.
  Verify that the call did not return NULL.
  Issue a NoOperation request using XNoOp.
  Flush the Output buffer using XFlush.
  Close the display using XCloseDisplay.
>>ASSERTION C XOpenDisplay-4
If the system is POSIX compliant and supports TCP: When the
display_name argument is a string of the form
hostname:number, then a call to XOpenDisplay returns a
pointer to a display structure and opens a connection to
display server number number on hostname with default screen
0.
>>STRATEGY
If the system is POSIX compliant and supports TCP transport:
  Obtain the display numbers by parsing the XT_DISPLAY config variable.
  Open a connection of the form host:number using XOpenDisplay.
  Verify that the call did not return NULL.
  Obtain the screen number using XDefaultScreen.
  Verify that the screen number is 0.
  Close the display using XCloseDisplay.
>>ASSERTION C XOpenDisplay-5
If the system is POSIX compliant: When the display_name
argument is NULL, then a call to XOpenDisplay opens a
connection specified by the value of the DISPLAY environment
variable.
>>STRATEGY
Fork a child process using tet_fork.
In child:
  Exec the file "./Test1" with the environment variable DISPLAY set to the value of XT_DISPLAY config variable.
  Open the display NULL using XOpenDisplay.
  Obtain the actual display string used using XDisplayString.
  Obtain the value of the DISPLAY environment variable using getvar.
  Verify that these values are the same.
>>ASSERTION D XOpenDisplay-6
If the system is POSIX compliant and supports DECnet and a
local display server: When the display_name argument is a
string of the form ::number.screen_num or ::number, then a
call to XOpenDisplay opens the most efficient transport
connection available to the specified display server and
default screen on the client machine.
>>STRATEGY
If the system is POSIX compliant and supports DECnet and a local display server:
  Obtain the display and screen numbers from XT_DISPLAY.
  Open a connection of the form ::number.display.
  Verify that the call did not return NULL.
  Issue a NoOperation request using XNoOp.
  Flush the Output buffer using XFlush.
  Close the display using XCloseDisplay.
  Open a connection of the form ::number .
  Verify that the call did not return NULL.
  Issue a NoOperation request using XNoOp.
  Flush the Output buffer using XFlush.
  Close the display using XCloseDisplay.
>>ASSERTION D XOpenDisplay-7
If the system is POSIX compliant and supports TCP and a
local display server: When the display_name argument is a
string of the form :number.screen_num or :number, then a
call to XOpenDisplay opens the most efficient transport
connection available to the specified display server and
default screen on the client machine.
>>STRATEGY
If the system is POSIX compliant and supports TCP and a local display server:
  Obtain the display and screen numbers from XT_DISPLAY.
  Open a connection of the form :number.display.
  Verify that the call did not return NULL.
  Issue a NoOperation request using XNoOp.
  Flush the Output buffer using XFlush.
  Close the display using XCloseDisplay.
  Open a connection of the form :number .
  Verify that the call did not return NULL.
  Issue a NoOperation request using XNoOp.
  Flush the Output buffer using XFlush.
  Close the display using XCloseDisplay.
>>ASSERTION A XOpenDisplay-8
When a call to XOpenDisplay is successful, then all of the
screens in the display can be used by the client.
>>STRATEGY
For each screen:
	Obtain the root window ID of the alternate screen.
	Obtain the window attributes of that window using XGetWindowAttributes.
	Verify that the call returned non zero.
>>ASSERTION A XOpenDisplay-9
On a call to XOpenDisplay the RESOURCE_MANAGER property of
the root window of screen 0 is read and stored.
>>STRATEGY
Get the RESOURCE_MANAGER property of the root window on screen 0 
	using XGetWindowProperty.
Open a display using XOpenDisplay.
Verify that the call did not return NULL.
Obtain the value of the RESOURCE_MANAGER property using XResourceManagerString.
Verify that the value of the property is correct.
>>ASSERTION A XOpenDisplay-10
When a call to XOpenDisplay is not successful, then it
returns NULL.
>>STRATEGY
Open a display with hostname as the argument using XOpenDisplay.
Verify that the call returned NULL.
