clsdsply.m

Geoff Clare,,,, gwc at kemper.freedesktop.org
Fri May 12 03:42:00 PDT 2006


Update of /cvs/xtest/xts5/tset/Xlib3/clsdsply
In directory kemper:/tmp/cvs-serv19447

Modified Files:
	clsdsply.m 
Log Message:
In test 6 avoid using client2 in both parent and child by
calling XOpenDisplay() instead of opendisplay() and moving
the XCheckWindowEvent() on client2 into the child.


Index: clsdsply.m
===================================================================
RCS file: /cvs/xtest/xts5/tset/Xlib3/clsdsply/clsdsply.m,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -d -r1.2 -r1.3
--- clsdsply.m	3 Nov 2005 08:43:17 -0000	1.2
+++ clsdsply.m	12 May 2006 10:41:58 -0000	1.3
@@ -31,6 +31,11 @@
 >># 
 >># Modifications:
 >># $Log$
+>># Revision 1.3  2006/05/12 10:41:58  gwc
+>># In test 6 avoid using client2 in both parent and child by
+>># calling XOpenDisplay() instead of opendisplay() and moving
+>># the XCheckWindowEvent() on client2 into the child.
+>>#
 >># Revision 1.2  2005/11/03 08:43:17  jmichael
 >># clean up all vsw5 paths to use xts5 instead.
 >>#
@@ -396,19 +401,21 @@
 Wait sufficient time for the ChangeProperty request to be processed.
 Verify that no PropertyChange event has been generated by client2 using XCheckWindowEvent.
 Close the client1 connection using xname.
-Wait suffient time for the ChangeProperty request to be processed.
-Verify that a ChangeProperty request was generated by client2.
+In child process:
+    Wait suffient time for the ChangeProperty request to be processed.
+    Verify that a ChangeProperty request was generated by client2.
 >>EXTERN
 int	waittime = -1;
 Atom	at;
 Window	win;
 Display	*client2;
 char	*atname = "XT_TEST_Atom";
+static int t006p_pass = 0;
 static void
 t006p()
 {
 XEvent	ev;
-int	pass=0, fail=0;
+int	pass=0;
 
 	sleep(waittime);
 
@@ -422,18 +429,13 @@
 	
 	sleep(waittime);	
 	
-	if(XCheckWindowEvent(client2, win, PropertyChangeMask, &ev) == False) {
-		report("%s() did not ungrab the server.", TestName);
-		FAIL;
-	} else
-		CHECK;
-
-	CHECKPASS(2);
+	t006p_pass = pass;
 }
 
 static void
 t006c()
 {
+XEvent	ev;
 long	val;
 
 	val = 666;
@@ -441,6 +443,13 @@
 	XChangeProperty(client2, win, at, XA_INTEGER, 32, PropModeReplace, (unsigned char *) &val, 1);
 	XFlush(client2);
 	cleartimeout();
+	
+	sleep(2*waittime);	
+	
+	if(XCheckWindowEvent(client2, win, PropertyChangeMask, &ev) == False) {
+		exit(2);
+	}
+
 	exit(0);
 }
 >>CODE
@@ -455,7 +464,7 @@
 		return;
 	}
 
-	client2 = opendisplay();
+	client2 = XOpenDisplay(config.display);
 	
 	if(client2 == (Display *) NULL) {
 		delete("XOpenDisplay() returned NULL.");
@@ -470,8 +479,41 @@
 	XSync(display, False);
 	XFlush(client2);
 
-	if(tet_fork(t006c, t006p, waittime, 1) == TIMEOUT_EXIT)
+	switch(tet_fork(t006c, t006p, waittime, TIMEOUT_EXIT|2))
+	{
+	case TIMEOUT_EXIT:
 		delete("Child process timed out.");
+		break;
+	case 2:
+		report("%s() did not ungrab the server.", TestName);
+		FAIL;
+		break;
+	case 0:
+		CHECK;
+		break;
+	default:
+		/* tet_fork() failed */
+		return;
+	}
+
+	if (t006p_pass == 1)
+		CHECK;
+
+	/*
+	 * We need to close client2 otherwise it interferes with
+	 * later "last close" tests.  On POSIX systems we can
+	 * directly close the underlying fd.  On other systems
+	 * we use XCloseDisplay() and hope that the fact it was
+	 * used in the child doesn't cause a problem.
+	 */
+	if(config.posix_system == 1) {
+		close(ConnectionNumber(client2));
+	}
+	else {
+		XCloseDisplay(client2);
+	}
+
+	CHECKPASS(2);
 
 >>ASSERTION Good B 1
 A call to xname releases all passive grabs made by the client.



More information about the xorg-test-commit mailing list