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

tests: add "bigdata" tests

This commit is contained in:
Alexander Alekhin
2018-05-15 15:56:26 +03:00
parent 6582afcdbb
commit 703f79b757
3 changed files with 45 additions and 49 deletions
+22
View File
@@ -1776,4 +1776,26 @@ TEST(Mat_, template_based_ptr)
#endif
BIGDATA_TEST(Mat, push_back_regression_4158) // memory usage: ~10.6 Gb
{
Mat result;
Mat tail(100, 500000, CV_32FC2, Scalar(1, 2));
tail.copyTo(result);
for (int i = 1; i < 15; i++)
{
result.push_back(tail);
std::cout << "i = " << i << " result = " << result.size() << " used = " << (uint64)result.total()*result.elemSize()*(1.0 / (1 << 20)) << " Mb"
<< " allocated=" << (uint64)(result.datalimit - result.datastart)*(1.0 / (1 << 20)) << " Mb" << std::endl;
}
for (int i = 0; i < 15; i++)
{
Rect roi(0, tail.rows * i, tail.cols, tail.rows);
int nz = countNonZero(result(roi).reshape(1) == 2);
EXPECT_EQ(tail.total(), (size_t)nz) << "i=" << i;
}
}
}} // namespace