Removed Die mock from MockAudioEncoder

MockAudioEncoder was calling a mocked Die function on itself in its
destructor. This outputs "Uninteresting mock function call" warning if
the Die call was not expected. This is true even if a NiceMock is used
to suppress the warnings.

The purpose of testing that the destructor is called might be to protect
against memory leaks when audio encoder ownership is transferred using a
raw pointer. However, this case is already covered by msan checks.

Bug: None
Change-Id: I0603c417b4b239027859228e05ebcf83ff5aaf18
Reviewed-on: https://webrtc-review.googlesource.com/56183
Reviewed-by: Karl Wiberg <kwiberg@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Commit-Queue: Sebastian Jansson <srte@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#22146}
This commit is contained in:
Sebastian Jansson
2018-02-21 18:23:43 +01:00
committed by Commit Bot
parent 5283022790
commit 5d436ac0bf
8 changed files with 1 additions and 12 deletions

View File

@ -137,7 +137,6 @@ TEST(RentACodecTest, ExternalEncoder) {
.WillOnce(Return(info));
EXPECT_CALL(marker, Mark("A"));
EXPECT_CALL(marker, Mark("B"));
EXPECT_CALL(*external_encoder, Die());
EXPECT_CALL(marker, Mark("C"));
}
@ -180,11 +179,9 @@ void TestCngAndRedResetSpeechEncoder(bool use_cng, bool use_red) {
{
::testing::InSequence s;
EXPECT_CALL(marker, Mark("disabled"));
EXPECT_CALL(*speech_encoder1, Die());
EXPECT_CALL(marker, Mark("enabled"));
if (use_cng || use_red)
EXPECT_CALL(*speech_encoder2, Reset());
EXPECT_CALL(*speech_encoder2, Die());
}
RentACodec::StackParameters param1, param2;