From 7071bd63ab54634396284a093ae35ffc93f66b43 Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Mon, 11 Feb 2013 15:25:15 +0400 Subject: [PATCH 1/2] 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 43120cfd86..b8e88c53d4 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)); +} From 74e56503504a9038e518d847d8eedc5334c1c044 Mon Sep 17 00:00:00 2001 From: Kirill Kornyakov Date: Mon, 11 Feb 2013 16:53:41 +0400 Subject: [PATCH 2/2] Reenabled second test --- modules/core/test/test_arithm.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/core/test/test_arithm.cpp b/modules/core/test/test_arithm.cpp index b8e88c53d4..ebc9eae640 100644 --- a/modules/core/test/test_arithm.cpp +++ b/modules/core/test/test_arithm.cpp @@ -1542,7 +1542,7 @@ TEST(Core_Add, AddToColumnWhen3Rows) ASSERT_EQ(0, countNonZero(m1 - m2)); } -TEST(Core_Add, DISABLED_AddToColumnWhen4Rows) +TEST(Core_Add, AddToColumnWhen4Rows) { cv::Mat m1 = (cv::Mat_(4, 2) << 1, 2, 3, 4, 5, 6, 7, 8); m1.col(1) += 10;