Browse files

Patching up some problems with with the test suite.

  • Loading branch information...
1 parent 6763963 commit 666858ca30fa003cb86730541c533e7822b8e66a Aaron Marburg committed Apr 13, 2012
Showing with 8 additions and 7 deletions.
  1. +1 −1 test/core/test_text.rb
  2. +1 −0 test/ext/test_vector_math.rb
  3. +3 −4 test/setup.rb
  4. +2 −2 test/test_highgui.rb
  5. +1 −0 test/wrappers/features2d/test_surf.rb
View
2 test/core/test_text.rb
@@ -5,7 +5,7 @@
class TestCoreTextFunctions < Test::Unit::TestCase
def setup
- @img = CVFFI::cvLoadImageM( TEST_IMAGE_FILE, CVFFI::CV_LOAD_IMAGE_COLOR )
+ @img = TestSetup.test_image
end
View
1 test/ext/test_vector_math.rb
@@ -44,6 +44,7 @@ def test_L2distance
def test_L2distance_8u
Benchmark.bm(10) do |x|
a = Array.new( 1000 ) { |i| rand(256) }
+ a.extend InjectWithIndex
b = Array.new( 1000 ) { |i| rand(256) }
l2dist = 0.0
View
7 test/setup.rb
@@ -47,10 +47,9 @@ def self.image_accessor( name, key = nil )
image_accessor :tiny_test
image_accessor :second
- #def self.dull_image; image( :dull ); end;
- #def self.test_image; image( :one ); end;
- #def self.small_test_image; image( :one_small ); end;
- #def self.second_test_image; image( :two ); end;
+ def self.test_mat
+ CVFFI::cvLoadImageM( IMAGES[:test], CVFFI::CV_LOAD_IMAGE_COLOR )
+ end
def self.grey_test_image
img = test_image
View
4 test/test_highgui.rb
@@ -5,7 +5,7 @@
class TestFFI < Test::Unit::TestCase
def test_cvLoadImageM_cvSaveImage
- cvmat = CVFFI::cvLoadImageM( TEST_IMAGE_FILE, CVFFI::CV_LOAD_IMAGE_COLOR )
+ cvmat = TestSetup::test_mat
assert_not_nil cvmat
assert_equal cvmat.width, 3888
@@ -15,7 +15,7 @@ def test_cvLoadImageM_cvSaveImage
end
def test_cvLoadImageM_cvSaveImage
- iplimage = CVFFI::cvLoadImage( TEST_IMAGE_FILE, CVFFI::CV_LOAD_IMAGE_COLOR )
+ iplimage = TestSetup::test_image
assert_not_nil iplimage
assert_equal iplimage.width, 3888
View
1 test/wrappers/features2d/test_surf.rb
@@ -8,6 +8,7 @@
class TestSURF < Test::Unit::TestCase
def setup
+ @img = TestSetup::test_image
end

0 comments on commit 666858c

Please sign in to comment.