From 7071bd63ab54634396284a093ae35ffc93f66b43 Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Mon, 11 Feb 2013 15:25:15 +0400 Subject: [PATCH] Added two tests to highlight bug #2788 --- modules/core/test/test_arithm.cpp | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index 43120cf..b8e88c5 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, DISABLED_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)); +} -- 2.7.4