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
5032dae9
Commit
5032dae9
authored
Dec 02, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: refactor test to capture more information on failure
Core_ArithmMask.uninitialized
parent
b87cee8b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
26 deletions
+9
-26
test_arithm.cpp
modules/core/test/test_arithm.cpp
+9
-26
No files found.
modules/core/test/test_arithm.cpp
View file @
5032dae9
...
@@ -1485,35 +1485,26 @@ INSTANTIATE_TEST_CASE_P(Core_MinMaxLoc, ElemWiseTest, ::testing::Values(ElemWise
...
@@ -1485,35 +1485,26 @@ INSTANTIATE_TEST_CASE_P(Core_MinMaxLoc, ElemWiseTest, ::testing::Values(ElemWise
INSTANTIATE_TEST_CASE_P
(
Core_CartToPolarToCart
,
ElemWiseTest
,
::
testing
::
Values
(
ElemWiseOpPtr
(
new
cvtest
::
CartToPolarToCartOp
)));
INSTANTIATE_TEST_CASE_P
(
Core_CartToPolarToCart
,
ElemWiseTest
,
::
testing
::
Values
(
ElemWiseOpPtr
(
new
cvtest
::
CartToPolarToCartOp
)));
class
CV_ArithmMaskTest
:
public
cvtest
::
BaseTest
TEST
(
Core_ArithmMask
,
uninitialized
)
{
{
public
:
CV_ArithmMaskTest
()
{}
~
CV_ArithmMaskTest
()
{}
protected
:
void
run
(
int
)
{
try
{
RNG
&
rng
=
theRNG
();
RNG
&
rng
=
theRNG
();
const
int
MAX_DIM
=
3
;
const
int
MAX_DIM
=
3
;
int
sizes
[
MAX_DIM
];
int
sizes
[
MAX_DIM
];
for
(
int
iter
=
0
;
iter
<
100
;
iter
++
)
for
(
int
iter
=
0
;
iter
<
100
;
iter
++
)
{
{
//ts->printf(cvtest::TS::LOG, ".");
int
dims
=
rng
.
uniform
(
1
,
MAX_DIM
+
1
);
ts
->
update_context
(
this
,
iter
,
true
);
int
k
,
dims
=
rng
.
uniform
(
1
,
MAX_DIM
+
1
),
p
=
1
;
int
depth
=
rng
.
uniform
(
CV_8U
,
CV_64F
+
1
);
int
depth
=
rng
.
uniform
(
CV_8U
,
CV_64F
+
1
);
int
cn
=
rng
.
uniform
(
1
,
6
);
int
cn
=
rng
.
uniform
(
1
,
6
);
int
type
=
CV_MAKETYPE
(
depth
,
cn
);
int
type
=
CV_MAKETYPE
(
depth
,
cn
);
int
op
=
rng
.
uniform
(
0
,
5
);
int
op
=
rng
.
uniform
(
0
,
5
);
int
depth1
=
op
<=
1
?
CV_64F
:
depth
;
int
depth1
=
op
<=
1
?
CV_64F
:
depth
;
for
(
k
=
0
;
k
<
dims
;
k
++
)
for
(
int
k
=
0
;
k
<
MAX_DIM
;
k
++
)
{
{
sizes
[
k
]
=
rng
.
uniform
(
1
,
30
);
sizes
[
k
]
=
k
<
dims
?
rng
.
uniform
(
1
,
30
)
:
0
;
p
*=
sizes
[
k
];
}
}
SCOPED_TRACE
(
cv
::
format
(
"iter=%d dims=%d depth=%d cn=%d type=%d op=%d depth1=%d dims=[%d; %d; %d]"
,
iter
,
dims
,
depth
,
cn
,
type
,
op
,
depth1
,
sizes
[
0
],
sizes
[
1
],
sizes
[
2
]));
Mat
a
(
dims
,
sizes
,
type
),
a1
;
Mat
a
(
dims
,
sizes
,
type
),
a1
;
Mat
b
(
dims
,
sizes
,
type
),
b1
;
Mat
b
(
dims
,
sizes
,
type
),
b1
;
Mat
mask
(
dims
,
sizes
,
CV_8U
);
Mat
mask
(
dims
,
sizes
,
CV_8U
);
...
@@ -1562,7 +1553,7 @@ protected:
...
@@ -1562,7 +1553,7 @@ protected:
}
}
Mat
d1
;
Mat
d1
;
d
.
convertTo
(
d1
,
depth
);
d
.
convertTo
(
d1
,
depth
);
CV_Assert
(
cvtest
::
norm
(
c
,
d1
,
CV_C
)
<=
DBL_EPSILON
);
EXPECT_LE
(
cvtest
::
norm
(
c
,
d1
,
CV_C
),
DBL_EPSILON
);
}
}
Mat_
<
uchar
>
tmpSrc
(
100
,
100
);
Mat_
<
uchar
>
tmpSrc
(
100
,
100
);
...
@@ -1572,15 +1563,7 @@ protected:
...
@@ -1572,15 +1563,7 @@ protected:
Mat_
<
uchar
>
tmpDst
(
100
,
100
);
Mat_
<
uchar
>
tmpDst
(
100
,
100
);
tmpDst
=
2
;
tmpDst
=
2
;
tmpSrc
.
copyTo
(
tmpDst
,
tmpMask
);
tmpSrc
.
copyTo
(
tmpDst
,
tmpMask
);
}
}
catch
(...)
{
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_MISMATCH
);
}
}
};
TEST
(
Core_ArithmMask
,
uninitialized
)
{
CV_ArithmMaskTest
test
;
test
.
safe_run
();
}
TEST
(
Multiply
,
FloatingPointRounding
)
TEST
(
Multiply
,
FloatingPointRounding
)
{
{
...
...
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