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
781ab3d4
Commit
781ab3d4
authored
Dec 07, 2016
by
Alexander Alekhin
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test: minor refactoring in test_drawing
parent
ee265962
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
22 additions
and
12 deletions
+22
-12
test_drawing.cpp
modules/imgproc/test/test_drawing.cpp
+22
-12
No files found.
modules/imgproc/test/test_drawing.cpp
View file @
781ab3d4
...
...
@@ -42,6 +42,8 @@
#include "test_precomp.hpp"
namespace
{
using
namespace
std
;
using
namespace
cv
;
...
...
@@ -60,7 +62,7 @@ protected:
void
CV_DrawingTest
::
run
(
int
)
{
Mat
testImg
,
valImg
;
const
string
fname
=
"drawing/image.png"
;
const
string
fname
=
"
../highgui/
drawing/image.png"
;
string
path
=
ts
->
get_data_path
(),
filename
;
filename
=
path
+
fname
;
...
...
@@ -69,9 +71,15 @@ void CV_DrawingTest::run( int )
valImg
=
imread
(
filename
);
if
(
valImg
.
empty
()
)
{
imwrite
(
filename
,
testImg
);
//ts->printf( ts->LOG, "test image can not be read");
//ts->set_failed_test_info(cvtest::TS::FAIL_INVALID_TEST_DATA);
//imwrite( filename, testImg );
ts
->
printf
(
ts
->
LOG
,
"test image can not be read"
);
#ifdef HAVE_PNG
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
);
#else
ts
->
printf
(
ts
->
LOG
,
"PNG image support is not available"
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
#endif
return
;
}
else
{
...
...
@@ -543,11 +551,9 @@ void CV_DrawingTest_Far::draw(Mat& img)
img
=
img
(
Rect
(
32768
,
0
,
600
,
400
)).
clone
();
}
#ifdef HAVE_JPEG
TEST
(
Imgcodecs_Drawing
,
cpp_regression
)
{
CV_DrawingTest_CPP
test
;
test
.
safe_run
();
}
TEST
(
Imgcodecs_Drawing
,
c_regression
)
{
CV_DrawingTest_C
test
;
test
.
safe_run
();
}
TEST
(
Imgcodecs_Drawing
,
far_regression
)
{
CV_DrawingTest_Far
test
;
test
.
safe_run
();
}
#endif
TEST
(
Drawing
,
cpp_regression
)
{
CV_DrawingTest_CPP
test
;
test
.
safe_run
();
}
TEST
(
Drawing
,
c_regression
)
{
CV_DrawingTest_C
test
;
test
.
safe_run
();
}
TEST
(
Drawing
,
far_regression
)
{
CV_DrawingTest_Far
test
;
test
.
safe_run
();
}
class
CV_FillConvexPolyTest
:
public
cvtest
::
BaseTest
{
...
...
@@ -581,7 +587,7 @@ protected:
}
};
TEST
(
Imgcodecs_
Drawing
,
fillconvexpoly_clipping
)
{
CV_FillConvexPolyTest
test
;
test
.
safe_run
();
}
TEST
(
Drawing
,
fillconvexpoly_clipping
)
{
CV_FillConvexPolyTest
test
;
test
.
safe_run
();
}
class
CV_DrawingTest_UTF8
:
public
cvtest
::
BaseTest
{
...
...
@@ -655,8 +661,12 @@ protected:
img
->
copyTo
(
sub
);
shift
+=
img
->
size
().
height
+
1
;
}
imwrite
(
"/tmp/all_fonts.png"
,
result
);
//
imwrite("/tmp/all_fonts.png", result);
}
};
TEST
(
Highgui_Drawing
,
utf8_support
)
{
CV_DrawingTest_UTF8
test
;
test
.
safe_run
();
}
TEST
(
Drawing
,
utf8_support
)
{
CV_DrawingTest_UTF8
test
;
test
.
safe_run
();
}
}
// namespace
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