mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 23:33:05 +04:00
Merge pull request #15966 from saskatchewancatch:issue-15760
Add checks for empty operands in Matrix expressions that don't check properly * Starting to add checks for empty operands in Matrix expressions that don't check properly. * Adding checks and delcarations for checker functions * Fix signatures and add checks for each class of Matrix Expr operation * Make it catch the right exception * Don't expose helper functions to public API
This commit is contained in:
committed by
Alexander Alekhin
parent
1c4a64f0a1
commit
e6ce752da1
@@ -1467,4 +1467,19 @@ TEST(Core_sortIdx, regression_8941)
|
||||
"expected=" << std::endl << expected;
|
||||
}
|
||||
|
||||
|
||||
//These tests guard regressions against running MatExpr
|
||||
//operations on empty operands and giving bogus
|
||||
//results.
|
||||
TEST(Core_MatExpr, empty_check_15760)
|
||||
{
|
||||
EXPECT_THROW(Mat c = min(Mat(), Mat()), cv::Exception);
|
||||
EXPECT_THROW(Mat c = abs(Mat()), cv::Exception);
|
||||
EXPECT_THROW(Mat c = min(Mat(), Mat()), cv::Exception);
|
||||
EXPECT_THROW(Mat c = Mat() | Mat(), cv::Exception);
|
||||
EXPECT_THROW(Mat c = Mat() + Mat(), cv::Exception);
|
||||
EXPECT_THROW(Mat c = Mat().t(), cv::Exception);
|
||||
EXPECT_THROW(Mat c = Mat().cross(Mat()), cv::Exception);
|
||||
}
|
||||
|
||||
}} // namespace
|
||||
|
||||
Reference in New Issue
Block a user