]> git.imager.perl.org - imager.git/commitdiff
Some tests were logging into the wrong files and t50basicoo.t was using
authorArnar Mar Hrafnkelsson <addi@cpan.org>
Tue, 15 May 2001 12:43:14 +0000 (12:43 +0000)
committerArnar Mar Hrafnkelsson <addi@cpan.org>
Tue, 15 May 2001 12:43:14 +0000 (12:43 +0000)
files that the now removed t10formats.t generated.  Now it uses the files
generated by t10{1,2,3,4,5,6}*.t.

Changes
t/t101jpeg.t
t/t106tiff.t
t/t50basicoo.t
t/t60dyntest.t

diff --git a/Changes b/Changes
index 85f5cd7bd62cd2b9d1a76db99d39effa63148182..69dd9b962bc162057613026c91f7450f2b26dd0e 100644 (file)
--- a/Changes
+++ b/Changes
@@ -431,9 +431,13 @@ Revision history for Perl extension Imager.
 
         - other internal image representations (design/represent.txt)
 
+       - Error handling, make a general i_errstr object and arrange
+          such that each image has an i_errstr object to hold its
+          local errors?
+
        Good stuff:
        - image colour transformations based on input images, see 
-       design/cmyktorgb.txt for Addi's description
+          design/cmyktorgb.txt for Addi's description
        - eventually support tiff's madness
 
         Old sins:
@@ -444,8 +448,8 @@ Revision history for Perl extension Imager.
         - Add mycalloc() and myrealloc() to the malloc() wrappers.
        
        - should i_readgif returned colormap be an arrayref of 
-       Imager::Color objects?  Note that this will break 
-       compatibility with previous releases.
+          Imager::Color objects?  Note that this will break 
+          compatibility with previous releases.
 
        - should Imager::Font be split into a base class whose  
        new chooses a base class (ttf, t1 or win32?) to 
index ccc1258d950d5534903173668dc2999076f00e89..c78c67b9e637fd02e78b0495f269616333c2c5b7 100644 (file)
@@ -21,14 +21,14 @@ if (!i_has_format("jpeg")) {
   print "ok 1 # skip no jpeg support\n";
   print "ok 2 # skip no jpeg support\n";
 } else {
-  open(FH,">testout/t11.jpg") || die "cannot open testout/t11.jpg for writing\n";
+  open(FH,">testout/t101.jpg") || die "cannot open testout/t101.jpg for writing\n";
   binmode(FH);
   i_writejpeg($img,fileno(FH),30);
   close(FH);
 
   print "ok 1\n";
   
-  open(FH,"testout/t11.jpg") || die "cannot open testout/t11.jpg\n";
+  open(FH,"testout/t101.jpg") || die "cannot open testout/t101.jpg\n";
   binmode(FH);
 
   ($cmpimg,undef)=i_readjpeg(fileno(FH));
index 17faa853156404cabbdb5842bbf0569b3d2d48ea..f74c847156ec038d983a3c960b94af88df88b39f 100644 (file)
@@ -1,7 +1,7 @@
 print "1..4\n";
 use Imager qw(:all);
 
-init_log("testout/t105gif.log",1);
+init_log("testout/t106tiff.log",1);
 
 $green=i_color_new(0,255,0,255);
 $blue=i_color_new(0,0,255,255);
@@ -24,7 +24,7 @@ if (!i_has_format("tiff")) {
   print "ok 2 # skip no tiff support\n";
   print "ok 3 # skip no tiff support\n";
 } else {
-  open(FH,">testout/t10.tiff") || die "cannot open testout/t10.tiff for writing\n";
+  open(FH,">testout/t106.tiff") || die "cannot open testout/t10.tiff for writing\n";
   binmode(FH); 
   my $IO = Imager::io_new_fd(fileno(FH));
   i_writetiff_wiol($img, $IO);
@@ -32,7 +32,7 @@ if (!i_has_format("tiff")) {
 
   print "ok 1\n";
   
-  open(FH,"testout/t10.tiff") or die "cannot open testout/t10.tiff\n";
+  open(FH,"testout/t106.tiff") or die "cannot open testout/t106.tiff\n";
   binmode(FH);
   $IO = Imager::io_new_fd(fileno(FH));
   $cmpimg = i_readtiff_wiol($IO, -1);
@@ -47,7 +47,7 @@ if (!i_has_format("tiff")) {
   Imager::i_writetiff_wiol($img, $IO) or die "Cannot write to bufferchain\n";
   my $tiffdata = Imager::io_slurp($IO);
 
-  open(FH,"testout/t10.tiff");
+  open(FH,"testout/t106.tiff");
   my $odata;
   { local $/;
     $odata = <FH>;
index f6b74f68389aa432f4df6736c96922539f982a50..fc43b9e0a4ce868ff5b1028b54253657db23ad1b 100644 (file)
@@ -9,14 +9,12 @@
 BEGIN { $| = 1; print "1..2\n"; }
 END {print "not ok 1\n" unless $loaded;}
 use Imager;
-#use Data::Dumper;
+
 $loaded = 1;
 
 print "ok 1\n";
 
-init_log("testout/t00basicoo.log",1);
-
-#list_formats();
+Imager::init(log=>"testout/t50basicoo.log");
 
 %hsh=%Imager::formats;
 
@@ -27,24 +25,28 @@ for(keys %hsh) { print "# $_\n"; }
 
 $img = Imager->new();
 
-@all=qw(tiff gif jpg png ppm raw);
-
-for(@all) {
-  if (!$hsh{$_}) { next; }
-  print "#opening Format: $_\n";
-  if ($_ eq "raw") {
-    $img->read(file=>"testout/t10.$_",type=>'raw', xsize=>150,ysize=>150) or die "failed: ",$img->{ERRSTR},"\n";
-  } else {
-    $img->read(file=>"testout/t10.$_") or die "failed: ",$img->{ERRSTR},"\n";
-  }
+@types = qw( jpeg png raw ppm gif tiff );
+
+@files{@types} = ({ file => "testout/t101.jpg"  },
+                 { file => "testout/t102.png"  },
+                 { file => "testout/t103.raw", xsize=>150, ysize=>150, type=>"raw" },
+                 { file => "testout/t104.ppm"  },
+                 { file => "testout/t105.gif"  },
+                 { file => "testout/t106.tiff" });
+
+for $type (@types) {
+  next unless $hsh{$type};
+  my %opts = %{$files{$type}};
+  my @a = map { "$_=>${opts{$_}}" } keys %opts;
+  print "#opening Format: $type, options: @a\n";
+  $img->read( %opts ) or die "failed: ",$img->errstr,"\n";
 }
 
-$img2=$img->crop(width=>50,height=>50);
-$img2->write(file=>'testout/t50.ppm',type=>'pnm');
+$img2=$img->crop(width=>50, height=>50);
+$img2->write(file=> 'testout/t50.ppm', type=>'pnm');
 
 undef($img);
 
-malloc_state();
-
+Imager::malloc_state();
 
 print "ok 2\n";
index 1fc3eabdb2c462659e57b2db04981720c616adb4..fddf8a2b5c6b2ba085ba5c35845408c4d80b54de 100644 (file)
@@ -10,7 +10,7 @@ Imager::init('log'=>'testout/t60dyntest.log');
 
 $img=Imager->new() || die "unable to create image object\n";
 
-$img->open(file=>'testout/t10.ppm',type=>'pnm') || die "failed: ",$img->{ERRSTR},"\n";
+$img->open(file=>'testout/t104.ppm',type=>'pnm') || die "failed: ",$img->{ERRSTR},"\n";
 
 $plug='dynfilt/dyntest.'.$Config{'so'};
 load_plugin($plug) || die "unable to load plugin:\n$Imager::ERRSTR\n";