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

Unified Diff: webrtc/common_audio/ring_buffer_unittest.cc

Issue 2683033004: Enable cpplint and fix cpplint errors in webrtc/*audio (Closed)
Patch Set: Rebase Created 3 years, 9 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/common_audio/ring_buffer_unittest.cc
diff --git a/webrtc/common_audio/ring_buffer_unittest.cc b/webrtc/common_audio/ring_buffer_unittest.cc
index a5b53b027a392941a970333c99f84c373f4c0452..20fc0142796630d500f29779a41c01b1078e7233 100644
--- a/webrtc/common_audio/ring_buffer_unittest.cc
+++ b/webrtc/common_audio/ring_buffer_unittest.cc
@@ -58,7 +58,8 @@ static void RandomStressTest(int** data_ptr) {
printf("seed=%u\n", seed);
srand(seed);
for (int i = 0; i < kNumTests; i++) {
- const int buffer_size = std::max(rand() % kMaxBufferSize, 1);
+ // rand_r is not supported on many platforms, so rand is used.
+ const int buffer_size = std::max(rand() % kMaxBufferSize, 1); // NOLINT
std::unique_ptr<int[]> write_data(new int[buffer_size]);
std::unique_ptr<int[]> read_data(new int[buffer_size]);
scoped_ring_buffer buffer(WebRtc_CreateBuffer(buffer_size, sizeof(int)));
@@ -68,8 +69,8 @@ static void RandomStressTest(int** data_ptr) {
int write_element = 0;
int read_element = 0;
for (int j = 0; j < kNumOps; j++) {
- const bool write = rand() % 2 == 0 ? true : false;
- const int num_elements = rand() % buffer_size;
+ const bool write = rand() % 2 == 0 ? true : false; // NOLINT
+ const int num_elements = rand() % buffer_size; // NOLINT
if (write) {
const int buffer_available = buffer_size - buffer_consumed;
ASSERT_EQ(static_cast<size_t>(buffer_available),

Powered by Google App Engine
This is Rietveld 408576698