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
2df096c1
Commit
2df096c1
authored
Jun 02, 2011
by
Andrey Morozov
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
converted drawing tests to the format of google test system
parent
c8f0147a
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
23 additions
and
24 deletions
+23
-24
test_drawing.cpp
modules/highgui/test/test_drawing.cpp
+23
-24
No files found.
modules/highgui/test/test_drawing.cpp
View file @
2df096c1
...
...
@@ -40,17 +40,16 @@
//M*/
#include "test_precomp.hpp"
#if 0
#include "opencv2/highgui/highgui.hpp"
using
namespace
cv
;
//#define DRAW_TEST_IMAGE
class CV_DrawingTest : public
Cv
Test
class
CV_DrawingTest
:
public
cvtest
::
Base
Test
{
public
:
CV_DrawingTest( const char* testName )
: CvTest( testName, "drawing funcs" )
{}
CV_DrawingTest
(
const
char
*
testName
){}
protected
:
void
run
(
int
);
virtual
void
draw
(
Mat
&
img
)
=
0
;
...
...
@@ -59,7 +58,6 @@ protected:
void
CV_DrawingTest
::
run
(
int
)
{
int code = CvTS::OK;
Mat
testImg
,
valImg
;
const
string
name
=
"drawing/image.jpg"
;
string
path
=
ts
->
get_data_path
(),
filename
;
...
...
@@ -73,8 +71,8 @@ void CV_DrawingTest::run( int )
valImg
=
imread
(
filename
);
if
(
valImg
.
empty
()
)
{
ts->printf(
CvTS::
LOG, "test image can not be read");
code = CvTS::FAIL_INVALID_TEST_DATA
;
ts
->
printf
(
ts
->
LOG
,
"test image can not be read"
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_TEST_DATA
)
;
}
else
{
...
...
@@ -82,22 +80,22 @@ void CV_DrawingTest::run( int )
float
Eps
=
0.9
f
;
if
(
err
>
Eps
)
{
ts->printf(
CvTS::
LOG, "CV_RELATIVE_L1 between testImg and valImg is equal %f (larger than %f)\n", err, Eps );
code = CvTS::FAIL_BAD_ACCURACY
;
ts
->
printf
(
ts
->
LOG
,
"CV_RELATIVE_L1 between testImg and valImg is equal %f (larger than %f)
\n
"
,
err
,
Eps
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_BAD_ACCURACY
)
;
}
else
{
code = checkLineIterator( testImg
);
ts
->
set_failed_test_info
(
checkLineIterator
(
testImg
)
);
}
}
#endif
ts
->
set_failed_test_info
(
code
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
}
class
CV_DrawingTest_CPP
:
public
CV_Drawing
Test
class
CV_DrawingTest_CPP
:
public
cvtest
::
Base
Test
{
public
:
CV_DrawingTest_CPP
()
:
CV_DrawingTest
(
"drawing_cpp"
)
{}
CV_DrawingTest_CPP
()
{}
protected
:
virtual
void
draw
(
Mat
&
img
);
virtual
int
checkLineIterator
(
Mat
&
img
);
...
...
@@ -235,17 +233,18 @@ int CV_DrawingTest_CPP::checkLineIterator( Mat& img )
float
err
=
(
float
)
norm
(
v
);
if
(
err
!=
0
)
{
ts
->
printf
(
CvTS
::
LOG
,
"LineIterator works incorrect"
);
return
CvTS
::
FAIL_INVALID_OUTPUT
;
ts
->
printf
(
ts
->
LOG
,
"LineIterator works incorrect"
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
)
;
}
}
return
CvTS
::
OK
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
return
0
;
}
class
CV_DrawingTest_C
:
public
CV_Drawing
Test
class
CV_DrawingTest_C
:
public
cvtest
::
Base
Test
{
public
:
CV_DrawingTest_C
()
:
CV_DrawingTest
(
"drawing_c"
)
{}
CV_DrawingTest_C
()
{}
protected
:
virtual
void
draw
(
Mat
&
img
);
virtual
int
checkLineIterator
(
Mat
&
img
);
...
...
@@ -400,15 +399,15 @@ int CV_DrawingTest_C::checkLineIterator( Mat& _img )
float
err
=
(
float
)
norm
(
v
);
if
(
err
!=
0
)
{
ts
->
printf
(
CvTS
::
LOG
,
"CvLineIterator works incorrect"
);
return
CvTS
::
FAIL_INVALID_OUTPUT
;
ts
->
printf
(
ts
->
LOG
,
"CvLineIterator works incorrect"
);
ts
->
set_failed_test_info
(
cvtest
::
TS
::
FAIL_INVALID_OUTPUT
)
;
}
CV_NEXT_LINE_POINT
(
it
);
}
return
CvTS
::
OK
;
ts
->
set_failed_test_info
(
cvtest
::
TS
::
OK
);
return
0
;
}
CV_DrawingTest_CPP
drawing_test_cpp
;
CV_DrawingTest_C
drawing_test_c
;
TEST
(
Highgui_Drawing_CPP
,
regression
)
{
CV_DrawingTest_CPP
test
;
test
.
safe_run
();
}
TEST
(
Highgui_Drawing_C
,
regression
)
{
CV_DrawingTest_C
test
;
test
.
safe_run
();
}
#endif
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