i'm not testing that imagemagick does it correctly...

This commit is contained in:
Doug Bell 2011-05-05 20:01:03 -05:00
parent 0693e33128
commit 6b0cd93e61
2 changed files with 14 additions and 14 deletions

View file

@ -29,7 +29,7 @@ my $cwd = Cwd::cwd();
my ($extensionTests, $fileIconTests, $block_extension_tests) = setupDataDrivenTests($session); my ($extensionTests, $fileIconTests, $block_extension_tests) = setupDataDrivenTests($session);
plan tests => 141 plan tests => 139
+ scalar @{ $extensionTests } + scalar @{ $extensionTests }
+ scalar @{ $fileIconTests } + scalar @{ $fileIconTests }
+ scalar @{ $block_extension_tests } + scalar @{ $block_extension_tests }
@ -586,9 +586,9 @@ $rotateTestStorage->rotate( $file, 90 );
# Test based on dimensions # Test based on dimensions
cmp_deeply( [ $rotateTestStorage->getSizeInPixels($file) ], [ 3, 2 ], "rotate: check if image was rotated by 90° CW (based on dimensions)" ); cmp_deeply( [ $rotateTestStorage->getSizeInPixels($file) ], [ 3, 2 ], "rotate: check if image was rotated by 90° CW (based on dimensions)" );
# Test based on single pixel # Test based on single pixel
my $image = new Image::Magick; #my $image = new Image::Magick;
$image->Read( $rotateTestStorage->getPath( $file ) ); #$image->Read( $rotateTestStorage->getPath( $file ) );
is( $image->GetPixel( x=>3, y=>1 ), 1, "rotate: check if image was rotated by 90° CW (based on pixels)"); #is( $image->GetPixel( x=>3, y=>1 ), 1, "rotate: check if image was rotated by 90° CW (based on pixels)");
# Rotate image by 90° CCW # Rotate image by 90° CCW
$rotateTestStorage->rotate( $file, -90 ); $rotateTestStorage->rotate( $file, -90 );
@ -596,9 +596,9 @@ $rotateTestStorage->rotate( $file, -90 );
# Test based on dimensions # Test based on dimensions
cmp_deeply( [ $rotateTestStorage->getSizeInPixels($file) ], [ 2, 3 ], "rotate: check if image was rotated by 90° CCW (based on dimensions)" ); cmp_deeply( [ $rotateTestStorage->getSizeInPixels($file) ], [ 2, 3 ], "rotate: check if image was rotated by 90° CCW (based on dimensions)" );
# Test based on single pixel # Test based on single pixel
my $image = new Image::Magick; #my $image = new Image::Magick;
$image->Read( $rotateTestStorage->getPath( $file ) ); #$image->Read( $rotateTestStorage->getPath( $file ) );
is( $image->GetPixel( x=>1, y=>1 ), 1, "rotate: check if image was rotated by 90° CCW (based on pixels)"); #is( $image->GetPixel( x=>1, y=>1 ), 1, "rotate: check if image was rotated by 90° CCW (based on pixels)");
#################################################### ####################################################
# #

View file

@ -63,7 +63,7 @@ my $extensionTests = [
}, },
]; ];
plan tests => 55 + scalar @{ $extensionTests }; # increment this value for each test you create plan tests => 53 + scalar @{ $extensionTests }; # increment this value for each test you create
my $session = WebGUI::Test->session; my $session = WebGUI::Test->session;
@ -295,9 +295,9 @@ $rotateTest->rotate($file, 90);
# Check dimensions # Check dimensions
cmp_bag( [$rotateTest->getSizeInPixels( $file )], [2,3], "Check size of photo after rotating 90° CW" ); cmp_bag( [$rotateTest->getSizeInPixels( $file )], [2,3], "Check size of photo after rotating 90° CW" );
# Check pixels # Check pixels
my $image = Image::Magick->new; #my $image = Image::Magick->new;
$image->Read( $rotateTest->getPath($file) ); #$image->Read( $rotateTest->getPath($file) );
is( $image->GetPixel(x=>2, y=>0), 0, "Pixel at location [2,0] should be black" ); #is( $image->GetPixel(x=>2, y=>0), 0, "Pixel at location [2,0] should be black" );
# Rotate test image by 90° CCW # Rotate test image by 90° CCW
my $file = $rotateTest->getFiles->[0]; my $file = $rotateTest->getFiles->[0];
@ -305,9 +305,9 @@ $rotateTest->rotate($file, -90);
# Check dimensions # Check dimensions
cmp_bag( [$rotateTest->getSizeInPixels( $file )], [3,2], "Check size of photo after rotating 90° CCW" ); cmp_bag( [$rotateTest->getSizeInPixels( $file )], [3,2], "Check size of photo after rotating 90° CCW" );
# Check pixels # Check pixels
$image = Image::Magick->new; #$image = Image::Magick->new;
$image->Read( $rotateTest->getPath($file) ); #$image->Read( $rotateTest->getPath($file) );
is( $image->GetPixel(x=>0, y=>0), 0, "Pixel at location [0,0] should be black" ); #is( $image->GetPixel(x=>0, y=>0), 0, "Pixel at location [0,0] should be black" );