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

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

Issue 1230503003: Update a ton of audio code to use size_t more correctly and in general reduce (Closed) Base URL: https://chromium.googlesource.com/external/webrtc@master
Patch Set: Resync Created 5 years, 3 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 296 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 EXPECT_EQ(kNumPlcCng, stats.decoded_plc_cng); 307 EXPECT_EQ(kNumPlcCng, stats.decoded_plc_cng);
308 } 308 }
309 309
310 TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) { 310 TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) {
311 AudioFrame audio_frame; 311 AudioFrame audio_frame;
312 const int kSampleRateHz = 32000; 312 const int kSampleRateHz = 32000;
313 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame)); 313 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame));
314 EXPECT_EQ(id_, audio_frame.id_); 314 EXPECT_EQ(id_, audio_frame.id_);
315 EXPECT_EQ(0u, audio_frame.timestamp_); 315 EXPECT_EQ(0u, audio_frame.timestamp_);
316 EXPECT_GT(audio_frame.num_channels_, 0); 316 EXPECT_GT(audio_frame.num_channels_, 0);
317 EXPECT_EQ(kSampleRateHz / 100, audio_frame.samples_per_channel_); 317 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100),
318 audio_frame.samples_per_channel_);
318 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_); 319 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_);
319 } 320 }
320 321
321 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { 322 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) {
322 AudioFrame audio_frame; 323 AudioFrame audio_frame;
323 EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame)); 324 EXPECT_EQ(-1, acm_->PlayoutData10Ms(0, &audio_frame));
324 } 325 }
325 326
326 // Checks that the transport callback is invoked once for each speech packet. 327 // Checks that the transport callback is invoked once for each speech packet.
327 // Also checks that the frame type is kAudioFrameSpeech. 328 // Also checks that the frame type is kAudioFrameSpeech.
(...skipping 1414 matching lines...) Expand 10 before | Expand all | Expand 10 after
1742 Run(16000, 8000, 1000); 1743 Run(16000, 8000, 1000);
1743 } 1744 }
1744 1745
1745 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1746 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1746 Run(8000, 16000, 1000); 1747 Run(8000, 16000, 1000);
1747 } 1748 }
1748 1749
1749 #endif 1750 #endif
1750 1751
1751 } // namespace webrtc 1752 } // namespace webrtc
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698