cristy | 3ed852e | 2009-09-05 21:47:34 +0000 | [diff] [blame^] | 1 | #!/usr/bin/perl
|
| 2 | #
|
| 3 | # Test accessing X11 server
|
| 4 | #
|
| 5 | # Contributed by Bob Friesenhahn <bfriesen@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 ( defined($ENV{'DISPLAY'}) ) {
|
| 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 | 'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');
|