Skip to content

Commit

Permalink
Add tests for new dither arguments to quantize
Browse files Browse the repository at this point in the history
  • Loading branch information
rmagick committed Sep 1, 2008
1 parent 4a4c780 commit 0a6e850
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
4 changes: 4 additions & 0 deletions test/Image3.rb
Expand Up @@ -64,6 +64,10 @@ def test_quantize
assert_nothing_raised { @img.quantize(256, cs) }
end
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, false) }
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, true) }
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, Magick::NoDitherMethod) }
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, Magick::RiemersmaDitherMethod) }
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, Magick::FloydSteinbergDitherMethod) }
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, true, 2) }
assert_nothing_raised { @img.quantize(256, Magick::RGBColorspace, true, 2, true) }
assert_raise(TypeError) { @img.quantize('x') }
Expand Down
5 changes: 5 additions & 0 deletions test/ImageList2.rb
Expand Up @@ -310,6 +310,11 @@ def test_quantize
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace) }
assert_raise(TypeError) { @ilist.quantize(128, 'x') }
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace, true, 0) }
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace, true) }
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace, false) }
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace, Magick::NoDitherMethod) }
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace, Magick::RiemersmaDitherMethod) }
assert_nothing_raised { @ilist.quantize(128, Magick::RGBColorspace, Magick::FloydSteinbergDitherMethod) }
assert_raise(TypeError) { @ilist.quantize(128, Magick::RGBColorspace, true, 'x' ) }
assert_raise(ArgumentError) { @ilist.quantize(128, Magick::RGBColorspace, true, 0, false, 'extra') }
end
Expand Down

0 comments on commit 0a6e850

Please sign in to comment.