diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index 43120cfd86..ebc9eae640 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -1530,4 +1530,24 @@ TEST(Multiply, FloatingPointRounding) cv::multiply(src, s, dst, 1, CV_16U); // with CV_32F this produce result 16202 ASSERT_EQ(dst.at(0,0), 16201); -} \ No newline at end of file +} + +TEST(Core_Add, AddToColumnWhen3Rows) +{ + cv::Mat m1 = (cv::Mat_(3, 2) << 1, 2, 3, 4, 5, 6); + m1.col(1) += 10; + + cv::Mat m2 = (cv::Mat_(3, 2) << 1, 12, 3, 14, 5, 16); + + ASSERT_EQ(0, countNonZero(m1 - m2)); +} + +TEST(Core_Add, AddToColumnWhen4Rows) +{ + cv::Mat m1 = (cv::Mat_(4, 2) << 1, 2, 3, 4, 5, 6, 7, 8); + m1.col(1) += 10; + + cv::Mat m2 = (cv::Mat_(4, 2) << 1, 12, 3, 14, 5, 16, 7, 18); + + ASSERT_EQ(0, countNonZero(m1 - m2)); +}