summaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAlex Converse <aconverse@google.com>2016-07-21 11:38:27 -0700
committerAlex Converse <aconverse@google.com>2016-07-21 11:40:51 -0700
commit18c7f46c125c107fc08d31f617b2178482fed011 (patch)
tree92b6258dfd7a8910734e34c4eac37c784f8a867e /test
parent92e91bd3a17696df45b1eca3ffeff0520c68d3e4 (diff)
downloadlibvpx-18c7f46c125c107fc08d31f617b2178482fed011.tar.gz
libvpx-18c7f46c125c107fc08d31f617b2178482fed011.tar.bz2
libvpx-18c7f46c125c107fc08d31f617b2178482fed011.zip
MinArfFreqTest: Don't leak video on failure.
Change-Id: I250379f0ac8d4929c9032e7343290e2980fc2e77
Diffstat (limited to 'test')
-rw-r--r--test/vp9_arf_freq_test.cc23
1 files changed, 11 insertions, 12 deletions
diff --git a/test/vp9_arf_freq_test.cc b/test/vp9_arf_freq_test.cc
index aa3e34d62..d00603da0 100644
--- a/test/vp9_arf_freq_test.cc
+++ b/test/vp9_arf_freq_test.cc
@@ -200,28 +200,27 @@ TEST_P(ArfFreqTest, MinArfFreqTest) {
if (cfg_.g_bit_depth > 8)
init_flags_ |= VPX_CODEC_USE_HIGHBITDEPTH;
- libvpx_test::VideoSource *video;
+ testing::internal::scoped_ptr<libvpx_test::VideoSource> video;
if (is_extension_y4m(test_video_param_.filename)) {
- video = new libvpx_test::Y4mVideoSource(test_video_param_.filename,
- 0, kFrames);
+ video.reset(new libvpx_test::Y4mVideoSource(test_video_param_.filename,
+ 0, kFrames));
} else {
- video = new libvpx_test::YUVVideoSource(test_video_param_.filename,
- test_video_param_.fmt,
- test_video_param_.width,
- test_video_param_.height,
- test_video_param_.framerate_num,
- test_video_param_.framerate_den,
- 0, kFrames);
+ video.reset(new libvpx_test::YUVVideoSource(test_video_param_.filename,
+ test_video_param_.fmt,
+ test_video_param_.width,
+ test_video_param_.height,
+ test_video_param_.framerate_num,
+ test_video_param_.framerate_den,
+ 0, kFrames));
}
- ASSERT_NO_FATAL_FAILURE(RunLoop(video));
+ ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
const int min_run = GetMinVisibleRun();
const int min_arf_dist_requested = GetMinArfDistanceRequested();
if (min_run != ARF_NOT_SEEN && min_run != ARF_SEEN_ONCE) {
const int min_arf_dist = min_run + 1;
EXPECT_GE(min_arf_dist, min_arf_dist_requested);
}
- delete(video);
}
VP9_INSTANTIATE_TEST_CASE(