1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-31 08:13:04 +04:00

porting polylines with empty vector<Point> from 2.4 to master

This commit is contained in:
Andrey Pavlenko
2015-04-24 17:11:51 +03:00
parent 755527a90a
commit d2409d12c6
2 changed files with 22 additions and 0 deletions
+19
View File
@@ -410,4 +410,23 @@ TEST(Core_Drawing, _914)
ASSERT_EQ( (3*rows + cols)*3 - 3*9, pixelsDrawn);
}
TEST(Core_Drawing, polylines_empty)
{
Mat img(100, 100, CV_8UC1, Scalar(0));
vector<Point> pts; // empty
polylines(img, pts, false, Scalar(255));
int cnt = countNonZero(img);
ASSERT_EQ(cnt, 0);
}
TEST(Core_Drawing, polylines)
{
Mat img(100, 100, CV_8UC1, Scalar(0));
vector<Point> pts;
pts.push_back(Point(0, 0));
pts.push_back(Point(20, 0));
polylines(img, pts, false, Scalar(255));
int cnt = countNonZero(img);
ASSERT_EQ(cnt, 21);
}
/* End of file. */