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

Unified Diff: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc

Issue 1734583002: Fix ubsan warnings in BWE tests. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: . Created 4 years, 10 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
« no previous file with comments | « no previous file | webrtc/modules/remote_bitrate_estimator/test/estimators/nada.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc
diff --git a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc
index d67c538a5b1e7f867a53e615137f1115b4375de0..41576516db7409c1fa67f847918b03821a8c199f 100644
--- a/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc
+++ b/webrtc/modules/remote_bitrate_estimator/remote_bitrate_estimator_unittest_helper.cc
@@ -446,13 +446,14 @@ void RemoteBitrateEstimatorTest::CapacityDropTestHelper(
if (i > 0) {
bitrate = (kStartBitrate * i + kBitrateDenom / 2) / kBitrateDenom;
}
- stream_generator_->AddStream(new testing::RtpStream(
- kFramerate, // Frames per second.
- bitrate, // Bitrate.
- kDefaultSsrc + i, // SSRC.
- 90000, // RTP frequency.
- 0xFFFFF000 ^ (~0 << (32 - i)), // Timestamp offset.
- 0)); // RTCP receive time.
+ uint32_t mask = ~0ull << (32 - i);
+ stream_generator_->AddStream(
+ new testing::RtpStream(kFramerate, // Frames per second.
+ bitrate, // Bitrate.
+ kDefaultSsrc + i, // SSRC.
+ 90000, // RTP frequency.
+ 0xFFFFF000u ^ mask, // Timestamp offset.
+ 0)); // RTCP receive time.
bitrate_sum += bitrate;
}
ASSERT_EQ(bitrate_sum, kStartBitrate);
« no previous file with comments | « no previous file | webrtc/modules/remote_bitrate_estimator/test/estimators/nada.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698