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

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

Issue 2384693002: Test RTC_DCHECK_IS_ON instead of checking DCHECK_ALWAYS_ON everywhere (Closed)
Patch Set: !!! Created 4 years, 2 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 299 matching lines...) Expand 10 before | Expand all | Expand 10 after
310 EXPECT_GT(audio_frame.num_channels_, 0u); 310 EXPECT_GT(audio_frame.num_channels_, 0u);
311 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100), 311 EXPECT_EQ(static_cast<size_t>(kSampleRateHz / 100),
312 audio_frame.samples_per_channel_); 312 audio_frame.samples_per_channel_);
313 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_); 313 EXPECT_EQ(kSampleRateHz, audio_frame.sample_rate_hz_);
314 } 314 }
315 315
316 // The below test is temporarily disabled on Windows due to problems 316 // The below test is temporarily disabled on Windows due to problems
317 // with clang debug builds. 317 // with clang debug builds.
318 // TODO(tommi): Re-enable when we've figured out what the problem is. 318 // TODO(tommi): Re-enable when we've figured out what the problem is.
319 // http://crbug.com/615050 319 // http://crbug.com/615050
320 #if !defined(WEBRTC_WIN) && defined(__clang__) && !defined(NDEBUG) 320 #if !defined(WEBRTC_WIN) && defined(__clang__) && RTC_DCHECK_IS_ON && \
321 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) 321 GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID)
322 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { 322 TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) {
323 AudioFrame audio_frame; 323 AudioFrame audio_frame;
324 bool muted; 324 bool muted;
325 EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted), 325 EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted),
326 "dst_sample_rate_hz"); 326 "dst_sample_rate_hz");
327 } 327 }
328 #endif 328 #endif
329 #endif
330 329
331 // Checks that the transport callback is invoked once for each speech packet. 330 // Checks that the transport callback is invoked once for each speech packet.
332 // Also checks that the frame type is kAudioFrameSpeech. 331 // Also checks that the frame type is kAudioFrameSpeech.
333 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) { 332 TEST_F(AudioCodingModuleTestOldApi, TransportCallbackIsInvokedForEachPacket) {
334 const int k10MsBlocksPerPacket = 3; 333 const int k10MsBlocksPerPacket = 3;
335 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100; 334 codec_.pacsize = k10MsBlocksPerPacket * kSampleRateHz / 100;
336 RegisterCodec(); 335 RegisterCodec();
337 const int kLoops = 10; 336 const int kLoops = 10;
338 for (int i = 0; i < kLoops; ++i) { 337 for (int i = 0; i < kLoops; ++i) {
339 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls()); 338 EXPECT_EQ(i / k10MsBlocksPerPacket, packet_cb_.num_calls());
(...skipping 1465 matching lines...) Expand 10 before | Expand all | Expand 10 after
1805 Run(16000, 8000, 1000); 1804 Run(16000, 8000, 1000);
1806 } 1805 }
1807 1806
1808 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) { 1807 TEST_F(AcmSwitchingOutputFrequencyOldApi, Toggle8KhzTo16Khz) {
1809 Run(8000, 16000, 1000); 1808 Run(8000, 16000, 1000);
1810 } 1809 }
1811 1810
1812 #endif 1811 #endif
1813 1812
1814 } // namespace webrtc 1813 } // namespace webrtc
OLDNEW
« no previous file with comments | « webrtc/media/sctp/sctpdataengine.cc ('k') | webrtc/modules/audio_device/android/opensles_player.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698