From 2ec92ba440efa909da5e8827de68e769437887c6 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Sun, 3 May 2015 02:46:33 +0300 Subject: [PATCH] added test for http://code.opencv.org/issues/1918 --- modules/core/test/test_mat.cpp | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index 8acc10121a..102bd99764 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -1223,6 +1223,18 @@ TEST(Core_InputArray, empty) ASSERT_TRUE( _InputArray(data).empty() ); } +TEST(Core_CopyMask, bug1918) +{ + Mat_ tmpSrc(100,100); + tmpSrc = 124; + Mat_ tmpMask(100,100); + tmpMask = 255; + Mat_ tmpDst(100,100); + tmpDst = 2; + tmpSrc.copyTo(tmpDst,tmpMask); + ASSERT_EQ(sum(tmpDst)[0], 124*100*100); +} + TEST(Core_SVD, orthogonality) { for( int i = 0; i < 2; i++ )