Commit e7e63fac authored by Ilya Lavrenov's avatar Ilya Lavrenov

eliminated possible memory leak

parent 452ea4c1
......@@ -2392,16 +2392,14 @@ TYPED_TEST_P(Core_CheckRange, Negative)
double min_bound = 4.5;
double max_bound = 16.0;
TypeParam data[] = {5, 10, 15, 4, 10 ,2, 8, 12, 14};
TypeParam data[] = {5, 10, 15, 4, 10, 2, 8, 12, 14};
cv::Mat src = cv::Mat(3,3, cv::DataDepth<TypeParam>::value, data);
cv::Point* bad_pt = new cv::Point(0, 0);
cv::Point bad_pt(0, 0);
ASSERT_FALSE(checkRange(src, true, bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt->x,0);
ASSERT_EQ(bad_pt->y,1);
delete bad_pt;
ASSERT_FALSE(checkRange(src, true, &bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt.x, 0);
ASSERT_EQ(bad_pt.y, 1);
}
TYPED_TEST_P(Core_CheckRange, Positive)
......@@ -2409,16 +2407,14 @@ TYPED_TEST_P(Core_CheckRange, Positive)
double min_bound = -1;
double max_bound = 16.0;
TypeParam data[] = {5, 10, 15, 4, 10 ,2, 8, 12, 14};
TypeParam data[] = {5, 10, 15, 4, 10, 2, 8, 12, 14};
cv::Mat src = cv::Mat(3,3, cv::DataDepth<TypeParam>::value, data);
cv::Point* bad_pt = new cv::Point(0, 0);
ASSERT_TRUE(checkRange(src, true, bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt->x,0);
ASSERT_EQ(bad_pt->y,0);
cv::Point bad_pt(0, 0);
delete bad_pt;
ASSERT_TRUE(checkRange(src, true, &bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt.x, 0);
ASSERT_EQ(bad_pt.y, 0);
}
TYPED_TEST_P(Core_CheckRange, Bounds)
......@@ -2426,16 +2422,14 @@ TYPED_TEST_P(Core_CheckRange, Bounds)
double min_bound = 24.5;
double max_bound = 1.0;
TypeParam data[] = {5, 10, 15, 4, 10 ,2, 8, 12, 14};
TypeParam data[] = {5, 10, 15, 4, 10, 2, 8, 12, 14};
cv::Mat src = cv::Mat(3,3, cv::DataDepth<TypeParam>::value, data);
cv::Point* bad_pt = new cv::Point(0, 0);
ASSERT_FALSE(checkRange(src, true, bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt->x,0);
ASSERT_EQ(bad_pt->y,0);
cv::Point bad_pt(0, 0);
delete bad_pt;
ASSERT_FALSE(checkRange(src, true, &bad_pt, min_bound, max_bound));
ASSERT_EQ(bad_pt.x, 0);
ASSERT_EQ(bad_pt.y, 0);
}
TYPED_TEST_P(Core_CheckRange, Zero)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment