mirror of
https://github.com/opencv/opencv.git
synced 2025-06-11 11:45:30 +08:00
Merge pull request #16577 from Volskig:mp/ocv-gapi-work
This commit is contained in:
commit
23bc89d6fc
@ -230,6 +230,7 @@ namespace cv { namespace gapi { namespace own {
|
||||
*/
|
||||
void create(Size _size, int _type)
|
||||
{
|
||||
GAPI_Assert(_size.height >= 0 && _size.width >= 0);
|
||||
if (_size != Size{cols, rows} )
|
||||
{
|
||||
Mat tmp{_size.height, _size.width, _type, nullptr};
|
||||
|
@ -588,4 +588,23 @@ TEST(OwnMat, ROIView)
|
||||
<< to_ocv(roi_view) << std::endl
|
||||
<< expected_cv_mat << std::endl;
|
||||
}
|
||||
|
||||
TEST(OwnMat, CreateWithNegativeDims)
|
||||
{
|
||||
Mat own_mat;
|
||||
ASSERT_ANY_THROW(own_mat.create(cv::Size{-1, -1}, CV_8U));
|
||||
}
|
||||
|
||||
TEST(OwnMat, CreateWithNegativeWidth)
|
||||
{
|
||||
Mat own_mat;
|
||||
ASSERT_ANY_THROW(own_mat.create(cv::Size{-1, 1}, CV_8U));
|
||||
}
|
||||
|
||||
TEST(OwnMat, CreateWithNegativeHeight)
|
||||
{
|
||||
Mat own_mat;
|
||||
ASSERT_ANY_THROW(own_mat.create(cv::Size{1, -1}, CV_8U));
|
||||
}
|
||||
|
||||
} // namespace opencv_test
|
||||
|
Loading…
Reference in New Issue
Block a user