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

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

Issue 2014973002: Reland of Adding a some checks and switching out a few assert for RTC_[D]CHECK. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Refine ifdefs to affect the win clang bot only Created 4 years, 6 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
« no previous file with comments | « webrtc/common_audio/resampler/push_resampler_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame, &muted)); 302 EXPECT_EQ(0, acm_->PlayoutData10Ms(kSampleRateHz, &audio_frame, &muted));
303 ASSERT_FALSE(muted); 303 ASSERT_FALSE(muted);
304 EXPECT_EQ(id_, audio_frame.id_); 304 EXPECT_EQ(id_, audio_frame.id_);
305 EXPECT_EQ(0u, audio_frame.timestamp_); 305 EXPECT_EQ(0u, audio_frame.timestamp_);
306 EXPECT_GT(audio_frame.num_channels_, 0u); 306 EXPECT_GT(audio_frame.num_channels_, 0u);
307 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100), 307 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100),
308 audio_frame.samples_per_channel_); 308 audio_frame.samples_per_channel_);
309 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_); 309 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_);
310 } 310 }
311 311
312 // The below test is temporarily disabled on Windows due to problems
313 // with clang debug builds.
314 // TODO(tommi): Re-enable when we've figured out what the problem is.
315 // http://crbug.com/615050
316 #if !defined(WEBRTC_WIN) && defined(__clang__) && !defined(NDEBUG)
312 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) 317 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
313 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { 318 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) {
314 AudioFrame audio_frame; 319 AudioFrame audio_frame;
315 bool muted; 320 bool muted;
316 EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted), 321 EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted),
317 "dst_sample_rate_hz"); 322 "dst_sample_rate_hz");
318 } 323 }
319 #endif 324 #endif
325 #endif
320 326
321 // 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.
322 // Also checks that the frame type is kAudioFrameSpeech. 328 // Also checks that the frame type is kAudioFrameSpeech.
323 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) { 329 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) {
324 const int k10MsBlocksPerPacket = 3; 330 const int k10MsBlocksPerPacket = 3;
325 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100; 331 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100;
326 RegisterCodec(); 332 RegisterCodec();
327 const int kLoops = 10; 333 const int kLoops = 10;
328 for (int i = 0; i < kLoops; ++i) { 334 for (int i = 0; i < kLoops; ++i) {
329 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls()); 335 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls());
(...skipping 1458 matching lines...) Expand 10 before | Expand all | Expand 10 after
1788 Run(16000, 8000, 1000); 1794 Run(16000, 8000, 1000);
1789 } 1795 }
1790 1796
1791 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1797 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1792 Run(8000, 16000, 1000); 1798 Run(8000, 16000, 1000);
1793 } 1799 }
1794 1800
1795 #endif 1801 #endif
1796 1802
1797 } // namespace webrtc 1803 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/common_audio/resampler/push_resampler_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698