From: Roman Donchenko Date: Fri, 17 Jan 2014 10:18:31 +0000 (+0400) Subject: Added a test for matrix-to-vector copy and convert. X-Git-Tag: accepted/tizen/ivi/20140515.103456~1^2~137^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=5f8d8c0069a715dd3dfbbcd6a01a6715e74571b2;p=profile%2Fivi%2Fopencv.git Added a test for matrix-to-vector copy and convert. --- diff --git a/modules/core/test/test_mat.cpp b/modules/core/test/test_mat.cpp index 514b587..a6ebe15 100644 --- a/modules/core/test/test_mat.cpp +++ b/modules/core/test/test_mat.cpp @@ -897,3 +897,24 @@ TEST(Core_Mat, reshape_1942) ); ASSERT_EQ(1, cn); } + +TEST(Core_Mat, copyNx1ToVector) +{ + cv::Mat_ src(5, 1); + cv::Mat_ ref_dst8; + cv::Mat_ ref_dst16; + std::vector dst8; + std::vector dst16; + + src << 1, 2, 3, 4, 5; + + src.copyTo(ref_dst8); + src.copyTo(dst8); + + ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), ref_dst8, cv::Mat_(dst8)); + + src.convertTo(ref_dst16, CV_16U); + src.convertTo(dst16, CV_16U); + + ASSERT_PRED_FORMAT2(cvtest::MatComparator(0, 0), ref_dst16, cv::Mat_(dst16)); +}