~ubuntu-branches/ubuntu/lucid/perl-tk/lucid

« back to all changes in this revision

Viewing changes to t/photo.t

  • Committer: Bazaar Package Importer
  • Author(s): Colin Tuckley
  • Date: 2008-02-15 13:56:59 UTC
  • mfrom: (1.1.3 upstream) (4.1.1 hardy)
  • Revision ID: james.westby@ubuntu.com-20080215135659-ru2oqlykuju20fav
Tags: 1:804.028-1
* New Upstream Release (Closes: #463080).
* Update to Debhelper v5.
* Build with XFT=1 (Closes: #411129).

Show diffs side-by-side

added added

removed removed

Lines of Context:
14
14
my $mw  = MainWindow->new();
15
15
$mw->geometry('+100+100');
16
16
 
17
 
plan tests => (2*(7 * $numFormats) + 2);
 
17
plan tests => (2*(7 * $numFormats) + 2 + 2);
18
18
 
19
19
my @files = ();
20
20
 
82
82
 $row += 3;
83
83
}
84
84
 
 
85
# Extra tests
 
86
my $col = 0;
 
87
$mw->Label(-text => "Extra tests")->grid(-row => $row++, -column => $col);
 
88
my $file = Tk->findINC('Xcamel.gif');
 
89
my $data = do { open my $fh, $file or die $!; binmode $fh; local $/; <$fh> };
 
90
 
 
91
if ($Tk::VERSION <= 804.027)
 
92
 {
 
93
  skip("Binary GIF data not supported",1,1);
 
94
 }
 
95
else
 
96
 {
 
97
  my $image = $mw->Photo(-data => $data);
 
98
  ok(defined $image, 1, "Read binary GIF data");
 
99
  $mw->Label(-background => 'white', -image => $image)->grid(-row => $row, -column => $col);
 
100
  $mw->update;
 
101
 }
 
102
$col++;
 
103
 
 
104
if (!eval { require MIME::Base64; 1 })
 
105
 {
 
106
  skip("Need MIME::Base64 module",1,1);
 
107
 }
 
108
else
 
109
 {
 
110
  my $image = $mw->Photo(-data => MIME::Base64::encode_base64($data));
 
111
  ok(defined $image, 1, "Read base64 encoded GIF data");
 
112
  $mw->Label(-background => 'white', -image => $image)->grid(-row => $row, -column => $col);
 
113
  $mw->update;
 
114
 }
 
115
$col++;
 
116
 
85
117
$mw->after(2500,[destroy => $mw]);
86
118
MainLoop;
87
119