1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
|
/* $XConsortium$ */
#include <stdio.h>
#include <X11/Xlib.h>
char *test_displays[] = {
":0",
":1",
":2",
"unix:0",
"unix:1",
"unix:2",
"local:0",
"local:1",
"local:2",
THISHOST":0",
THISHOST":1",
THISHOST":2",
"local/:0",
"local/:1",
"local/:2",
"local/"THISHOST":0",
"local/"THISHOST":1",
"local/"THISHOST":2",
"tcp/"THISHOST":0",
"tcp/"THISHOST":1",
"tcp/"THISHOST":2",
"inet/"THISHOST":0",
"inet/"THISHOST":1",
#ifdef STREAMSCONN
"tli/"THISHOST":0",
"tli/"THISHOST":1",
#endif
#ifdef DNETCONN
"::0",
"::1",
THISHOST"::0",
THISHOST"::1",
"local/::0",
"local/::1",
"decnet/"THISHOST"::0",
"decnet/"THISHOST"::1",
"decnet/"THISHOST":0",
"decnet/"THISHOST":1",
#endif
#ifdef LOCALCONN
"pts/"THISHOST":0",
"pts/"THISHOST":1",
"named/"THISHOST":0",
"named/"THISHOST":1",
"ics/"THISHOST":0",
"ics/"THISHOST":1",
"sco/"THISHOST":0",
"sco/"THISHOST":1",
#endif
};
#define NUMDISPLAYS (sizeof(test_displays)/sizeof(char *))
int numpassed=0;
int numfailed=0;
main(argc, argv)
int argc;
char *argv[];
{
int i, count;
Display *disp;
char **displays;
if (argc > 1)
{
count = argc - 1;
displays = &argv[1];
}
else
{
count = NUMDISPLAYS;
displays = test_displays;
}
for( i=0; i<count; i++ )
{
fprintf(stderr,"** Opening %s\n",displays[i]);
disp=XOpenDisplay(displays[i]);
if( disp == NULL )
{
fprintf(stderr,"%%%% Failed to open %s\n",displays[i]);
numfailed++;
}
else
{
numpassed++;
fprintf(stderr,"** Successful\n");
XCloseDisplay(disp);
}
fprintf(stderr,"\n");
}
fprintf(stderr,"Pass: %d\tFail: %d\tTotal: %d\n",
numpassed, numfailed, numpassed+numfailed );
}
|