From: James Zern Date: Wed, 18 Mar 2015 21:37:20 +0000 (-0700) Subject: external_frame_buffer_test: quiet static analysis warnings X-Git-Tag: v1.4.0~11^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=b373301e1fa1ac229a08858442f3621cc7022feb;p=platform%2Fupstream%2Flibvpx.git external_frame_buffer_test: quiet static analysis warnings add explicit returns in cases where ASSERT_* can't be used due to the function returning a value; retain the EXPECT_* for reporting purposes. Change-Id: I1f514728537fee42a99277d3aba538e832d3b65b --- diff --git a/test/external_frame_buffer_test.cc b/test/external_frame_buffer_test.cc index 70b3009..d02dca2 100644 --- a/test/external_frame_buffer_test.cc +++ b/test/external_frame_buffer_test.cc @@ -97,13 +97,19 @@ class ExternalFrameBufferList { return 0; } - // Marks the external frame buffer that |fb| is pointing too as free. + // Marks the external frame buffer that |fb| is pointing to as free. // Returns < 0 on an error. int ReturnFrameBuffer(vpx_codec_frame_buffer_t *fb) { - EXPECT_TRUE(fb != NULL); + if (fb == NULL) { + EXPECT_TRUE(fb != NULL); + return -1; + } ExternalFrameBuffer *const ext_fb = reinterpret_cast(fb->priv); - EXPECT_TRUE(ext_fb != NULL); + if (ext_fb == NULL) { + EXPECT_TRUE(ext_fb != NULL); + return -1; + } EXPECT_EQ(1, ext_fb->in_use); ext_fb->in_use = 0; return 0;