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

Side by Side Diff: webrtc/modules/audio_coding/main/acm2/audio_coding_module_unittest_oldapi.cc

Issue 1225133003: Update audio code to use size_t more correctly, (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Review comment Created 5 years, 5 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) 2014 The WebRTC project authors. All Rights Reserved. 2 * Copyright (c) 2014 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 294 matching lines...) Expand 10 before | Expand all | Expand 10 after
305 EXPECT_EQ(kNumPlcCng, stats.decoded_plc_cng); 305 EXPECT_EQ(kNumPlcCng, stats.decoded_plc_cng);
306 } 306 }
307 307
308 TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) { 308 TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) {
309 AudioFrame audio_frame; 309 AudioFrame audio_frame;
310 const int kSampleRateHz = 32000; 310 const int kSampleRateHz = 32000;
311 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame)); 311 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame));
312 EXPECT_EQ(id_, audio_frame.id_); 312 EXPECT_EQ(id_, audio_frame.id_);
313 EXPECT_EQ(0u, audio_frame.timestamp_); 313 EXPECT_EQ(0u, audio_frame.timestamp_);
314 EXPECT_GT(audio_frame.num_channels_, 0); 314 EXPECT_GT(audio_frame.num_channels_, 0);
315 EXPECT_EQ(kSampleRateHz / 100, audio_frame.samples_per_channel_); 315 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100),
316 audio_frame.samples_per_channel_);
316 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_); 317 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_);
317 } 318 }
318 319
319 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { 320 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) {
320 AudioFrame audio_frame; 321 AudioFrame audio_frame;
321 EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame)); 322 EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame));
322 } 323 }
323 324
324 // Checks that the transport callback is invoked once for each speech packet. 325 // Checks that the transport callback is invoked once for each speech packet.
325 // Also checks that the frame type is kAudioFrameSpeech. 326 // Also checks that the frame type is kAudioFrameSpeech.
(...skipping 1358 matching lines...) Expand 10 before | Expand all | Expand 10 after
1684 Run(16000, 8000, 1000); 1685 Run(16000, 8000, 1000);
1685 } 1686 }
1686 1687
1687 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1688 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1688 Run(8000, 16000, 1000); 1689 Run(8000, 16000, 1000);
1689 } 1690 }
1690 1691
1691 #endif 1692 #endif
1692 1693
1693 } // namespace webrtc 1694 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698