diff --git a/api/array_view_unittest.cc b/api/array_view_unittest.cc index 8aa858805f..0357f68aa2 100644 --- a/api/array_view_unittest.cc +++ b/api/array_view_unittest.cc @@ -38,7 +38,7 @@ void CallFixed(ArrayView av) {} } // namespace -TEST(ArrayViewTest, TestConstructFromPtrAndArray) { +TEST(ArrayViewDeathTest, TestConstructFromPtrAndArray) { char arr[] = "Arrr!"; const char carr[] = "Carrr!"; EXPECT_EQ(6u, Call(arr)); @@ -409,7 +409,7 @@ TEST(FixArrayViewTest, TestSwapFixed) { // swap(x, w); // Compile error, because different sizes. } -TEST(ArrayViewTest, TestIndexing) { +TEST(ArrayViewDeathTest, TestIndexing) { char arr[] = "abcdefg"; ArrayView x(arr); const ArrayView y(arr); diff --git a/api/rtc_event_log_output_file_unittest.cc b/api/rtc_event_log_output_file_unittest.cc index 071909b2c5..4274215491 100644 --- a/api/rtc_event_log_output_file_unittest.cc +++ b/api/rtc_event_log_output_file_unittest.cc @@ -141,14 +141,16 @@ TEST_F(RtcEventLogOutputFileTest, AllowReasonableFileSizeLimits) { } #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(RtcEventLogOutputFileTest, WritingToInactiveFileForbidden) { +class RtcEventLogOutputFileDeathTest : public RtcEventLogOutputFileTest {}; + +TEST_F(RtcEventLogOutputFileDeathTest, WritingToInactiveFileForbidden) { RtcEventLogOutputFile output_file(output_file_name_, 2); ASSERT_FALSE(output_file.Write("abc")); ASSERT_FALSE(output_file.IsActive()); EXPECT_DEATH(output_file.Write("abc"), ""); } -TEST_F(RtcEventLogOutputFileTest, DisallowUnreasonableFileSizeLimits) { +TEST_F(RtcEventLogOutputFileDeathTest, DisallowUnreasonableFileSizeLimits) { // Keeping in a temporary unique_ptr to make it clearer that the death is // triggered by construction, not destruction. std::unique_ptr output_file; diff --git a/api/units/data_rate_unittest.cc b/api/units/data_rate_unittest.cc index 4a6dd21af3..f77b3702d4 100644 --- a/api/units/data_rate_unittest.cc +++ b/api/units/data_rate_unittest.cc @@ -175,7 +175,7 @@ TEST(UnitConversionTest, DataRateAndDataSizeAndFrequency) { EXPECT_EQ((rate_b / freq_a).bytes(), kBitsPerSecond / kHertz / 8); } -TEST(UnitConversionTest, DivisionFailsOnLargeSize) { +TEST(UnitConversionDeathTest, DivisionFailsOnLargeSize) { // Note that the failure is expected since the current implementation is // implementated in a way that does not support division of large sizes. If // the implementation is changed, this test can safely be removed. diff --git a/audio/utility/audio_frame_operations_unittest.cc b/audio/utility/audio_frame_operations_unittest.cc index 1d38875add..1a2c16e45f 100644 --- a/audio/utility/audio_frame_operations_unittest.cc +++ b/audio/utility/audio_frame_operations_unittest.cc @@ -27,6 +27,8 @@ class AudioFrameOperationsTest : public ::testing::Test { AudioFrame frame_; }; +class AudioFrameOperationsDeathTest : public AudioFrameOperationsTest {}; + void SetFrameData(int16_t ch1, int16_t ch2, int16_t ch3, @@ -105,7 +107,7 @@ void VerifyFrameDataBounds(const AudioFrame& frame, } #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(AudioFrameOperationsTest, MonoToStereoFailsWithBadParameters) { +TEST_F(AudioFrameOperationsDeathTest, MonoToStereoFailsWithBadParameters) { EXPECT_DEATH(AudioFrameOperations::UpmixChannels(2, &frame_), ""); frame_.samples_per_channel_ = AudioFrame::kMaxDataSizeSamples; frame_.num_channels_ = 1; @@ -136,7 +138,7 @@ TEST_F(AudioFrameOperationsTest, MonoToStereoMuted) { } #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(AudioFrameOperationsTest, StereoToMonoFailsWithBadParameters) { +TEST_F(AudioFrameOperationsDeathTest, StereoToMonoFailsWithBadParameters) { frame_.num_channels_ = 1; EXPECT_DEATH(AudioFrameOperations::DownmixChannels(1, &frame_), ""); } diff --git a/call/rtcp_demuxer_unittest.cc b/call/rtcp_demuxer_unittest.cc index 5b27c7a998..f3949ca78b 100644 --- a/call/rtcp_demuxer_unittest.cc +++ b/call/rtcp_demuxer_unittest.cc @@ -81,6 +81,8 @@ class RtcpDemuxerTest : public ::testing::Test { std::set broadcast_sinks_to_tear_down_; }; +class RtcpDemuxerDeathTest : public RtcpDemuxerTest {}; + // Produces a packet buffer representing an RTCP packet with a given SSRC, // as it would look when sent over the wire. // |distinguishing_string| allows different RTCP packets with the same SSRC @@ -419,7 +421,7 @@ TEST_F(RtcpDemuxerTest, FirstResolutionOfRsidNotForgotten) { #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(RtcpDemuxerTest, RepeatedSsrcToSinkAssociationsDisallowed) { +TEST_F(RtcpDemuxerDeathTest, RepeatedSsrcToSinkAssociationsDisallowed) { MockRtcpPacketSink sink; constexpr uint32_t ssrc = 101; @@ -427,7 +429,7 @@ TEST_F(RtcpDemuxerTest, RepeatedSsrcToSinkAssociationsDisallowed) { EXPECT_DEATH(AddSsrcSink(ssrc, &sink), ""); } -TEST_F(RtcpDemuxerTest, RepeatedRsidToSinkAssociationsDisallowed) { +TEST_F(RtcpDemuxerDeathTest, RepeatedRsidToSinkAssociationsDisallowed) { MockRtcpPacketSink sink; const std::string rsid = "z"; @@ -435,14 +437,14 @@ TEST_F(RtcpDemuxerTest, RepeatedRsidToSinkAssociationsDisallowed) { EXPECT_DEATH(AddRsidSink(rsid, &sink), ""); } -TEST_F(RtcpDemuxerTest, RepeatedBroadcastSinkRegistrationDisallowed) { +TEST_F(RtcpDemuxerDeathTest, RepeatedBroadcastSinkRegistrationDisallowed) { MockRtcpPacketSink sink; AddBroadcastSink(&sink); EXPECT_DEATH(AddBroadcastSink(&sink), ""); } -TEST_F(RtcpDemuxerTest, SsrcSinkCannotAlsoBeRegisteredAsBroadcast) { +TEST_F(RtcpDemuxerDeathTest, SsrcSinkCannotAlsoBeRegisteredAsBroadcast) { MockRtcpPacketSink sink; constexpr uint32_t ssrc = 101; @@ -450,7 +452,7 @@ TEST_F(RtcpDemuxerTest, SsrcSinkCannotAlsoBeRegisteredAsBroadcast) { EXPECT_DEATH(AddBroadcastSink(&sink), ""); } -TEST_F(RtcpDemuxerTest, RsidSinkCannotAlsoBeRegisteredAsBroadcast) { +TEST_F(RtcpDemuxerDeathTest, RsidSinkCannotAlsoBeRegisteredAsBroadcast) { MockRtcpPacketSink sink; const std::string rsid = "z"; @@ -458,7 +460,7 @@ TEST_F(RtcpDemuxerTest, RsidSinkCannotAlsoBeRegisteredAsBroadcast) { EXPECT_DEATH(AddBroadcastSink(&sink), ""); } -TEST_F(RtcpDemuxerTest, BroadcastSinkCannotAlsoBeRegisteredAsSsrcSink) { +TEST_F(RtcpDemuxerDeathTest, BroadcastSinkCannotAlsoBeRegisteredAsSsrcSink) { MockRtcpPacketSink sink; AddBroadcastSink(&sink); @@ -466,7 +468,7 @@ TEST_F(RtcpDemuxerTest, BroadcastSinkCannotAlsoBeRegisteredAsSsrcSink) { EXPECT_DEATH(AddSsrcSink(ssrc, &sink), ""); } -TEST_F(RtcpDemuxerTest, BroadcastSinkCannotAlsoBeRegisteredAsRsidSink) { +TEST_F(RtcpDemuxerDeathTest, BroadcastSinkCannotAlsoBeRegisteredAsRsidSink) { MockRtcpPacketSink sink; AddBroadcastSink(&sink); @@ -474,27 +476,27 @@ TEST_F(RtcpDemuxerTest, BroadcastSinkCannotAlsoBeRegisteredAsRsidSink) { EXPECT_DEATH(AddRsidSink(rsid, &sink), ""); } -TEST_F(RtcpDemuxerTest, MayNotCallRemoveSinkOnNeverAddedSink) { +TEST_F(RtcpDemuxerDeathTest, MayNotCallRemoveSinkOnNeverAddedSink) { MockRtcpPacketSink sink; EXPECT_DEATH(RemoveSink(&sink), ""); } -TEST_F(RtcpDemuxerTest, MayNotCallRemoveBroadcastSinkOnNeverAddedSink) { +TEST_F(RtcpDemuxerDeathTest, MayNotCallRemoveBroadcastSinkOnNeverAddedSink) { MockRtcpPacketSink sink; EXPECT_DEATH(RemoveBroadcastSink(&sink), ""); } -TEST_F(RtcpDemuxerTest, RsidMustBeNonEmpty) { +TEST_F(RtcpDemuxerDeathTest, RsidMustBeNonEmpty) { MockRtcpPacketSink sink; EXPECT_DEATH(AddRsidSink("", &sink), ""); } -TEST_F(RtcpDemuxerTest, RsidMustBeAlphaNumeric) { +TEST_F(RtcpDemuxerDeathTest, RsidMustBeAlphaNumeric) { MockRtcpPacketSink sink; EXPECT_DEATH(AddRsidSink("a_3", &sink), ""); } -TEST_F(RtcpDemuxerTest, RsidMustNotExceedMaximumLength) { +TEST_F(RtcpDemuxerDeathTest, RsidMustNotExceedMaximumLength) { MockRtcpPacketSink sink; std::string rsid(BaseRtpStringExtension::kMaxValueSizeBytes + 1, 'a'); EXPECT_DEATH(AddRsidSink(rsid, &sink), ""); diff --git a/call/rtp_demuxer_unittest.cc b/call/rtp_demuxer_unittest.cc index 7177c0efd4..59baafe9ff 100644 --- a/call/rtp_demuxer_unittest.cc +++ b/call/rtp_demuxer_unittest.cc @@ -218,6 +218,8 @@ class RtpDemuxerTest : public ::testing::Test { uint16_t next_sequence_number_ = 1; }; +class RtpDemuxerDeathTest : public RtpDemuxerTest {}; + MATCHER_P(SamePacketAs, other, "") { return arg.Ssrc() == other.Ssrc() && arg.SequenceNumber() == other.SequenceNumber(); @@ -1486,41 +1488,42 @@ TEST_F(RtpDemuxerTest, MaliciousPeerCannotCauseMemoryOveruse) { #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(RtpDemuxerTest, CriteriaMustBeNonEmpty) { +TEST_F(RtpDemuxerDeathTest, CriteriaMustBeNonEmpty) { MockRtpPacketSink sink; RtpDemuxerCriteria criteria; EXPECT_DEATH(AddSink(criteria, &sink), ""); } -TEST_F(RtpDemuxerTest, RsidMustBeAlphaNumeric) { +TEST_F(RtpDemuxerDeathTest, RsidMustBeAlphaNumeric) { MockRtpPacketSink sink; EXPECT_DEATH(AddSinkOnlyRsid("a_3", &sink), ""); } -TEST_F(RtpDemuxerTest, MidMustBeToken) { +TEST_F(RtpDemuxerDeathTest, MidMustBeToken) { MockRtpPacketSink sink; EXPECT_DEATH(AddSinkOnlyMid("a(3)", &sink), ""); } -TEST_F(RtpDemuxerTest, RsidMustNotExceedMaximumLength) { +TEST_F(RtpDemuxerDeathTest, RsidMustNotExceedMaximumLength) { MockRtpPacketSink sink; std::string rsid(BaseRtpStringExtension::kMaxValueSizeBytes + 1, 'a'); EXPECT_DEATH(AddSinkOnlyRsid(rsid, &sink), ""); } -TEST_F(RtpDemuxerTest, MidMustNotExceedMaximumLength) { +TEST_F(RtpDemuxerDeathTest, MidMustNotExceedMaximumLength) { MockRtpPacketSink sink; std::string mid(BaseRtpStringExtension::kMaxValueSizeBytes + 1, 'a'); EXPECT_DEATH(AddSinkOnlyMid(mid, &sink), ""); } -TEST_F(RtpDemuxerTest, DoubleRegisterationOfSsrcBindingObserverDisallowed) { +TEST_F(RtpDemuxerDeathTest, + DoubleRegisterationOfSsrcBindingObserverDisallowed) { MockSsrcBindingObserver observer; RegisterSsrcBindingObserver(&observer); EXPECT_DEATH(RegisterSsrcBindingObserver(&observer), ""); } -TEST_F(RtpDemuxerTest, +TEST_F(RtpDemuxerDeathTest, DregisterationOfNeverRegisteredSsrcBindingObserverDisallowed) { MockSsrcBindingObserver observer; EXPECT_DEATH(DeregisterSsrcBindingObserver(&observer), ""); diff --git a/common_audio/channel_buffer_unittest.cc b/common_audio/channel_buffer_unittest.cc index 8ec42346d1..a8b64891d6 100644 --- a/common_audio/channel_buffer_unittest.cc +++ b/common_audio/channel_buffer_unittest.cc @@ -53,12 +53,12 @@ TEST(IFChannelBufferTest, SettingNumChannelsOfOneChannelBufferSetsTheOther) { } #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST(ChannelBufferTest, SetNumChannelsDeathTest) { +TEST(ChannelBufferDeathTest, SetNumChannelsDeathTest) { ChannelBuffer chb(kNumFrames, kMono); RTC_EXPECT_DEATH(chb.set_num_channels(kStereo), "num_channels"); } -TEST(IFChannelBufferTest, SetNumChannelsDeathTest) { +TEST(IFChannelBufferDeathTest, SetNumChannelsDeathTest) { IFChannelBuffer ifchb(kNumFrames, kMono); RTC_EXPECT_DEATH(ifchb.ibuf()->set_num_channels(kStereo), "num_channels"); } diff --git a/common_audio/resampler/push_resampler_unittest.cc b/common_audio/resampler/push_resampler_unittest.cc index 61b9725b3a..4724833fbb 100644 --- a/common_audio/resampler/push_resampler_unittest.cc +++ b/common_audio/resampler/push_resampler_unittest.cc @@ -31,19 +31,19 @@ TEST(PushResamplerTest, VerifiesInputParameters) { } #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST(PushResamplerTest, VerifiesBadInputParameters1) { +TEST(PushResamplerDeathTest, VerifiesBadInputParameters1) { PushResampler resampler; RTC_EXPECT_DEATH(resampler.InitializeIfNeeded(-1, 16000, 1), "src_sample_rate_hz"); } -TEST(PushResamplerTest, VerifiesBadInputParameters2) { +TEST(PushResamplerDeathTest, VerifiesBadInputParameters2) { PushResampler resampler; RTC_EXPECT_DEATH(resampler.InitializeIfNeeded(16000, -1, 1), "dst_sample_rate_hz"); } -TEST(PushResamplerTest, VerifiesBadInputParameters3) { +TEST(PushResamplerDeathTest, VerifiesBadInputParameters3) { PushResampler resampler; RTC_EXPECT_DEATH(resampler.InitializeIfNeeded(16000, 16000, 0), "num_channels"); diff --git a/modules/audio_coding/acm2/audio_coding_module_unittest.cc b/modules/audio_coding/acm2/audio_coding_module_unittest.cc index 6c9b242e00..b53d456ff7 100644 --- a/modules/audio_coding/acm2/audio_coding_module_unittest.cc +++ b/modules/audio_coding/acm2/audio_coding_module_unittest.cc @@ -252,6 +252,9 @@ class AudioCodingModuleTestOldApi : public ::testing::Test { Clock* clock_; }; +class AudioCodingModuleTestOldApiDeathTest + : public AudioCodingModuleTestOldApi {}; + TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) { AudioFrame audio_frame; const int kSampleRateHz = 32000; @@ -271,7 +274,7 @@ TEST_F(AudioCodingModuleTestOldApi, VerifyOutputFrame) { // http://crbug.com/615050 #if !defined(WEBRTC_WIN) && defined(__clang__) && RTC_DCHECK_IS_ON && \ GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST_F(AudioCodingModuleTestOldApi, FailOnZeroDesiredFrequency) { +TEST_F(AudioCodingModuleTestOldApiDeathTest, FailOnZeroDesiredFrequency) { AudioFrame audio_frame; bool muted; RTC_EXPECT_DEATH(acm_->PlayoutData10Ms(0, &audio_frame, &muted), diff --git a/modules/audio_coding/audio_network_adaptor/util/threshold_curve_unittest.cc b/modules/audio_coding/audio_network_adaptor/util/threshold_curve_unittest.cc index 9984049d50..dc3aec0b18 100644 --- a/modules/audio_coding/audio_network_adaptor/util/threshold_curve_unittest.cc +++ b/modules/audio_coding/audio_network_adaptor/util/threshold_curve_unittest.cc @@ -621,7 +621,7 @@ TEST(ThresholdCurveTest, NearlyIdenticalCurvesSecondContinuesOnOtherRightSide) { // The higher-left point must be given as the first point, and the lower-right // point must be given as the second. // This necessarily produces a non-positive slope. -TEST(ThresholdCurveTest, WrongOrderPoints) { +TEST(ThresholdCurveDeathTest, WrongOrderPoints) { std::unique_ptr curve; constexpr ThresholdCurve::Point left{5, 10}; constexpr ThresholdCurve::Point right{10, 5}; diff --git a/modules/audio_coding/codecs/cng/cng_unittest.cc b/modules/audio_coding/codecs/cng/cng_unittest.cc index 80349e2504..0e6ab79394 100644 --- a/modules/audio_coding/codecs/cng/cng_unittest.cc +++ b/modules/audio_coding/codecs/cng/cng_unittest.cc @@ -40,6 +40,8 @@ class CngTest : public ::testing::Test { int16_t speech_data_[640]; // Max size of CNG internal buffers. }; +class CngDeathTest : public CngTest {}; + void CngTest::SetUp() { FILE* input_file; const std::string file_name = @@ -69,7 +71,7 @@ void CngTest::TestCngEncode(int sample_rate_hz, int quality) { #if GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) // Create CNG encoder, init with faulty values, free CNG encoder. -TEST_F(CngTest, CngInitFail) { +TEST_F(CngDeathTest, CngInitFail) { // Call with too few parameters. EXPECT_DEATH( { @@ -86,7 +88,7 @@ TEST_F(CngTest, CngInitFail) { } // Encode Cng with too long input vector. -TEST_F(CngTest, CngEncodeTooLong) { +TEST_F(CngDeathTest, CngEncodeTooLong) { rtc::Buffer sid_data; // Create encoder. diff --git a/modules/audio_processing/aec3/aec3_fft_unittest.cc b/modules/audio_processing/aec3/aec3_fft_unittest.cc index 82d6e766cc..e60ef5b713 100644 --- a/modules/audio_processing/aec3/aec3_fft_unittest.cc +++ b/modules/audio_processing/aec3/aec3_fft_unittest.cc @@ -20,28 +20,28 @@ namespace webrtc { #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) // Verifies that the check for non-null input in Fft works. -TEST(Aec3Fft, NullFftInput) { +TEST(Aec3FftDeathTest, NullFftInput) { Aec3Fft fft; FftData X; EXPECT_DEATH(fft.Fft(nullptr, &X), ""); } // Verifies that the check for non-null input in Fft works. -TEST(Aec3Fft, NullFftOutput) { +TEST(Aec3FftDeathTest, NullFftOutput) { Aec3Fft fft; std::array x; EXPECT_DEATH(fft.Fft(&x, nullptr), ""); } // Verifies that the check for non-null output in Ifft works. -TEST(Aec3Fft, NullIfftOutput) { +TEST(Aec3FftDeathTest, NullIfftOutput) { Aec3Fft fft; FftData X; EXPECT_DEATH(fft.Ifft(X, nullptr), ""); } // Verifies that the check for non-null output in ZeroPaddedFft works. -TEST(Aec3Fft, NullZeroPaddedFftOutput) { +TEST(Aec3FftDeathTest, NullZeroPaddedFftOutput) { Aec3Fft fft; std::array x; EXPECT_DEATH(fft.ZeroPaddedFft(x, Aec3Fft::Window::kRectangular, nullptr), @@ -49,7 +49,7 @@ TEST(Aec3Fft, NullZeroPaddedFftOutput) { } // Verifies that the check for input length in ZeroPaddedFft works. -TEST(Aec3Fft, ZeroPaddedFftWrongInputLength) { +TEST(Aec3FftDeathTest, ZeroPaddedFftWrongInputLength) { Aec3Fft fft; FftData X; std::array x; @@ -57,7 +57,7 @@ TEST(Aec3Fft, ZeroPaddedFftWrongInputLength) { } // Verifies that the check for non-null output in PaddedFft works. -TEST(Aec3Fft, NullPaddedFftOutput) { +TEST(Aec3FftDeathTest, NullPaddedFftOutput) { Aec3Fft fft; std::array x; std::array x_old; @@ -65,7 +65,7 @@ TEST(Aec3Fft, NullPaddedFftOutput) { } // Verifies that the check for input length in PaddedFft works. -TEST(Aec3Fft, PaddedFftWrongInputLength) { +TEST(Aec3FftDeathTest, PaddedFftWrongInputLength) { Aec3Fft fft; FftData X; std::array x; @@ -74,7 +74,7 @@ TEST(Aec3Fft, PaddedFftWrongInputLength) { } // Verifies that the check for length in the old value in PaddedFft works. -TEST(Aec3Fft, PaddedFftWrongOldValuesLength) { +TEST(Aec3FftDeathTest, PaddedFftWrongOldValuesLength) { Aec3Fft fft; FftData X; std::array x; diff --git a/modules/audio_processing/aec3/block_framer_unittest.cc b/modules/audio_processing/aec3/block_framer_unittest.cc index e9a16d06d5..d67967bc02 100644 --- a/modules/audio_processing/aec3/block_framer_unittest.cc +++ b/modules/audio_processing/aec3/block_framer_unittest.cc @@ -214,7 +214,8 @@ std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) { } // namespace #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST(BlockFramer, WrongNumberOfBandsInBlockForInsertBlockAndExtractSubFrame) { +TEST(BlockFramerDeathTest, + WrongNumberOfBandsInBlockForInsertBlockAndExtractSubFrame) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -227,7 +228,7 @@ TEST(BlockFramer, WrongNumberOfBandsInBlockForInsertBlockAndExtractSubFrame) { } } -TEST(BlockFramer, +TEST(BlockFramerDeathTest, WrongNumberOfChannelsInBlockForInsertBlockAndExtractSubFrame) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { @@ -241,7 +242,7 @@ TEST(BlockFramer, } } -TEST(BlockFramer, +TEST(BlockFramerDeathTest, WrongNumberOfBandsInSubFrameForInsertBlockAndExtractSubFrame) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { @@ -255,7 +256,7 @@ TEST(BlockFramer, } } -TEST(BlockFramer, +TEST(BlockFramerDeathTest, WrongNumberOfChannelsInSubFrameForInsertBlockAndExtractSubFrame) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { @@ -269,7 +270,8 @@ TEST(BlockFramer, } } -TEST(BlockFramer, WrongNumberOfSamplesInBlockForInsertBlockAndExtractSubFrame) { +TEST(BlockFramerDeathTest, + WrongNumberOfSamplesInBlockForInsertBlockAndExtractSubFrame) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -282,7 +284,7 @@ TEST(BlockFramer, WrongNumberOfSamplesInBlockForInsertBlockAndExtractSubFrame) { } } -TEST(BlockFramer, +TEST(BlockFramerDeathTest, WrongNumberOfSamplesInSubFrameForInsertBlockAndExtractSubFrame) { const size_t correct_num_channels = 1; for (auto rate : {16000, 32000, 48000}) { @@ -295,7 +297,7 @@ TEST(BlockFramer, } } -TEST(BlockFramer, WrongNumberOfBandsInBlockForInsertBlock) { +TEST(BlockFramerDeathTest, WrongNumberOfBandsInBlockForInsertBlock) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -308,7 +310,7 @@ TEST(BlockFramer, WrongNumberOfBandsInBlockForInsertBlock) { } } -TEST(BlockFramer, WrongNumberOfChannelsInBlockForInsertBlock) { +TEST(BlockFramerDeathTest, WrongNumberOfChannelsInBlockForInsertBlock) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -321,7 +323,7 @@ TEST(BlockFramer, WrongNumberOfChannelsInBlockForInsertBlock) { } } -TEST(BlockFramer, WrongNumberOfSamplesInBlockForInsertBlock) { +TEST(BlockFramerDeathTest, WrongNumberOfSamplesInBlockForInsertBlock) { for (auto rate : {16000, 32000, 48000}) { for (auto correct_num_channels : {1, 2, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -333,7 +335,7 @@ TEST(BlockFramer, WrongNumberOfSamplesInBlockForInsertBlock) { } } -TEST(BlockFramer, WrongNumberOfPreceedingApiCallsForInsertBlock) { +TEST(BlockFramerDeathTest, WrongNumberOfPreceedingApiCallsForInsertBlock) { for (size_t num_channels : {1, 2, 8}) { for (auto rate : {16000, 32000, 48000}) { for (size_t num_calls = 0; num_calls < 4; ++num_calls) { @@ -351,17 +353,17 @@ TEST(BlockFramer, WrongNumberOfPreceedingApiCallsForInsertBlock) { } // Verifies that the verification for 0 number of channels works. -TEST(BlockFramer, ZeroNumberOfChannelsParameter) { +TEST(BlockFramerDeathTest, ZeroNumberOfChannelsParameter) { EXPECT_DEATH(BlockFramer(16000, 0), ""); } // Verifies that the verification for 0 number of bands works. -TEST(BlockFramer, ZeroNumberOfBandsParameter) { +TEST(BlockFramerDeathTest, ZeroNumberOfBandsParameter) { EXPECT_DEATH(BlockFramer(0, 1), ""); } // Verifies that the verification for null sub_frame pointer works. -TEST(BlockFramer, NullSubFrameParameter) { +TEST(BlockFramerDeathTest, NullSubFrameParameter) { EXPECT_DEATH(BlockFramer(1, 1).InsertBlockAndExtractSubFrame( std::vector>>( 1, std::vector>( diff --git a/modules/audio_processing/aec3/frame_blocker_unittest.cc b/modules/audio_processing/aec3/frame_blocker_unittest.cc index e907608d95..216f515037 100644 --- a/modules/audio_processing/aec3/frame_blocker_unittest.cc +++ b/modules/audio_processing/aec3/frame_blocker_unittest.cc @@ -287,7 +287,8 @@ std::string ProduceDebugText(int sample_rate_hz, size_t num_channels) { } // namespace #if RTC_DCHECK_IS_ON && GTEST_HAS_DEATH_TEST && !defined(WEBRTC_ANDROID) -TEST(FrameBlocker, WrongNumberOfBandsInBlockForInsertSubFrameAndExtractBlock) { +TEST(FrameBlockerDeathTest, + WrongNumberOfBandsInBlockForInsertSubFrameAndExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -300,7 +301,7 @@ TEST(FrameBlocker, WrongNumberOfBandsInBlockForInsertSubFrameAndExtractBlock) { } } -TEST(FrameBlocker, +TEST(FrameBlockerDeathTest, WrongNumberOfChannelsInBlockForInsertSubFrameAndExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { @@ -314,7 +315,7 @@ TEST(FrameBlocker, } } -TEST(FrameBlocker, +TEST(FrameBlockerDeathTest, WrongNumberOfBandsInSubFrameForInsertSubFrameAndExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { @@ -328,7 +329,7 @@ TEST(FrameBlocker, } } -TEST(FrameBlocker, +TEST(FrameBlockerDeathTest, WrongNumberOfChannelsInSubFrameForInsertSubFrameAndExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { @@ -342,7 +343,7 @@ TEST(FrameBlocker, } } -TEST(FrameBlocker, +TEST(FrameBlockerDeathTest, WrongNumberOfSamplesInBlockForInsertSubFrameAndExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { @@ -356,7 +357,7 @@ TEST(FrameBlocker, } } -TEST(FrameBlocker, +TEST(FrameBlockerDeathTest, WrongNumberOfSamplesInSubFrameForInsertSubFrameAndExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { @@ -370,7 +371,7 @@ TEST(FrameBlocker, } } -TEST(FrameBlocker, WrongNumberOfBandsInBlockForExtractBlock) { +TEST(FrameBlockerDeathTest, WrongNumberOfBandsInBlockForExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -383,7 +384,7 @@ TEST(FrameBlocker, WrongNumberOfBandsInBlockForExtractBlock) { } } -TEST(FrameBlocker, WrongNumberOfChannelsInBlockForExtractBlock) { +TEST(FrameBlockerDeathTest, WrongNumberOfChannelsInBlockForExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -396,7 +397,7 @@ TEST(FrameBlocker, WrongNumberOfChannelsInBlockForExtractBlock) { } } -TEST(FrameBlocker, WrongNumberOfSamplesInBlockForExtractBlock) { +TEST(FrameBlockerDeathTest, WrongNumberOfSamplesInBlockForExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t correct_num_channels : {1, 2, 4, 8}) { SCOPED_TRACE(ProduceDebugText(rate, correct_num_channels)); @@ -408,7 +409,7 @@ TEST(FrameBlocker, WrongNumberOfSamplesInBlockForExtractBlock) { } } -TEST(FrameBlocker, WrongNumberOfPreceedingApiCallsForExtractBlock) { +TEST(FrameBlockerDeathTest, WrongNumberOfPreceedingApiCallsForExtractBlock) { for (auto rate : {16000, 32000, 48000}) { for (size_t num_channels : {1, 2, 4, 8}) { for (size_t num_calls = 0; num_calls < 4; ++num_calls) { @@ -426,17 +427,17 @@ TEST(FrameBlocker, WrongNumberOfPreceedingApiCallsForExtractBlock) { } // Verifies that the verification for 0 number of channels works. -TEST(FrameBlocker, ZeroNumberOfChannelsParameter) { +TEST(FrameBlockerDeathTest, ZeroNumberOfChannelsParameter) { EXPECT_DEATH(FrameBlocker(16000, 0), ""); } // Verifies that the verification for 0 number of bands works. -TEST(FrameBlocker, ZeroNumberOfBandsParameter) { +TEST(FrameBlockerDeathTest, ZeroNumberOfBandsParameter) { EXPECT_DEATH(FrameBlocker(0, 1), ""); } // Verifiers that the verification for null sub_frame pointer works. -TEST(FrameBlocker, NullBlockParameter) { +TEST(FrameBlockerDeathTest, NullBlockParameter) { std::vector>> sub_frame( 1, std::vector>( 1, std::vector(kSubFrameLength, 0.f)));