aboutsummaryrefslogtreecommitdiff
path: root/audio/audio_send_stream_unittest.cc
diff options
context:
space:
mode:
authorSebastian Jansson <srte@webrtc.org>2018-02-22 11:09:56 +0100
committerCommit Bot <commit-bot@chromium.org>2018-02-22 14:26:59 +0000
commit41f16bec9f5acaaab2602037284783c10b05f78b (patch)
treea057442168558240ca898c32e33f954ab0634d3c /audio/audio_send_stream_unittest.cc
parentdfde334be0759cf106ad368fe857517cda19bea6 (diff)
downloadwebrtc-41f16bec9f5acaaab2602037284783c10b05f78b.tar.gz
Silencing warnings in audio send stream unit tests.
The unit tests for AudioSendStream was generating a lot of warnings about "Uninteresting mock function call" on mocked objects. This is due to the default gmock implementation being NaggyMock and there was no NiceMock override. With this change the mocks are replaced with NiceMock implementations which do not output warnings for unexpected calls. This makes the error output from the test runner much easier to visually parse to find the actual errors in failing tests. Bug: None Change-Id: Ic40db78159536ddeaa72a468fc2cb3ec17386d44 Reviewed-on: https://webrtc-review.googlesource.com/56220 Reviewed-by: Karl Wiberg <kwiberg@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#22152}
Diffstat (limited to 'audio/audio_send_stream_unittest.cc')
-rw-r--r--audio/audio_send_stream_unittest.cc8
1 files changed, 5 insertions, 3 deletions
diff --git a/audio/audio_send_stream_unittest.cc b/audio/audio_send_stream_unittest.cc
index c5adca7a23..43e6c47865 100644
--- a/audio/audio_send_stream_unittest.cc
+++ b/audio/audio_send_stream_unittest.cc
@@ -84,7 +84,8 @@ std::unique_ptr<MockAudioEncoder> SetupAudioEncoderMock(
const SdpAudioFormat& format) {
for (const auto& spec : kCodecSpecs) {
if (format == spec.format) {
- std::unique_ptr<MockAudioEncoder> encoder(new MockAudioEncoder);
+ std::unique_ptr<MockAudioEncoder> encoder(
+ new testing::NiceMock<MockAudioEncoder>());
ON_CALL(*encoder.get(), SampleRateHz())
.WillByDefault(Return(spec.info.sample_rate_hz));
ON_CALL(*encoder.get(), NumChannels())
@@ -185,6 +186,7 @@ struct ConfigHelper {
}
void SetupDefaultChannelProxy(bool audio_bwe_enabled) {
+ EXPECT_TRUE(channel_proxy_ == nullptr);
channel_proxy_ = new testing::StrictMock<MockVoEChannelProxy>();
EXPECT_CALL(*channel_proxy_, GetRtpRtcp(_, _))
.WillRepeatedly(Invoke(
@@ -303,9 +305,9 @@ struct ConfigHelper {
AudioProcessingStats audio_processing_stats_;
SimulatedClock simulated_clock_;
TimeInterval active_lifetime_;
- MockRtcEventLog event_log_;
+ testing::NiceMock<MockRtcEventLog> event_log_;
RtpTransportControllerSend rtp_transport_;
- MockRtpRtcp rtp_rtcp_;
+ testing::NiceMock<MockRtpRtcp> rtp_rtcp_;
MockRtcpRttStats rtcp_rtt_stats_;
testing::NiceMock<MockLimitObserver> limit_observer_;
BitrateAllocator bitrate_allocator_;