[PATCH] xts5: Fix Xlib3/XOpenDisplay-10 by using an invalid TCP hostname

Aaron Plattner aplattner at nvidia.com
Mon Apr 30 11:17:23 PDT 2012


XOpenDisplay-10 calls XOpenDisplay(NULL) and expects it to fail.  This is bogus;
in fact XOpenDisplay-5 asserts exactly the opposite.

Instead, check for TCP support and then use a TCP display string with a bogus
hostname.  This would have caught http://bugs.debian.org/659558 .

Signed-off-by: Aaron Plattner <aplattner at nvidia.com>
Reviewed-by: José Soltren <jsoltren at nvidia.com>
---
 xts5/Xlib3/XOpenDisplay/XOpenDisplay.m |   17 +++++++++++++++--
 1 file changed, 15 insertions(+), 2 deletions(-)

diff --git a/xts5/Xlib3/XOpenDisplay/XOpenDisplay.m b/xts5/Xlib3/XOpenDisplay/XOpenDisplay.m
index e5822a8..5b46819 100644
--- a/xts5/Xlib3/XOpenDisplay/XOpenDisplay.m
+++ b/xts5/Xlib3/XOpenDisplay/XOpenDisplay.m
@@ -1083,14 +1083,27 @@ unsigned long	bytes_after_ret;
 	CHECKPASS(2);	
 
 >>ASSERTION Good A
+If the system is POSIX compliant and supports TCP:
 When a call to xname is not successful, then it returns NULL.
 >>STRATEGY
-Open a display with hostname as the argument using xname.
+Open a display with an invalid hostname as the argument using xname.
 Verify that the call returned NULL.
 >>CODE
 Display *display;
 
-	display_name = config.displayhost;
+	if(config.posix_system == 0) {
+		unsupported("This assertion can only be tested on a POSIX system.");
+		return;
+	} else
+		CHECK;
+
+	if(config.tcp == 0) {
+		unsupported("This assertion can only be tested on a system with support for TCP.");
+		return;
+	} else
+		CHECK;
+
+	display_name = "nowhere.invalid.:0";
 	display = XCALL;
 
 	if(display != (Display *) NULL) {
-- 
1.7.9.5



More information about the xorg-test mailing list