Skip to content

Commit 6d691f2

Browse files
committed
1 parent 9840825 commit 6d691f2

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

modules/core/test/test_mat.cpp

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -925,6 +925,19 @@ TEST(Core_InputArray, empty)
925925
ASSERT_TRUE(_InputArray(data).empty());
926926
}
927927

928+
929+
TEST(Core_CopyMask, bug1918)
930+
{
931+
Mat_<unsigned char> tmpSrc(100, 100);
932+
tmpSrc = 124;
933+
Mat_<unsigned char> tmpMask(100, 100);
934+
tmpMask = 255;
935+
Mat_<unsigned char> tmpDst(100, 100);
936+
tmpDst = 2;
937+
tmpSrc.copyTo(tmpDst, tmpMask);
938+
ASSERT_EQ(sum(tmpDst)[0], 124 * 100 * 100);
939+
}
940+
928941
TEST(Core_SVD, orthogonality)
929942
{
930943
for (int i = 0; i < 2; i++)

0 commit comments

Comments
 (0)