Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (28 sloc) 0.956 kb
40e78f9 @tonycoz RT#65088 make sure each test script that needs testout/ creates it
authored
1 -d "testout" or mkdir "testout";
2
9a5744d Fixed warnings for 5.004_04.
Arnar Mar Hrafnkelsson authored
3 Imager::init("log"=>'testout/t68map.log');
40eba1e Fixes to i_map function and map method. Added a testcase for both.
Arnar Mar Hrafnkelsson authored
4
5 use Imager qw(:all :handy);
6
7 print "1..5\n";
8
9 my $imbase = Imager::ImgRaw::new(200,300,3);
10
11
12 @map1 = map { int($_/2) } 0..255;
13 @map2 = map { 255-int($_/2) } 0..255;
14 @map3 = 0..255;
15 @maps = 0..24;
16 @mapl = 0..400;
17
18 $tst = 1;
19
20 i_map($imbase, [ [], [], \@map1 ]);
9495ee9 Added documentation to map method in Imager.pm and made some minor fixes
Arnar Mar Hrafnkelsson authored
21 print "ok ".$tst++."\n";
40eba1e Fixes to i_map function and map method. Added a testcase for both.
Arnar Mar Hrafnkelsson authored
22 i_map($imbase, [ \@map1, \@map1, \@map1 ]);
23
9495ee9 Added documentation to map method in Imager.pm and made some minor fixes
Arnar Mar Hrafnkelsson authored
24 print "ok ".$tst++."\n";
40eba1e Fixes to i_map function and map method. Added a testcase for both.
Arnar Mar Hrafnkelsson authored
25 i_map($imbase, [ \@map1, \@map2, \@map3 ]);
26
9495ee9 Added documentation to map method in Imager.pm and made some minor fixes
Arnar Mar Hrafnkelsson authored
27 print "ok ".$tst++."\n";
40eba1e Fixes to i_map function and map method. Added a testcase for both.
Arnar Mar Hrafnkelsson authored
28 i_map($imbase, [ \@maps, \@mapl, \@map3 ]);
29
30 # test the highlevel interface
31 # currently this requires visual inspection of the output files
32
33
34 my $im = Imager->new;
35 if ($im->read(file=>'testimg/scale.ppm')) {
9495ee9 Added documentation to map method in Imager.pm and made some minor fixes
Arnar Mar Hrafnkelsson authored
36 print( ( $im->map(red=>\@map1, green=>\@map2, blue=>\@map3) ? "ok " : "not ok ").$tst++."\n" );
37 print( ( $im->map(maps=>[\@map1, [], \@map2]) ? "ok " : "not ok "). $tst++."\n");
40eba1e Fixes to i_map function and map method. Added a testcase for both.
Arnar Mar Hrafnkelsson authored
38 }
39 else {
40 die "could not load testout/scale.ppm\n";
41 }
Something went wrong with that request. Please try again.