"Fossies" - the Fresh Open Source Software Archive

Member "Apache-Gallery-1.0.2/t/002_graphlibs.t" (8 Jun 2011, 1031 Bytes) of package /linux/www/old/Apache-Gallery-1.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested text file into HTML format (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file.

    1 use Test::More;
    2 use Apache::Gallery;
    3 use Image::Size qw(imgsize);
    4 
    5 eval { require Apache::FakeRequest; };
    6 if ($@) {
    7   plan skip_all => 'skip Apache::FakeRequest not found';
    8 }
    9 else {
   10 
   11   plan tests => 4;
   12 
   13   my $request = Apache::FakeRequest->new('get_remote_host' => 'localhost');
   14 
   15 	Apache::Gallery::resizepicture($request, 't/002_inpng.png', 't/inpng-resized.png', 10, 10, 0, '');
   16 	Apache::Gallery::resizepicture($request, 't/002_injpg.jpg', 't/injpg-resized.jpg', 10, 10, 0, '');
   17 	my ($pngwidth, $pngheight)=imgsize('t/inpng-resized.png');
   18 	my ($jpgwidth, $jpgheight)=imgsize('t/injpg-resized.jpg');
   19 
   20 	is  ($pngwidth, 10, 'PNG Width') or diag('You need to install libpng before libimlib');
   21 	is  ($pngheight, 10, 'PNG Height') or diag('You need to install libpng before libimlib');
   22 	is  ($jpgwidth, 10, 'JPG Width') or diag('You need to install libjpeg before libimlib');
   23 	is  ($jpgheight, 10, 'JPG Height') or diag('You need to install libjpeg before libimlib');
   24 
   25 	unlink('t/inpng-resized.png');
   26 	unlink('t/injpg-resized.jpg');
   27 
   28 }