blob: 2d3a084f587d2cbf0bf6594839660f5bebae9c38 [file] [log] [blame]
cristy3ed852e2009-09-05 21:47:34 +00001#!/usr/bin/perl
2#
3# Test accessing X11 server
4#
5# Contributed by Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
6#
7
8BEGIN { $| = 1; $test=1; print "1..2\n"; }
9END {print "not ok $test\n" unless $loaded;}
10use Image::Magick;
11$loaded=1;
12
13require 't/subroutines.pl';
14
15chdir 't/x11' || die 'Cd failed';
16
17
18# 1) Test reading and displaying an image
19#
20if ( 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#
40print("X Windows system window dump file (color) ...\n");
41++$test;
42testReadWrite( 'XWD:input.xwd',
43 'XWD:output.xwd',
44 q//,
45 'a698f2fe0c6c31f83d19554a6ec02bac79c961dd9a87e7ed217752e75eb615d7');