From ffabbfa77868089853617948ed41c7a57c0dd359 Mon Sep 17 00:00:00 2001 From: Vadim Pisarevsky Date: Thu, 14 May 2015 18:21:26 +0300 Subject: [PATCH] added test to prove that remap does not leak memory (http://code.opencv.org/issues/2502). disabled the test for now to save execution time. --- modules/imgproc/test/test_imgwarp.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/modules/imgproc/test/test_imgwarp.cpp b/modules/imgproc/test/test_imgwarp.cpp index bf3f6b3c4c..4ffd50b41a 100644 --- a/modules/imgproc/test/test_imgwarp.cpp +++ b/modules/imgproc/test/test_imgwarp.cpp @@ -1668,4 +1668,28 @@ TEST(Imgproc_GetAffineTransform, singularity) ASSERT_EQ(0.0, norm(trans, NORM_INF)); } +TEST(Imgproc_Remap, DISABLED_memleak) +{ + Mat src; + const int N = 400; + src.create(N, N, CV_8U); + randu(src, 0, 256); + Mat map_x, map_y, dst; + dst.create( src.size(), src.type() ); + map_x.create( src.size(), CV_32FC1 ); + map_y.create( src.size(), CV_32FC1 ); + randu(map_x, 0., N+0.); + randu(map_y, 0., N+0.); + + for( int iter = 0; iter < 10000; iter++ ) + { + if(iter % 100 == 0) + { + putchar('.'); + fflush(stdout); + } + remap(src, dst, map_x, map_y, CV_INTER_LINEAR); + } +} + /* End of file. */