We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 267fdc4 commit f42b7d0Copy full SHA for f42b7d0
modules/core/test/test_mat.cpp
@@ -1734,3 +1734,21 @@ TEST(Mat, regression_8680)
1734
mat.release();
1735
ASSERT_EQ(mat.channels(), 2);
1736
}
1737
+
1738
+#ifdef CV_CXX_11
1739
1740
+TEST(Mat_, range_based_for)
1741
+{
1742
+ Mat_<uchar> img = Mat_<uchar>::zeros(3, 3);
1743
1744
+ for(auto& pixel : img)
1745
+ {
1746
+ pixel = 1;
1747
+ }
1748
1749
+ Mat_<uchar> ref(3, 3);
1750
+ ref.setTo(Scalar(1));
1751
+ ASSERT_DOUBLE_EQ(norm(img, ref), 0.);
1752
+}
1753
1754
+#endif
0 commit comments