a couple of new smoke tests; Mat.java code clean-up

This commit is contained in:
Andrey Pavlenko
2011-07-25 15:09:16 +00:00
parent 322b09fc12
commit 55e71a5cd7
3 changed files with 83 additions and 97 deletions

View File

@@ -60,8 +60,12 @@ public class MatTest extends OpenCVTestCase {
assertEquals(CvType.CV_32F, gray0_32f.depth());
}
public void testDispose() {
fail("Not yet implemented");
public void testRelease() {
assertTrue( gray0.empty() == false );
assertTrue( gray0.rows() > 0 );
gray0.release();
assertTrue( gray0.empty() == true );
assertTrue( gray0.rows() == 0 );
}
public void testDot() {

View File

@@ -161,16 +161,31 @@ public class coreTest extends OpenCVTestCase {
Scalar color = new Scalar(128);
assertTrue(0 == Core.countNonZero(gray0));
Core.circle(gray0, center, radius, color, -1);
Core.circle(gray0, center, radius, color, -1 /*filled circle*/);
assertTrue(0 != Core.countNonZero(gray0));
}
public void testCircleMatPointIntScalarIntInt() {
fail("Not yet implemented");
Point center = new Point(gray0.cols() / 2, gray0.rows()/2);
int radius = Math.min(gray0.cols()/4, gray0.rows()/4);
Scalar color = new Scalar(128);
assertTrue(0 == Core.countNonZero(gray0));
Core.circle(gray0, center, radius, color, 2, 4/*4-connected line*/);
assertTrue(0 != Core.countNonZero(gray0));
}
public void testCircleMatPointIntScalarIntIntInt() {
fail("Not yet implemented");
Point center = new Point(gray0.cols() / 2, gray0.rows()/2);
Point center2 = new Point(gray0.cols(), gray0.rows());
int radius = Math.min(gray0.cols()/4, gray0.rows()/4);
Scalar color128 = new Scalar(128);
Scalar color0 = new Scalar(0);
assertTrue(0 == Core.countNonZero(gray0));
Core.circle(gray0, center2, radius*2, color128, 2, 4, 1/*Number of fractional bits*/);
Core.circle(gray0, center, radius, color0, 2, 4, 0);
assertTrue(0 == Core.countNonZero(gray0));
}
public void testClipLine() {