Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

composite method raises exception for negative offsets

  • Loading branch information...
commit bda43d71587209a3725b8a8bc6473ed411612208 1 parent bfcdf2b
rmagick authored
Showing with 3 additions and 2 deletions.
  1. +3 −2 test/Image1.rb
View
5 test/Image1.rb
@@ -721,8 +721,6 @@ def test_composite
# 4 argument form
assert_nothing_raised { img1.composite(img2, 0, 0, Magick::OverCompositeOp) }
- # negative offsets are transformed to 0
- assert_nothing_raised { img1.composite(img2, -10, -10, Magick::OverCompositeOp) }
# there's way too many CompositeOperators to test them all, so just try few representative ops
composite_ops.each do |op|
assert_nothing_raised { img1.composite(img2, 0, 0, op) }
@@ -747,6 +745,9 @@ def test_composite
end
assert_raise(TypeError) { img1.composite(img2, 0, 0, 2, Magick::OverCompositeOp) }
+ # negative offsets raise an exception
+ assert_raise(Magick::ImageMagickError) { img1.composite(img2, -10, -10, Magick::OverCompositeOp) }
+
img2.destroy!
assert_raise(Magick::DestroyedImageError) { img1.composite(img2, Magick::CenterGravity, Magick::OverCompositeOp) }
end
Please sign in to comment.
Something went wrong with that request. Please try again.