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

core: support CV_Check*() macros with 'bool' parameters

This commit is contained in:
Alexander Alekhin
2022-11-15 09:55:22 +00:00
parent b418eb112c
commit 54531f8e3b
3 changed files with 31 additions and 1 deletions
+20
View File
@@ -97,6 +97,10 @@ void check_failed_MatChannels(const int v1, const int v2, const CheckContext& ct
{
check_failed_auto_<int>(v1, v2, ctx);
}
void check_failed_auto(const bool v1, const bool v2, const CheckContext& ctx)
{
check_failed_auto_<bool>(v1, v2, ctx);
}
void check_failed_auto(const int v1, const int v2, const CheckContext& ctx)
{
check_failed_auto_<int>(v1, v2, ctx);
@@ -151,6 +155,22 @@ void check_failed_MatChannels(const int v, const CheckContext& ctx)
{
check_failed_auto_<int>(v, ctx);
}
void check_failed_true(const bool v, const CheckContext& ctx)
{
CV_UNUSED(v);
std::stringstream ss;
ss << ctx.message << ":" << std::endl
<< " '" << ctx.p1_str << "' must be 'true'";
cv::errorNoReturn(cv::Error::StsError, ss.str(), ctx.func, ctx.file, ctx.line);
}
void check_failed_false(const bool v, const CheckContext& ctx)
{
CV_UNUSED(v);
std::stringstream ss;
ss << ctx.message << ":" << std::endl
<< " '" << ctx.p1_str << "' must be 'false'";
cv::errorNoReturn(cv::Error::StsError, ss.str(), ctx.func, ctx.file, ctx.line);
}
void check_failed_auto(const int v, const CheckContext& ctx)
{
check_failed_auto_<int>(v, ctx);