1
0
mirror of https://github.com/opencv/opencv.git synced 2026-07-29 23:33:05 +04:00

Add test cases and fix bugs in the RVV HAL.

This commit is contained in:
Liutong HAN
2024-12-27 08:39:52 +00:00
parent 94bccbecc0
commit b31f7694c5
3 changed files with 83 additions and 37 deletions
+19 -4
View File
@@ -1749,18 +1749,22 @@ TEST(Core_Mat_array, copyTo_roi_row)
EXPECT_EQ(5, (int)dst2[4]);
}
TEST(Core_Mat_array, SplitMerge)
typedef testing::TestWithParam< tuple<int, perf::MatType> > Core_Mat_arrays;
TEST_P(Core_Mat_arrays, SplitMerge)
{
std::array<cv::Mat, 3> src;
int cn = get<0>(GetParam());
int type = get<1>(GetParam());
std::vector<cv::Mat> src(cn);
for (size_t i = 0; i < src.size(); ++i)
{
src[i] = Mat(10, 10, CV_8U, Scalar((double)(16 * (i + 1))));
src[i] = Mat(10, 10, type, Scalar((double)(16 * (i + 1))));
}
Mat merged;
merge(src, merged);
std::array<cv::Mat, 3> dst;
std::vector<cv::Mat> dst(cn);
split(merged, dst);
for (size_t i = 0; i < dst.size(); ++i)
@@ -1769,6 +1773,17 @@ TEST(Core_Mat_array, SplitMerge)
}
}
INSTANTIATE_TEST_CASE_P(/*nothing*/, Core_Mat_arrays, testing::Combine(
testing::Range(1, 9),
testing::Values(
perf::MatType(CV_8U),
perf::MatType(CV_16U),
perf::MatType(CV_32S),
perf::MatType(CV_64F)
)
)
);
TEST(Mat, regression_8680)
{
Mat_<Point2i> mat(3,1);