Cleanup: Using DCHECK comparison macros for unit types.

This provides nicer error messages.

Bug: webrtc:9883
Change-Id: I7664c12f34bec2ba46a4057b1f45958daf3944b8
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/132707
Reviewed-by: Åsa Persson <asapersson@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#27590}
diff --git a/modules/bitrate_controller/send_side_bandwidth_estimation.cc b/modules/bitrate_controller/send_side_bandwidth_estimation.cc
index 5802801..86ee24a 100644
--- a/modules/bitrate_controller/send_side_bandwidth_estimation.cc
+++ b/modules/bitrate_controller/send_side_bandwidth_estimation.cc
@@ -280,7 +280,7 @@
 
 void SendSideBandwidthEstimation::SetSendBitrate(DataRate bitrate,
                                                  Timestamp at_time) {
-  RTC_DCHECK(bitrate > DataRate::Zero());
+  RTC_DCHECK_GT(bitrate, DataRate::Zero());
   // Reset to avoid being capped by the estimate.
   delay_based_bitrate_ = DataRate::Zero();
   if (loss_based_bandwidth_estimation_.Enabled()) {
diff --git a/modules/video_coding/receiver_unittest.cc b/modules/video_coding/receiver_unittest.cc
index ae322f2..5631166 100644
--- a/modules/video_coding/receiver_unittest.cc
+++ b/modules/video_coding/receiver_unittest.cc
@@ -265,7 +265,7 @@
     bool frame_injected = false;
     while (!timestamps_.empty() &&
            timestamps_.front().arrive_time <= end_time) {
-      RTC_DCHECK(timestamps_.front().arrive_time >= start_time);
+      RTC_DCHECK_GE(timestamps_.front().arrive_time, start_time);
 
       SimulatedClock::AdvanceTimeMicroseconds(timestamps_.front().arrive_time -
                                               TimeInMicroseconds());
@@ -293,7 +293,7 @@
                  size_t size) {
     int64_t previous_arrive_timestamp = 0;
     for (size_t i = 0; i < size; i++) {
-      RTC_CHECK(arrive_timestamps[i] >= previous_arrive_timestamp);
+      RTC_CHECK_GE(arrive_timestamps[i], previous_arrive_timestamp);
       timestamps_.push(TimestampPair(arrive_timestamps[i] * 1000,
                                      render_timestamps[i] * 1000));
       previous_arrive_timestamp = arrive_timestamps[i];
diff --git a/test/scenario/scenario.cc b/test/scenario/scenario.cc
index f4c4b92..ff0cfe5 100644
--- a/test/scenario/scenario.cc
+++ b/test/scenario/scenario.cc
@@ -312,7 +312,7 @@
 }
 
 void Scenario::At(TimeDelta offset, std::function<void()> function) {
-  RTC_DCHECK_GT(offset.ms(), TimeSinceStart().ms());
+  RTC_DCHECK_GT(offset, TimeSinceStart());
   task_queue_.PostDelayedTask(function, TimeUntilTarget(offset).ms());
 }
 
diff --git a/test/scenario/video_stream.cc b/test/scenario/video_stream.cc
index d1493b2..f7d26ce 100644
--- a/test/scenario/video_stream.cc
+++ b/test/scenario/video_stream.cc
@@ -258,7 +258,7 @@
   if (slides.images.crop.width || slides.images.crop.height) {
     TimeDelta pause_duration =
         slides.change_interval - slides.images.crop.scroll_duration;
-    RTC_CHECK(pause_duration >= TimeDelta::Zero());
+    RTC_CHECK_GE(pause_duration, TimeDelta::Zero());
     int crop_width = slides.images.crop.width.value_or(slides.images.width);
     int crop_height = slides.images.crop.height.value_or(slides.images.height);
     RTC_CHECK_LE(crop_width, slides.images.width);
diff --git a/test/time_controller/simulated_time_controller.cc b/test/time_controller/simulated_time_controller.cc
index ba5e162..a592474 100644
--- a/test/time_controller/simulated_time_controller.cc
+++ b/test/time_controller/simulated_time_controller.cc
@@ -382,7 +382,7 @@
 
 void SimulatedTimeControllerImpl::AdvanceTime(Timestamp target_time) {
   rtc::CritScope time_lock(&time_lock_);
-  RTC_DCHECK(target_time >= current_time_);
+  RTC_DCHECK_GE(target_time, current_time_);
   current_time_ = target_time;
 }
 
diff --git a/video/video_stream_encoder.cc b/video/video_stream_encoder.cc
index 1cd8c92..9c184ba 100644
--- a/video/video_stream_encoder.cc
+++ b/video/video_stream_encoder.cc
@@ -1516,7 +1516,7 @@
                                           DataRate link_allocation,
                                           uint8_t fraction_lost,
                                           int64_t round_trip_time_ms) {
-  RTC_DCHECK(link_allocation >= target_bitrate);
+  RTC_DCHECK_GE(link_allocation, target_bitrate);
   if (!encoder_queue_.IsCurrent()) {
     encoder_queue_.PostTask([this, target_bitrate, link_allocation,
                              fraction_lost, round_trip_time_ms] {