1 #!/usr/bin/perl 2 # 3 # Test accessing X11 server 4 # 5 # Contributed by Bob Friesenhahn <bfriesen (at] simple.dallas.tx.us> 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.miff'); 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 '6a4a257921582768b774aeeac549b7c0c0b51f665395eddf921cce53a0ad2a33'); 46