Debian Codegraph @

PerlMagick/t/x11/write.t

raw
1 #!/usr/bin/perl
2 #
3 # Test accessing X11 server
4 #
5 # Contributed by Bob Friesenhahn <[email protected]>
6 #
7
8 BEGIN { $| = 1; $test=1; print "1..2\n"; }
9 END {print "not ok $test\n" unless $loaded;}
10 use Image::Magick;
11 $loaded=1;
12
13 require 't/subroutines.pl';
14
15 chdir 't/x11' || die 'Cd failed';
16
17
18 # 1) Test reading and displaying an image
19 #
20 if ( 0 && defined($ENV{'DISPLAY'}) && ($^O ne 'MSWin32') ) {
21 $image=Image::Magick->new;
22 $x=$image->ReadImage('congrats.gif');
23 if( "$x" ) {
24 print "not ok $test\n";
25 } else {
26 $x = $image->Display(delay=>800);
27 if( "$x" ) {
28 print "not ok $test\n";
29 } else {
30 print "ok $test\n";
31 }
32 }
33 undef $image;
34 } else {
35 print "ok $test\n";
36 }
37
38 # 2) Test XWD image file
39 #
40 print("X Windows system window dump file (color) ...\n");
41 ++$test;
42 testReadWrite( 'XWD:input.xwd',
43 'XWD:output.xwd',
44 q//,
45 'fb6fc68beb3b1001c5ebaa671c8ac8fddea06995027127765ff508f77723cc52');