File: t60dyntest.t

package info (click to toggle)
libimager-perl 1.012%2Bdfsg-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye
  • size: 6,376 kB
  • sloc: perl: 31,562; ansic: 27,846; makefile: 53; cpp: 4
file content (50 lines) | stat: -rw-r--r-- 1,293 bytes parent folder | download | duplicates (7)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
#!perl -w
use strict;
use lib '../t';
use Test::More tests => 8;
BEGIN { use_ok(Imager => qw(:default)); }
use Config;
use Imager::Test qw(test_image);

#$Imager::DEBUG=1;

-d "testout" or mkdir "testout";

Imager->open_log(log => 'testout/t60dyntest.log');

my $img=Imager->new() || die "unable to create image object\n";

$img->read(file=>'../testimg/penguin-base.ppm',type=>'pnm') 
  || die "failed: ",$img->{ERRSTR},"\n";

my $plug='./dyntest.'.$Config{'so'};
ok(load_plugin($plug), "load plugin")
  || die "unable to load plugin: $Imager::ERRSTR\n";

my %hsh=(a=>35,b=>200,type=>'lin_stretch');
ok($img->filter(%hsh), "call filter");

$img->write(type=>'pnm',file=>'testout/linstretch.ppm') 
  || die "error in write()\n";

ok(unload_plugin($plug), "unload plugin")
  || die "unable to unload plugin: $Imager::ERRSTR\n";

{
  my $flines = "./flines.$Config{so}";
  ok(load_plugin($flines), "load flines");
  my $im = test_image();
  ok($im->filter(type => "flines"), "do the flines test");
  ok($im->write(file => "testout/flines.ppm"), "save flines result");
  ok(unload_plugin($flines), "unload flines");
}

Imager->close_log;

unless ($ENV{IMAGER_KEEP_FILES}) {
  unlink "testout/linstretch.ppm";
  unlink "testout/flines.ppm";
  unlink "testout/t60dyntest.log";
  rmdir "testout";
}