render_buffer_unittest.cc (1584B)
1 /* 2 * Copyright (c) 2017 The WebRTC project authors. All Rights Reserved. 3 * 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 6 * tree. An additional intellectual property rights grant can be found 7 * in the file PATENTS. All contributing project authors may 8 * be found in the AUTHORS file in the root of the source tree. 9 */ 10 11 #include "modules/audio_processing/aec3/render_buffer.h" 12 13 #include "modules/audio_processing/aec3/block_buffer.h" 14 #include "modules/audio_processing/aec3/fft_buffer.h" 15 #include "modules/audio_processing/aec3/spectrum_buffer.h" 16 #include "rtc_base/checks.h" 17 #include "test/gtest.h" 18 19 namespace webrtc { 20 21 #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) 22 23 // Verifies the check for non-null fft buffer. 24 TEST(RenderBufferDeathTest, NullExternalFftBuffer) { 25 BlockBuffer block_buffer(10, 3, 1); 26 SpectrumBuffer spectrum_buffer(10, 1); 27 EXPECT_DEATH(RenderBuffer(&block_buffer, &spectrum_buffer, nullptr), ""); 28 } 29 30 // Verifies the check for non-null spectrum buffer. 31 TEST(RenderBufferDeathTest, NullExternalSpectrumBuffer) { 32 FftBuffer fft_buffer(10, 1); 33 BlockBuffer block_buffer(10, 3, 1); 34 EXPECT_DEATH(RenderBuffer(&block_buffer, nullptr, &fft_buffer), ""); 35 } 36 37 // Verifies the check for non-null block buffer. 38 TEST(RenderBufferDeathTest, NullExternalBlockBuffer) { 39 FftBuffer fft_buffer(10, 1); 40 SpectrumBuffer spectrum_buffer(10, 1); 41 EXPECT_DEATH(RenderBuffer(nullptr, &spectrum_buffer, &fft_buffer), ""); 42 } 43 44 #endif 45 46 } // namespace webrtc