Commit f42b7d03 authored by Vladislav Sovrasov's avatar Vladislav Sovrasov

core: add a test of iteration through the Mat_ with range-based for

parent 267fdc4c
......@@ -1734,3 +1734,21 @@ TEST(Mat, regression_8680)
mat.release();
ASSERT_EQ(mat.channels(), 2);
}
#ifdef CV_CXX_11
TEST(Mat_, range_based_for)
{
Mat_<uchar> img = Mat_<uchar>::zeros(3, 3);
for(auto& pixel : img)
{
pixel = 1;
}
Mat_<uchar> ref(3, 3);
ref.setTo(Scalar(1));
ASSERT_DOUBLE_EQ(norm(img, ref), 0.);
}
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment