Added test for #1997; fixed build warnings

This commit is contained in:
Andrey Kamaev
2012-05-31 06:59:06 +00:00
parent 6d498495d3
commit 1a572c8e89
2 changed files with 20 additions and 2 deletions

View File

@@ -22,4 +22,21 @@ TEST(Core_Drawing, _914)
int pixelsDrawn = rows*cols - countNonZero(img);
ASSERT_EQ( (3*rows + cols)*3 - 3*9, pixelsDrawn);
}
TEST(Core_OutputArraySreate, _1997)
{
struct local {
static void create(OutputArray arr, Size submatSize, int type)
{
int sizes[] = {submatSize.width, submatSize.height};
arr.create(sizeof(sizes)/sizeof(sizes[0]), sizes, type);
}
};
Mat mat(Size(512, 512), CV_8U);
Size submatSize = Size(256, 256);
ASSERT_NO_THROW(local::create( mat(Rect(Point(), submatSize)), submatSize, mat.type() ));
}