import java.io.File;
import java.io.IOException;
-import java.util.Iterator;
+//import java.util.Iterator;
-import junit.framework.TestCase;
+//import junit.framework.TestCase;
import junit.framework.Assert;
import org.opencv.android.Utils;
//List<TestCase> testCases = androidTestRunner.getTestCases();
//Collections.shuffle(testCases); //shuffle the tests order
- if(OpenCVTestCase.passNYI) {
- // turn off problematic camera tests
- Iterator<TestCase> it = androidTestRunner.getTestCases().iterator();
- while (it.hasNext()) {
- String name = it.next().toString();
- if (name.contains("VideoCaptureTest"))
- it.remove();
- }
- }
+ // Note: VideoCapture tests turned off by flag field in VideoCaptureTest class
+
+// if(OpenCVTestCase.passNYI) {
+// // turn off problematic camera tests
+// Iterator<TestCase> it = androidTestRunner.getTestCases().iterator();
+// while (it.hasNext()) {
+// String name = it.next().toString();
+// if (name.contains("VideoCaptureTest"))
+// it.remove();
+// }
+// }
super.onStart();
import org.opencv.test.OpenCVTestCase;
import org.opencv.test.OpenCVTestRunner;
+import android.util.Log;
+
public class FASTFeatureDetectorTest extends OpenCVTestCase {
FeatureDetector detector;
detector.write(filename);
- String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.FAST</name>\n<nonmaxSuppression>1</nonmaxSuppression>\n<threshold>10</threshold>\n</opencv_storage>\n";
+ String truth = "<?xml version=\"1.0\"?>\n<opencv_storage>\n<name>Feature2D.FAST</name>\n<nonmaxSuppression>1</nonmaxSuppression>\n<threshold>10</threshold>\n<type>2</type>\n</opencv_storage>\n";
String data = readFile(filename);
-
+ Log.d("qqq", "\"" + data + "\"");
assertEquals(truth, data);
}
detector.write(filename);
- String truth = "%YAML:1.0\nname: \"Feature2D.FAST\"\nnonmaxSuppression: 1\nthreshold: 10\n";
+ String truth = "%YAML:1.0\nname: \"Feature2D.FAST\"\nnonmaxSuppression: 1\nthreshold: 10\ntype: 2\n";
String data = readFile(filename);
+ Log.d("qqq", "\"" + data + "\"");
assertEquals(truth, data);
}
}
super.setUp();
capture = null;
+ isEnabled = false;
isSucceed = false;
isOpened = false;
}
public void testGet() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
double frameWidth = capture.get(Highgui.CV_CAP_PROP_FRAME_WIDTH);
assertTrue(0 != frameWidth);
}
public void testGetSupportedPreviewSizes() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
List<Size> sizes = capture.getSupportedPreviewSizes();
assertNotNull(sizes);
}
public void testGrab() {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
capture = new VideoCapture();
isSucceed = capture.grab();
assertFalse(isSucceed);
}
public void testGrabFromRealCamera() {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
isSucceed = capture.grab();
}
public void testIsOpened() {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
capture = new VideoCapture();
assertFalse(capture.isOpened());
}
public void testIsOpenedRealCamera() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
isOpened = capture.isOpened();
assertTrue(isOpened);
}
public void testOpen() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture();
capture.open(Highgui.CV_CAP_ANDROID);
isOpened = capture.isOpened();
}
public void testRead() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
isSucceed = capture.read(dst);
assertTrue(isSucceed);
}
public void testRelease() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
capture.release();
assertFalse(capture.isOpened());
}
public void testRetrieveMat() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
capture.grab();
isSucceed = capture.retrieve(dst);
}
public void testRetrieveMatInt() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
capture.grab();
isSucceed = capture.retrieve(dst, Highgui.CV_CAP_ANDROID_GREY_FRAME);
}
public void testSet() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
capture.set(Highgui.CV_CAP_PROP_FRAME_WIDTH, 640);
capture.set(Highgui.CV_CAP_PROP_FRAME_HEIGHT, 480);
}
public void testVideoCaptureInt() {
- try
- {
+ if (!isEnabled) {
+ fail("Not yet implemented");
+ }
+
+ try {
capture = new VideoCapture(Highgui.CV_CAP_ANDROID);
assertNotNull(capture);
assertTrue(capture.isOpened());