Commit 9aeaeb7d authored by James Zern's avatar James Zern

tests: use scoped_ptr for local video source vars

prevents leak / static analysis  warnings on ASSERT*() failures

BUG=aomedia:447

Change-Id: I1d3edbdbb18dbbe3b17691971348a8121cf09afa
parent bd343f43
......@@ -134,12 +134,11 @@ class AvxEncoderParmsGetToDecoder
TEST_P(AvxEncoderParmsGetToDecoder, BitstreamParms) {
init_flags_ = AOM_CODEC_USE_PSNR;
libaom_test::VideoSource *const video =
new libaom_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames);
ASSERT_TRUE(video != NULL);
testing::internal::scoped_ptr<libaom_test::VideoSource> video(
new libaom_test::Y4mVideoSource(test_video_.name, 0, test_video_.frames));
ASSERT_TRUE(video.get() != NULL);
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
delete video;
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
}
AV1_INSTANTIATE_TEST_CASE(AvxEncoderParmsGetToDecoder,
......
......@@ -171,20 +171,20 @@ TEST_P(EndToEndTestLarge, EndtoEndPSNRTest) {
init_flags_ = AOM_CODEC_USE_PSNR;
if (cfg_.g_bit_depth > 8) init_flags_ |= AOM_CODEC_USE_HIGHBITDEPTH;
libaom_test::VideoSource *video;
testing::internal::scoped_ptr<libaom_test::VideoSource> video;
if (is_extension_y4m(test_video_param_.filename)) {
video =
new libaom_test::Y4mVideoSource(test_video_param_.filename, 0, kFrames);
video.reset(new libaom_test::Y4mVideoSource(test_video_param_.filename, 0,
kFrames));
} else {
video = new libaom_test::YUVVideoSource(test_video_param_.filename,
test_video_param_.fmt, kWidth,
kHeight, kFramerate, 1, 0, kFrames);
video.reset(new libaom_test::YUVVideoSource(
test_video_param_.filename, test_video_param_.fmt, kWidth, kHeight,
kFramerate, 1, 0, kFrames));
}
ASSERT_TRUE(video.get() != NULL);
ASSERT_NO_FATAL_FAILURE(RunLoop(video));
ASSERT_NO_FATAL_FAILURE(RunLoop(video.get()));
const double psnr = GetAveragePsnr();
EXPECT_GT(psnr, GetPsnrThreshold());
delete (video);
}
AV1_INSTANTIATE_TEST_CASE(EndToEndTestLarge,
......
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