From c101a5f5c4cf01dd35af393a285f8dce704439fb Mon Sep 17 00:00:00 2001 From: Linfeng Zhang Date: Thu, 22 Mar 2018 10:46:02 -0700 Subject: [PATCH] Fix dangling-else warnings Compiler -- gcc (Debian 7.3.0-5) 7.3.0 Change-Id: If2dcc6e215a2990cde575f0e744ce0c7a44a15f1 --- test/byte_alignment_test.cc | 3 ++- test/convolve_test.cc | 4 +++- test/decode_test_driver.cc | 3 ++- test/keyframe_test.cc | 7 +++++-- 4 files changed, 12 insertions(+), 5 deletions(-) diff --git a/test/byte_alignment_test.cc b/test/byte_alignment_test.cc index 5a058b2..0ef6c4c 100644 --- a/test/byte_alignment_test.cc +++ b/test/byte_alignment_test.cc @@ -171,8 +171,9 @@ TEST_F(ByteAlignmentTest, SwitchByteAlignment) { TEST_P(ByteAlignmentTest, TestAlignment) { const ByteAlignmentTestParam t = GetParam(); SetByteAlignment(t.byte_alignment, t.expected_value); - if (t.decode_remaining) + if (t.decode_remaining) { ASSERT_EQ(VPX_CODEC_OK, DecodeRemainingFrames(t.byte_alignment)); + } } INSTANTIATE_TEST_CASE_P(Alignments, ByteAlignmentTest, diff --git a/test/convolve_test.cc b/test/convolve_test.cc index 70f0b11..3f03671 100644 --- a/test/convolve_test.cc +++ b/test/convolve_test.cc @@ -450,7 +450,9 @@ class ConvolveTest : public ::testing::TestWithParam { void CheckGuardBlocks() { for (int i = 0; i < kOutputBufferSize; ++i) { - if (IsIndexInBorder(i)) EXPECT_EQ(255, output_[i]); + if (IsIndexInBorder(i)) { + EXPECT_EQ(255, output_[i]); + } } } diff --git a/test/decode_test_driver.cc b/test/decode_test_driver.cc index 48680eb..f622482 100644 --- a/test/decode_test_driver.cc +++ b/test/decode_test_driver.cc @@ -52,9 +52,10 @@ void DecoderTest::HandlePeekResult(Decoder *const decoder, /* Vp8's implementation of PeekStream returns an error if the frame you * pass it is not a keyframe, so we only expect VPX_CODEC_OK on the first * frame, which must be a keyframe. */ - if (video->frame_number() == 0) + if (video->frame_number() == 0) { ASSERT_EQ(VPX_CODEC_OK, res_peek) << "Peek return failed: " << vpx_codec_err_to_string(res_peek); + } } else { /* The Vp9 implementation of PeekStream returns an error only if the * data passed to it isn't a valid Vp9 chunk. */ diff --git a/test/keyframe_test.cc b/test/keyframe_test.cc index ee75f40..2dab0cb 100644 --- a/test/keyframe_test.cc +++ b/test/keyframe_test.cc @@ -68,7 +68,9 @@ TEST_P(KeyframeTest, TestRandomVideoSource) { // In realtime mode - auto placed keyframes are exceedingly rare, don't // bother with this check if(GetParam() > 0) - if (GET_PARAM(1) > 0) EXPECT_GT(kf_count_, 1); + if (GET_PARAM(1) > 0) { + EXPECT_GT(kf_count_, 1); + } } TEST_P(KeyframeTest, TestDisableKeyframes) { @@ -128,8 +130,9 @@ TEST_P(KeyframeTest, TestAutoKeyframe) { // In realtime mode - auto placed keyframes are exceedingly rare, don't // bother with this check - if (GET_PARAM(1) > 0) + if (GET_PARAM(1) > 0) { EXPECT_EQ(2u, kf_pts_list_.size()) << " Not the right number of keyframes "; + } // Verify that keyframes match the file keyframes in the file. for (std::vector::const_iterator iter = kf_pts_list_.begin(); -- 2.7.4