Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
O
opencv
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Packages
Packages
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
submodule
opencv
Commits
baef62b4
Commit
baef62b4
authored
Nov 09, 2012
by
Alexander Smorkalov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Java test fix. Eclipse test execution fix.
parent
4d059e9e
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
87 additions
and
37 deletions
+87
-37
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+2
-0
OpenCVTestRunner.java
...va/android_test/src/org/opencv/test/OpenCVTestRunner.java
+13
-11
FASTFeatureDetectorTest.java
...c/org/opencv/test/features2d/FASTFeatureDetectorTest.java
+6
-3
HighguiTest.java
...android_test/src/org/opencv/test/highgui/HighguiTest.java
+3
-3
VideoCaptureTest.java
...id_test/src/org/opencv/test/highgui/VideoCaptureTest.java
+63
-20
No files found.
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
baef62b4
...
...
@@ -28,6 +28,8 @@ public class OpenCVTestCase extends TestCase {
//change to 'true' to unblock fail on fail("Not yet implemented")
public
static
final
boolean
passNYI
=
true
;
protected
static
boolean
isEnabled
=
true
;
protected
static
final
int
matSize
=
10
;
protected
static
final
double
EPS
=
0.001
;
protected
static
final
double
weakEPS
=
0.5
;
...
...
modules/java/android_test/src/org/opencv/test/OpenCVTestRunner.java
View file @
baef62b4
...
...
@@ -2,9 +2,9 @@ package org.opencv.test;
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
;
...
...
@@ -72,15 +72,17 @@ public class OpenCVTestRunner extends InstrumentationTestRunner {
//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
();
...
...
modules/java/android_test/src/org/opencv/test/features2d/FASTFeatureDetectorTest.java
View file @
baef62b4
...
...
@@ -13,6 +13,8 @@ import org.opencv.features2d.KeyPoint;
import
org.opencv.test.OpenCVTestCase
;
import
org.opencv.test.OpenCVTestRunner
;
import
android.util.Log
;
public
class
FASTFeatureDetectorTest
extends
OpenCVTestCase
{
FeatureDetector
detector
;
...
...
@@ -127,9 +129,9 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase {
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
);
}
...
...
@@ -138,9 +140,10 @@ public class FASTFeatureDetectorTest extends OpenCVTestCase {
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\n
type: 2\n
"
;
String
data
=
readFile
(
filename
);
Log
.
d
(
"qqq"
,
"\""
+
data
+
"\""
);
assertEquals
(
truth
,
data
);
}
}
modules/java/android_test/src/org/opencv/test/highgui/HighguiTest.java
View file @
baef62b4
...
...
@@ -22,10 +22,10 @@ public class HighguiTest extends OpenCVTestCase {
public
void
testImencodeStringMatListOfByteListOfInteger
()
{
MatOfInt
params40
=
new
MatOfInt
(
Highgui
.
IMWRITE_JPEG_QUALITY
,
40
);
MatOfInt
params90
=
new
MatOfInt
(
Highgui
.
IMWRITE_JPEG_QUALITY
,
90
);
/* or
/* or
MatOfInt params = new MatOfInt();
params.fromArray(Highgui.IMWRITE_JPEG_QUALITY, 40);
*/
params.fromArray(Highgui.IMWRITE_JPEG_QUALITY, 40);
*/
MatOfByte
buff40
=
new
MatOfByte
();
MatOfByte
buff90
=
new
MatOfByte
();
...
...
modules/java/android_test/src/org/opencv/test/highgui/VideoCaptureTest.java
View file @
baef62b4
...
...
@@ -19,13 +19,17 @@ public class VideoCaptureTest extends OpenCVTestCase {
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
);
...
...
@@ -35,8 +39,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
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
);
...
...
@@ -47,12 +54,20 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
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
();
...
...
@@ -63,13 +78,20 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
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
);
...
...
@@ -79,8 +101,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testOpen
()
{
try
{
if
(!
isEnabled
)
{
fail
(
"Not yet implemented"
);
}
try
{
capture
=
new
VideoCapture
();
capture
.
open
(
Highgui
.
CV_CAP_ANDROID
);
isOpened
=
capture
.
isOpened
();
...
...
@@ -91,8 +116,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testRead
()
{
try
{
if
(!
isEnabled
)
{
fail
(
"Not yet implemented"
);
}
try
{
capture
=
new
VideoCapture
(
Highgui
.
CV_CAP_ANDROID
);
isSucceed
=
capture
.
read
(
dst
);
assertTrue
(
isSucceed
);
...
...
@@ -104,8 +132,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testRelease
()
{
try
{
if
(!
isEnabled
)
{
fail
(
"Not yet implemented"
);
}
try
{
capture
=
new
VideoCapture
(
Highgui
.
CV_CAP_ANDROID
);
capture
.
release
();
assertFalse
(
capture
.
isOpened
());
...
...
@@ -116,8 +147,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testRetrieveMat
()
{
try
{
if
(!
isEnabled
)
{
fail
(
"Not yet implemented"
);
}
try
{
capture
=
new
VideoCapture
(
Highgui
.
CV_CAP_ANDROID
);
capture
.
grab
();
isSucceed
=
capture
.
retrieve
(
dst
);
...
...
@@ -130,8 +164,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
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
);
...
...
@@ -144,8 +181,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
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
);
...
...
@@ -165,8 +205,11 @@ public class VideoCaptureTest extends OpenCVTestCase {
}
public
void
testVideoCaptureInt
()
{
try
{
if
(!
isEnabled
)
{
fail
(
"Not yet implemented"
);
}
try
{
capture
=
new
VideoCapture
(
Highgui
.
CV_CAP_ANDROID
);
assertNotNull
(
capture
);
assertTrue
(
capture
.
isOpened
());
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment