From 41f16bec9f5acaaab2602037284783c10b05f78b Mon Sep 17 00:00:00 2001 From: Sebastian Jansson Date: Thu, 22 Feb 2018 11:09:56 +0100 Subject: 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 Commit-Queue: Sebastian Jansson Cr-Commit-Position: refs/heads/master@{#22152} --- audio/audio_send_stream_unittest.cc | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'audio/audio_send_stream_unittest.cc') 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 SetupAudioEncoderMock( const SdpAudioFormat& format) { for (const auto& spec : kCodecSpecs) { if (format == spec.format) { - std::unique_ptr encoder(new MockAudioEncoder); + std::unique_ptr encoder( + new testing::NiceMock()); 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(); 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 event_log_; RtpTransportControllerSend rtp_transport_; - MockRtpRtcp rtp_rtcp_; + testing::NiceMock rtp_rtcp_; MockRtcpRttStats rtcp_rtt_stats_; testing::NiceMock limit_observer_; BitrateAllocator bitrate_allocator_; -- cgit v1.2.3