1
0
Fork 0
mirror of https://github.com/ruby-opencv/ruby-opencv synced 2023-03-27 23:22:12 -04:00

fixed a bug of CvMat#repeat, and c

This commit is contained in:
ser1zw 2011-01-02 07:07:02 +09:00
parent 3b36804879
commit 2b1f00eda8
2 changed files with 3 additions and 3 deletions

View file

@ -1374,7 +1374,7 @@ rb_reshape(VALUE self, VALUE hash)
VALUE
rb_repeat(VALUE self, VALUE object)
{
if (rb_obj_is_kind_of(object, rb_class()))
if (!rb_obj_is_kind_of(object, rb_class()))
rb_raise(rb_eTypeError, "argument should be CvMat subclass.");
cvRepeat(CVARR(self), CVARR(object));
return object;

View file

@ -594,11 +594,11 @@ class TestCvMat < OpenCVTestCase
end
def test_repeat
m1 = create_cvmat(2, 3)
m1 = create_cvmat(2, 3, :cv8u, 3)
assert_raise(TypeError) {
m1.repeat(1)
}
m2 = CvMat.new(6, 9)
m2 = CvMat.new(6, 9, :cv8u, 3)
m2 = m1.repeat(m2)
m2.height.times { |j|
m2.width.times { |i|