Enabling clang::find_bad_constructs for AEC3.

This CL removes //build/config/clang:find_bad_constructs from the
suppressed_configs list, which means that clang:find_bad_constructs
is now enabled on these translation units.

Bug: webrtc:9251
Change-Id: Ibdafc0bb08de1be7189af7053a67a24e3a26bd6b
Reviewed-on: https://webrtc-review.googlesource.com/89001
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Commit-Queue: Mirko Bonadei <mbonadei@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#23997}
This commit is contained in:
Mirko Bonadei
2018-07-17 09:56:46 +02:00
committed by Commit Bot
parent f70446874a
commit a6c544d08d
10 changed files with 110 additions and 27 deletions

View File

@ -136,9 +136,13 @@ if (rtc_include_tests) {
configs += [ "..:apm_debug_dump" ]
sources = [
"mock/mock_block_processor.cc",
"mock/mock_block_processor.h",
"mock/mock_echo_remover.cc",
"mock/mock_echo_remover.h",
"mock/mock_render_delay_buffer.cc",
"mock/mock_render_delay_buffer.h",
"mock/mock_render_delay_controller.cc",
"mock/mock_render_delay_controller.h",
]
@ -199,10 +203,5 @@ if (rtc_include_tests) {
"vector_math_unittest.cc",
]
}
if ((!build_with_chromium || is_win) && is_clang) {
# Suppress warnings from the Chromium Clang plugin (bugs.webrtc.org/163).
suppressed_configs += [ "//build/config/clang:find_bad_constructs" ]
}
}
}

View File

@ -73,7 +73,7 @@ TEST(AdaptiveFirFilter, FilterAdaptationNeonOptimizations) {
}
render_delay_buffer->PrepareCaptureProcessing();
}
const auto& render_buffer = render_delay_buffer->GetRenderBuffer();
auto* const render_buffer = render_delay_buffer->GetRenderBuffer();
for (size_t j = 0; j < G.re.size(); ++j) {
G.re[j] = j / 10001.f;
@ -183,7 +183,7 @@ TEST(AdaptiveFirFilter, FilterAdaptationSse2Optimizations) {
render_delay_buffer->Reset();
}
render_delay_buffer->PrepareCaptureProcessing();
const auto& render_buffer = render_delay_buffer->GetRenderBuffer();
auto* const render_buffer = render_delay_buffer->GetRenderBuffer();
ApplyFilter_SSE2(*render_buffer, H_SSE2, &S_SSE2);
ApplyFilter(*render_buffer, H_C, &S_C);
@ -369,7 +369,7 @@ TEST(AdaptiveFirFilter, FilterAndAdapt) {
render_delay_buffer->Reset();
}
render_delay_buffer->PrepareCaptureProcessing();
const auto& render_buffer = render_delay_buffer->GetRenderBuffer();
auto* const render_buffer = render_delay_buffer->GetRenderBuffer();
render_signal_analyzer.Update(*render_buffer,
aec_state.FilterDelayBlocks());

View File

@ -0,0 +1,20 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/mock/mock_block_processor.h"
namespace webrtc {
namespace test {
MockBlockProcessor::MockBlockProcessor() = default;
MockBlockProcessor::~MockBlockProcessor() = default;
} // namespace test
} // namespace webrtc

View File

@ -21,7 +21,8 @@ namespace test {
class MockBlockProcessor : public BlockProcessor {
public:
virtual ~MockBlockProcessor() {}
MockBlockProcessor();
virtual ~MockBlockProcessor();
MOCK_METHOD3(ProcessCapture,
void(bool level_change,

View File

@ -0,0 +1,20 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/mock/mock_echo_remover.h"
namespace webrtc {
namespace test {
MockEchoRemover::MockEchoRemover() = default;
MockEchoRemover::~MockEchoRemover() = default;
} // namespace test
} // namespace webrtc

View File

@ -24,7 +24,8 @@ namespace test {
class MockEchoRemover : public EchoRemover {
public:
virtual ~MockEchoRemover() = default;
MockEchoRemover();
virtual ~MockEchoRemover();
MOCK_METHOD5(ProcessCapture,
void(EchoPathVariability echo_path_variability,

View File

@ -0,0 +1,35 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/mock/mock_render_delay_buffer.h"
namespace webrtc {
namespace test {
MockRenderDelayBuffer::MockRenderDelayBuffer(int sample_rate_hz)
: block_buffer_(GetRenderDelayBufferSize(4, 4, 12),
NumBandsForRate(sample_rate_hz),
kBlockSize),
spectrum_buffer_(block_buffer_.buffer.size(), kFftLengthBy2Plus1),
fft_buffer_(block_buffer_.buffer.size()),
render_buffer_(&block_buffer_, &spectrum_buffer_, &fft_buffer_),
downsampled_render_buffer_(GetDownSampledBufferSize(4, 4)) {
ON_CALL(*this, GetRenderBuffer())
.WillByDefault(
testing::Invoke(this, &MockRenderDelayBuffer::FakeGetRenderBuffer));
ON_CALL(*this, GetDownsampledRenderBuffer())
.WillByDefault(testing::Invoke(
this, &MockRenderDelayBuffer::FakeGetDownsampledRenderBuffer));
}
MockRenderDelayBuffer::~MockRenderDelayBuffer() = default;
} // namespace test
} // namespace webrtc

View File

@ -24,22 +24,8 @@ namespace test {
class MockRenderDelayBuffer : public RenderDelayBuffer {
public:
explicit MockRenderDelayBuffer(int sample_rate_hz)
: block_buffer_(GetRenderDelayBufferSize(4, 4, 12),
NumBandsForRate(sample_rate_hz),
kBlockSize),
spectrum_buffer_(block_buffer_.buffer.size(), kFftLengthBy2Plus1),
fft_buffer_(block_buffer_.buffer.size()),
render_buffer_(&block_buffer_, &spectrum_buffer_, &fft_buffer_),
downsampled_render_buffer_(GetDownSampledBufferSize(4, 4)) {
ON_CALL(*this, GetRenderBuffer())
.WillByDefault(
testing::Invoke(this, &MockRenderDelayBuffer::FakeGetRenderBuffer));
ON_CALL(*this, GetDownsampledRenderBuffer())
.WillByDefault(testing::Invoke(
this, &MockRenderDelayBuffer::FakeGetDownsampledRenderBuffer));
}
virtual ~MockRenderDelayBuffer() = default;
explicit MockRenderDelayBuffer(int sample_rate_hz);
virtual ~MockRenderDelayBuffer();
MOCK_METHOD0(Reset, void());
MOCK_METHOD1(Insert,

View File

@ -0,0 +1,20 @@
/*
* Copyright (c) 2018 The WebRTC project authors. All Rights Reserved.
*
* Use of this source code is governed by a BSD-style license
* that can be found in the LICENSE file in the root of the source
* tree. An additional intellectual property rights grant can be found
* in the file PATENTS. All contributing project authors may
* be found in the AUTHORS file in the root of the source tree.
*/
#include "modules/audio_processing/aec3/mock/mock_render_delay_controller.h"
namespace webrtc {
namespace test {
MockRenderDelayController::MockRenderDelayController() = default;
MockRenderDelayController::~MockRenderDelayController() = default;
} // namespace test
} // namespace webrtc

View File

@ -22,7 +22,8 @@ namespace test {
class MockRenderDelayController : public RenderDelayController {
public:
virtual ~MockRenderDelayController() = default;
MockRenderDelayController();
virtual ~MockRenderDelayController();
MOCK_METHOD0(Reset, void());
MOCK_METHOD0(LogRenderCall, void());