mirror of
https://github.com/opencv/opencv.git
synced 2025-06-07 17:44:04 +08:00
test: Added tests for VideoCapture constructors in java
This commit is contained in:
parent
0812207db7
commit
18550b4601
@ -35,10 +35,30 @@ public class VideoCaptureTest extends OpenCVTestCase {
|
|||||||
assertFalse(capture.isOpened());
|
assertFalse(capture.isOpened());
|
||||||
}
|
}
|
||||||
|
|
||||||
public void testVideoCapture() {
|
public void testDefaultConstructor() {
|
||||||
capture = new VideoCapture();
|
capture = new VideoCapture();
|
||||||
assertNotNull(capture);
|
assertNotNull(capture);
|
||||||
assertFalse(capture.isOpened());
|
assertFalse(capture.isOpened());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void testConstructorWithFilename() {
|
||||||
|
capture = new VideoCapture("some_file.avi");
|
||||||
|
assertNotNull(capture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testConstructorWithFilenameAndExplicitlySpecifiedAPI() {
|
||||||
|
capture = new VideoCapture("some_file.avi", Videoio.CAP_ANY);
|
||||||
|
assertNotNull(capture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testConstructorWithIndex() {
|
||||||
|
capture = new VideoCapture(0);
|
||||||
|
assertNotNull(capture);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void testConstructorWithIndexAndExplicitlySpecifiedAPI() {
|
||||||
|
capture = new VideoCapture(0, Videoio.CAP_ANY);
|
||||||
|
assertNotNull(capture);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user