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

Side by Side Diff: webrtc/modules/audio_coding/neteq/neteq_impl_unittest.cc

Issue 2685783014: Replace NULL with nullptr in all C++ files. (Closed)
Patch Set: Fixing android. Created 3 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2012 The WebRTC project authors. All Rights Reserved.
3 * 3 *
4 * Use of this source code is governed by a BSD-style license 4 * Use of this source code is governed by a BSD-style license
5 * that can be found in the LICENSE file in the root of the source 5 * that can be found in the LICENSE file in the root of the source
6 * tree. An additional intellectual property rights grant can be found 6 * tree. An additional intellectual property rights grant can be found
7 * in the file PATENTS. All contributing project authors may 7 * in the file PATENTS. All contributing project authors may
8 * be found in the AUTHORS file in the root of the source tree. 8 * be found in the AUTHORS file in the root of the source tree.
9 */ 9 */
10 10
(...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after
126 std::unique_ptr<MockRedPayloadSplitter> mock(new MockRedPayloadSplitter); 126 std::unique_ptr<MockRedPayloadSplitter> mock(new MockRedPayloadSplitter);
127 mock_payload_splitter_ = mock.get(); 127 mock_payload_splitter_ = mock.get();
128 deps.red_payload_splitter = std::move(mock); 128 deps.red_payload_splitter = std::move(mock);
129 } 129 }
130 red_payload_splitter_ = deps.red_payload_splitter.get(); 130 red_payload_splitter_ = deps.red_payload_splitter.get();
131 131
132 deps.timestamp_scaler = std::unique_ptr<TimestampScaler>( 132 deps.timestamp_scaler = std::unique_ptr<TimestampScaler>(
133 new TimestampScaler(*deps.decoder_database.get())); 133 new TimestampScaler(*deps.decoder_database.get()));
134 134
135 neteq_.reset(new NetEqImpl(config_, std::move(deps))); 135 neteq_.reset(new NetEqImpl(config_, std::move(deps)));
136 ASSERT_TRUE(neteq_ != NULL); 136 ASSERT_TRUE(neteq_ != nullptr);
137 } 137 }
138 138
139 void UseNoMocks() { 139 void UseNoMocks() {
140 ASSERT_TRUE(neteq_ == NULL) << "Must call UseNoMocks before CreateInstance"; 140 ASSERT_TRUE(neteq_ == nullptr)
141 << "Must call UseNoMocks before CreateInstance";
141 use_mock_buffer_level_filter_ = false; 142 use_mock_buffer_level_filter_ = false;
142 use_mock_decoder_database_ = false; 143 use_mock_decoder_database_ = false;
143 use_mock_delay_peak_detector_ = false; 144 use_mock_delay_peak_detector_ = false;
144 use_mock_delay_manager_ = false; 145 use_mock_delay_manager_ = false;
145 use_mock_dtmf_buffer_ = false; 146 use_mock_dtmf_buffer_ = false;
146 use_mock_dtmf_tone_generator_ = false; 147 use_mock_dtmf_tone_generator_ = false;
147 use_mock_packet_buffer_ = false; 148 use_mock_packet_buffer_ = false;
148 use_mock_payload_splitter_ = false; 149 use_mock_payload_splitter_ = false;
149 } 150 }
150 151
(...skipping 372 matching lines...) Expand 10 before | Expand all | Expand 10 after
523 // timestamp should match the playout timestamp. 524 // timestamp should match the playout timestamp.
524 // Wrap the expected value in an rtc::Optional to compare them as such. 525 // Wrap the expected value in an rtc::Optional to compare them as such.
525 EXPECT_EQ( 526 EXPECT_EQ(
526 rtc::Optional<uint32_t>(rtp_header.header.timestamp + 527 rtc::Optional<uint32_t>(rtp_header.header.timestamp +
527 output.data_[output.samples_per_channel_ - 1]), 528 output.data_[output.samples_per_channel_ - 1]),
528 neteq_->GetPlayoutTimestamp()); 529 neteq_->GetPlayoutTimestamp());
529 530
530 // Check the timestamp for the last value in the sync buffer. This should 531 // Check the timestamp for the last value in the sync buffer. This should
531 // be one full frame length ahead of the RTP timestamp. 532 // be one full frame length ahead of the RTP timestamp.
532 const SyncBuffer* sync_buffer = neteq_->sync_buffer_for_test(); 533 const SyncBuffer* sync_buffer = neteq_->sync_buffer_for_test();
533 ASSERT_TRUE(sync_buffer != NULL); 534 ASSERT_TRUE(sync_buffer != nullptr);
534 EXPECT_EQ(rtp_header.header.timestamp + kPayloadLengthSamples, 535 EXPECT_EQ(rtp_header.header.timestamp + kPayloadLengthSamples,
535 sync_buffer->end_timestamp()); 536 sync_buffer->end_timestamp());
536 537
537 // Check that the number of samples still to play from the sync buffer add 538 // Check that the number of samples still to play from the sync buffer add
538 // up with what was already played out. 539 // up with what was already played out.
539 EXPECT_EQ( 540 EXPECT_EQ(
540 kPayloadLengthSamples - output.data_[output.samples_per_channel_ - 1], 541 kPayloadLengthSamples - output.data_[output.samples_per_channel_ - 1],
541 sync_buffer->FutureLength()); 542 sync_buffer->FutureLength());
542 } 543 }
543 544
(...skipping 945 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _)) 1490 EXPECT_CALL(*mock_delay_manager_, BufferLimits(_, _))
1490 .Times(1) 1491 .Times(1)
1491 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2))); 1492 .WillOnce(DoAll(SetArgPointee<0>(1), SetArgPointee<1>(2)));
1492 1493
1493 bool muted; 1494 bool muted;
1494 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted)); 1495 EXPECT_EQ(NetEq::kOK, neteq_->GetAudio(&output_, &muted));
1495 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test()); 1496 EXPECT_EQ(kAccelerate, neteq_->last_operation_for_test());
1496 } 1497 }
1497 1498
1498 }// namespace webrtc 1499 }// namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698