Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(588)

Unified Diff: webrtc/modules/audio_processing/audio_processing_unittest.cc

Issue 2810483002: Add SafeMin() and SafeMax(), which accept args of different types (Closed)
Patch Set: trigger error earlier Created 3 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
Index: webrtc/modules/audio_processing/audio_processing_unittest.cc
diff --git a/webrtc/modules/audio_processing/audio_processing_unittest.cc b/webrtc/modules/audio_processing/audio_processing_unittest.cc
index 814eea996745de865adbf5aed4a65a4fe5e820d7..c56a57b4c3bdf2d96e7425518c67bbee418d59c8 100644
--- a/webrtc/modules/audio_processing/audio_processing_unittest.cc
+++ b/webrtc/modules/audio_processing/audio_processing_unittest.cc
@@ -21,6 +21,7 @@
#include "webrtc/base/gtest_prod_util.h"
#include "webrtc/base/ignore_wundef.h"
#include "webrtc/base/protobuf_utils.h"
+#include "webrtc/base/safe_minmax.h"
#include "webrtc/common_audio/include/audio_util.h"
#include "webrtc/common_audio/resampler/include/push_resampler.h"
#include "webrtc/common_audio/resampler/push_sinc_resampler.h"
@@ -678,7 +679,7 @@ void ApmTest::ProcessDelayVerificationTest(int delay_ms, int system_delay_ms,
// Calculate expected delay estimate and acceptable regions. Further,
// limit them w.r.t. AEC delay estimation support.
const size_t samples_per_ms =
- std::min(static_cast<size_t>(16), frame_->samples_per_channel_ / 10);
+ rtc::SafeMin<size_t>(16u, frame_->samples_per_channel_ / 10);
int expected_median = std::min(std::max(delay_ms - system_delay_ms,
delay_min), delay_max);
int expected_median_high = std::min(
« no previous file with comments | « webrtc/modules/audio_coding/neteq/merge.cc ('k') | webrtc/modules/remote_bitrate_estimator/aimd_rate_control.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698