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