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
8019498c
Commit
8019498c
authored
Nov 22, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
java tests fixes
parent
fe29080d
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
16 additions
and
8 deletions
+16
-8
CoreTest.java
modules/core/misc/java/test/CoreTest.java
+1
-1
ImgprocTest.java
modules/imgproc/misc/java/test/ImgprocTest.java
+3
-3
OpenCVTestCase.java
...java/android_test/src/org/opencv/test/OpenCVTestCase.java
+6
-2
OpenCVTestCase.java
...es/java/pure_test/src/org/opencv/test/OpenCVTestCase.java
+6
-2
No files found.
modules/core/misc/java/test/CoreTest.java
View file @
8019498c
...
...
@@ -1777,7 +1777,7 @@ public class CoreTest extends OpenCVTestCase {
};
Mat
roots
=
new
Mat
();
assert
Equals
(
0.0
,
Core
.
solvePoly
(
coeffs
,
roots
));
assert
GE
(
1
e
-
6
,
Math
.
abs
(
Core
.
solvePoly
(
coeffs
,
roots
)
));
truth
=
new
Mat
(
3
,
1
,
CvType
.
CV_32FC2
)
{
{
...
...
modules/imgproc/misc/java/test/ImgprocTest.java
View file @
8019498c
...
...
@@ -359,7 +359,7 @@ public class ImgprocTest extends OpenCVTestCase {
double
distance
=
Imgproc
.
compareHist
(
H1
,
H2
,
Imgproc
.
CV_COMP_CORREL
);
assertEquals
(
1
.,
distance
);
assertEquals
(
1
.,
distance
,
EPS
);
}
public
void
testContourAreaMat
()
{
...
...
@@ -368,7 +368,7 @@ public class ImgprocTest extends OpenCVTestCase {
double
area
=
Imgproc
.
contourArea
(
contour
);
assertEquals
(
45
.,
area
);
assertEquals
(
45
.,
area
,
EPS
);
}
public
void
testContourAreaMatBoolean
()
{
...
...
@@ -377,7 +377,7 @@ public class ImgprocTest extends OpenCVTestCase {
double
area
=
Imgproc
.
contourArea
(
contour
,
true
);
assertEquals
(
45
.,
area
);
assertEquals
(
45
.,
area
,
EPS
);
// TODO_: write better test
}
...
...
modules/java/android_test/src/org/opencv/test/OpenCVTestCase.java
View file @
8019498c
...
...
@@ -244,6 +244,10 @@ public class OpenCVTestCase extends TestCase {
TestCase
.
fail
(
msg
);
}
public
static
void
assertGE
(
double
v1
,
double
v2
)
{
assertTrue
(
"Failed: "
+
v1
+
" >= "
+
v2
,
v1
>=
v2
);
}
public
static
<
E
extends
Number
>
void
assertListEquals
(
List
<
E
>
list1
,
List
<
E
>
list2
)
{
if
(
list1
.
size
()
!=
list2
.
size
())
{
throw
new
UnsupportedOperationException
();
...
...
@@ -458,10 +462,10 @@ public class OpenCVTestCase extends TestCase {
if
(
isEqualityMeasured
)
assertTrue
(
"Max difference between expected and actiual Mats is "
+
maxDiff
+
", that bigger than "
+
eps
,
Core
.
checkRange
(
diff
,
true
,
0.0
,
eps
)
);
maxDiff
<=
eps
);
else
assertFalse
(
"Max difference between expected and actiual Mats is "
+
maxDiff
+
", that less than "
+
eps
,
Core
.
checkRange
(
diff
,
true
,
0.0
,
eps
)
);
maxDiff
<=
eps
);
}
protected
static
String
readFile
(
String
path
)
{
...
...
modules/java/pure_test/src/org/opencv/test/OpenCVTestCase.java
View file @
8019498c
...
...
@@ -270,6 +270,10 @@ public class OpenCVTestCase extends TestCase {
TestCase
.
fail
(
msg
);
}
public
static
void
assertGE
(
double
v1
,
double
v2
)
{
assertTrue
(
"Failed: "
+
v1
+
" >= "
+
v2
,
v1
>=
v2
);
}
public
static
<
E
extends
Number
>
void
assertListEquals
(
List
<
E
>
list1
,
List
<
E
>
list2
)
{
if
(
list1
.
size
()
!=
list2
.
size
())
{
throw
new
UnsupportedOperationException
();
...
...
@@ -484,10 +488,10 @@ public class OpenCVTestCase extends TestCase {
if
(
isEqualityMeasured
)
assertTrue
(
"Max difference between expected and actiual Mats is "
+
maxDiff
+
", that bigger than "
+
eps
,
Core
.
checkRange
(
diff
,
true
,
0.0
,
eps
)
);
maxDiff
<=
eps
);
else
assertFalse
(
"Max difference between expected and actiual Mats is "
+
maxDiff
+
", that less than "
+
eps
,
Core
.
checkRange
(
diff
,
true
,
0.0
,
eps
)
);
maxDiff
<=
eps
);
}
protected
static
String
readFile
(
String
path
)
{
...
...
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