mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
Merge pull request #26948 from mshabunin:fix-videoio-test-params
videoio: print test params instead of indexes #26948 _videoio_ test names changed - use string instead of index. E.g. `videoio_read.threads/0` is now `videoio_read.threads/h264_0_RAW`. It allows to filter tests independently of the platform. **Notes:** - not all tests has been updated - only simpler ones and those which have varying parameters depending on platform
This commit is contained in:
@@ -78,7 +78,16 @@ const FourCC_Ext_Size entries[] =
|
||||
make_tuple("FFV1", "mkv", bigSize)
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(videoio, videoio_ffmpeg, testing::ValuesIn(entries));
|
||||
inline static std::string videoio_ffmpeg_name_printer(const testing::TestParamInfo<videoio_ffmpeg::ParamType>& info)
|
||||
{
|
||||
std::ostringstream os;
|
||||
const string & fourcc = get<0>(info.param);
|
||||
const Size sz = get<2>(info.param);
|
||||
os << (fourcc.size() == 0 ? "NONE" : fourcc) << "_" << get<1>(info.param) << "_" << sz.height << "p";
|
||||
return os.str();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(videoio, videoio_ffmpeg, testing::ValuesIn(entries), videoio_ffmpeg_name_printer);
|
||||
|
||||
//==========================================================================
|
||||
|
||||
@@ -143,9 +152,19 @@ const videoio_read_params_t videoio_read_params[] =
|
||||
//videoio_read_params_t("video/big_buck_bunny.wmv", 125, true),
|
||||
};
|
||||
|
||||
inline static std::string videoio_read_name_printer(const testing::TestParamInfo<videoio_read::ParamType>& info)
|
||||
{
|
||||
std::ostringstream out;
|
||||
out << getExtensionSafe(get<0>(get<0>(info.param))) << "_"
|
||||
<< get<1>(info.param) << "_"
|
||||
<< (get<2>(info.param) ? "RAW" : "ENC");
|
||||
return out.str();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(/**/, videoio_read, testing::Combine(testing::ValuesIn(videoio_read_params),
|
||||
testing::Values(0, 1, 2, 50),
|
||||
testing::Values(true, false)));
|
||||
testing::Values(true, false)),
|
||||
videoio_read_name_printer);
|
||||
|
||||
//==========================================================================
|
||||
|
||||
@@ -720,7 +739,15 @@ const ffmpeg_get_fourcc_param_t ffmpeg_get_fourcc_param[] =
|
||||
ffmpeg_get_fourcc_param_t("video/sample_322x242_15frames.yuv420p.libx264.mp4", "h264")
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(videoio, ffmpeg_get_fourcc, testing::ValuesIn(ffmpeg_get_fourcc_param));
|
||||
inline static std::string ffmpeg_get_fourcc_name_printer(const testing::TestParamInfo<ffmpeg_get_fourcc::ParamType>& info)
|
||||
{
|
||||
std::ostringstream os;
|
||||
const string & fourcc = get<1>(info.param);
|
||||
os << info.index << "_" << (fourcc.size() == 0 ? "NONE" : fourcc);
|
||||
return os.str();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(videoio, ffmpeg_get_fourcc, testing::ValuesIn(ffmpeg_get_fourcc_param), ffmpeg_get_fourcc_name_printer);
|
||||
|
||||
static void ffmpeg_check_read_raw(VideoCapture& cap)
|
||||
{
|
||||
@@ -914,6 +941,16 @@ const FourCC_Ext_Color_Support sixteen_bit_modes[] =
|
||||
|
||||
};
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(/**/, videoio_ffmpeg_16bit, testing::ValuesIn(sixteen_bit_modes));
|
||||
inline static std::string videoio_ffmpeg_16bit_name_printer(const testing::TestParamInfo<videoio_ffmpeg_16bit::ParamType>& info)
|
||||
{
|
||||
std::ostringstream os;
|
||||
os << get<0>(info.param) << "_"
|
||||
<< get<1>(info.param) << "_"
|
||||
<< (get<2>(info.param) ? "COLOR" : "GRAY") << "_"
|
||||
<< (get<3>(info.param) ? "SUP" : "NOT");
|
||||
return os.str();
|
||||
}
|
||||
|
||||
INSTANTIATE_TEST_CASE_P(/**/, videoio_ffmpeg_16bit, testing::ValuesIn(sixteen_bit_modes), videoio_ffmpeg_16bit_name_printer);
|
||||
|
||||
}} // namespace
|
||||
|
||||
Reference in New Issue
Block a user