diff --git a/modules/audio_coding/neteq/neteq_impl_unittest.cc b/modules/audio_coding/neteq/neteq_impl_unittest.cc index 45d7f26c52..e8d9b10dd8 100644 --- a/modules/audio_coding/neteq/neteq_impl_unittest.cc +++ b/modules/audio_coding/neteq/neteq_impl_unittest.cc @@ -569,7 +569,7 @@ TEST_F(NetEqImplTest, ReorderedPacket) { EXPECT_CALL(mock_decoder, IncomingPacket(_, kPayloadLengthBytes, _, _, _)) .WillRepeatedly(Return(0)); EXPECT_CALL(mock_decoder, PacketDuration(_, kPayloadLengthBytes)) - .WillRepeatedly(Return(kPayloadLengthSamples)); + .WillRepeatedly(Return(rtc::checked_cast(kPayloadLengthSamples))); int16_t dummy_output[kPayloadLengthSamples] = {0}; // The below expectation will make the mock decoder write // |kPayloadLengthSamples| zeros to the output array, and mark it as speech. diff --git a/modules/audio_processing/aec/system_delay_unittest.cc b/modules/audio_processing/aec/system_delay_unittest.cc index db73d7e183..87b76afcd2 100644 --- a/modules/audio_processing/aec/system_delay_unittest.cc +++ b/modules/audio_processing/aec/system_delay_unittest.cc @@ -10,6 +10,7 @@ #include "modules/audio_processing/aec/aec_core.h" #include "modules/audio_processing/aec/echo_cancellation.h" +#include "rtc_base/safe_conversions.h" #include "test/gtest.h" #include "typedefs.h" // NOLINT(build/include) namespace webrtc { @@ -240,8 +241,9 @@ TEST_F(SystemDelayTest, CorrectDelayAfterStableStartup) { static_cast(kDeviceBufMs * samples_per_frame_ / 10); EXPECT_GE(average_reported_delay, WebRtcAec_system_delay(self_->aec)); int lower_bound = WebRtcAec_extended_filter_enabled(self_->aec) - ? average_reported_delay / 2 - samples_per_frame_ - : average_reported_delay * 3 / 4; + ? (average_reported_delay / 2 - + rtc::checked_cast(samples_per_frame_)) + : average_reported_delay * 3 / 4; EXPECT_LE(lower_bound, WebRtcAec_system_delay(self_->aec)); } }