OLD | NEW |
1 /* | 1 /* |
2 * Copyright (c) 2015 The WebRTC project authors. All Rights Reserved. | 2 * Copyright (c) 2015 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 460 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
471 } | 471 } |
472 } | 472 } |
473 | 473 |
474 // Populates an audioframe frame of AudioFrame type with random data. | 474 // Populates an audioframe frame of AudioFrame type with random data. |
475 void PopulateAudioFrame(AudioFrame* frame, | 475 void PopulateAudioFrame(AudioFrame* frame, |
476 int16_t amplitude, | 476 int16_t amplitude, |
477 RandomGenerator* rand_gen) { | 477 RandomGenerator* rand_gen) { |
478 ASSERT_GT(amplitude, 0); | 478 ASSERT_GT(amplitude, 0); |
479 ASSERT_LE(amplitude, 32767); | 479 ASSERT_LE(amplitude, 32767); |
480 for (int ch = 0; ch < frame->num_channels_; ch++) { | 480 for (int ch = 0; ch < frame->num_channels_; ch++) { |
481 for (int k = 0; k < static_cast<int>(frame->samples_per_channel_); k++) { | 481 for (size_t k = 0; k < frame->samples_per_channel_; k++) { |
482 // Store random 16 bit number between -(amplitude+1) and | 482 // Store random 16 bit number between -(amplitude+1) and |
483 // amplitude. | 483 // amplitude. |
484 frame->data_[k * ch] = | 484 frame->data_[k * ch] = |
485 rand_gen->RandInt(2 * amplitude + 1) - amplitude - 1; | 485 rand_gen->RandInt(2 * amplitude + 1) - amplitude - 1; |
486 } | 486 } |
487 } | 487 } |
488 } | 488 } |
489 | 489 |
490 AudioProcessingImplLockTest::AudioProcessingImplLockTest() | 490 AudioProcessingImplLockTest::AudioProcessingImplLockTest() |
491 : test_complete_(false, false), | 491 : test_complete_(false, false), |
(...skipping 632 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1124 DISABLED_AudioProcessingImplLockExtensive, | 1124 DISABLED_AudioProcessingImplLockExtensive, |
1125 AudioProcessingImplLockTest, | 1125 AudioProcessingImplLockTest, |
1126 ::testing::ValuesIn(TestConfig::GenerateExtensiveTestConfigs())); | 1126 ::testing::ValuesIn(TestConfig::GenerateExtensiveTestConfigs())); |
1127 | 1127 |
1128 INSTANTIATE_TEST_CASE_P( | 1128 INSTANTIATE_TEST_CASE_P( |
1129 AudioProcessingImplLockBrief, | 1129 AudioProcessingImplLockBrief, |
1130 AudioProcessingImplLockTest, | 1130 AudioProcessingImplLockTest, |
1131 ::testing::ValuesIn(TestConfig::GenerateBriefTestConfigs())); | 1131 ::testing::ValuesIn(TestConfig::GenerateBriefTestConfigs())); |
1132 | 1132 |
1133 } // namespace webrtc | 1133 } // namespace webrtc |
OLD | NEW |