Fix override declarations and delete related TODOs

Bug: webrtc:10198, chromium:428099
Change-Id: Ic7b0dd3c58c3daa5ade4d2c503b77a51b29c716e
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/179380
Reviewed-by: Danil Chapovalov <danilchap@webrtc.org>
Reviewed-by: Ivo Creusen <ivoc@webrtc.org>
Commit-Queue: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#31739}
This commit is contained in:
Niels Möller 2020-07-15 17:28:39 +02:00 committed by Commit Bot
parent e43648a36e
commit e51d6ac5d2
3 changed files with 7 additions and 20 deletions

View file

@ -204,10 +204,6 @@ class MockVideoEncoder : public VideoEncoder {
(FecControllerOverride * fec_controller_override), (FecControllerOverride * fec_controller_override),
(override)); (override));
// TODO(nisse): Valid overrides commented out, because the gmock
// methods don't use any override declarations, and we want to avoid
// warnings from -Winconsistent-missing-override. See
// http://crbug.com/428099.
int32_t InitEncode(const VideoCodec* codecSettings, int32_t InitEncode(const VideoCodec* codecSettings,
const VideoEncoder::Settings& settings) override { const VideoEncoder::Settings& settings) override {
codec_ = *codecSettings; codec_ = *codecSettings;

View file

@ -42,10 +42,6 @@ using ::testing::SetArgPointee;
class MockAudioDecoder final : public AudioDecoder { class MockAudioDecoder final : public AudioDecoder {
public: public:
// TODO(nisse): Valid overrides commented out, because the gmock
// methods don't use any override declarations, and we want to avoid
// warnings from -Winconsistent-missing-override. See
// http://crbug.com/428099.
static const int kPacketDuration = 960; // 48 kHz * 20 ms static const int kPacketDuration = 960; // 48 kHz * 20 ms
MockAudioDecoder(int sample_rate_hz, size_t num_channels) MockAudioDecoder(int sample_rate_hz, size_t num_channels)
@ -83,7 +79,7 @@ class MockAudioDecoder final : public AudioDecoder {
}; };
std::vector<ParseResult> ParsePayload(rtc::Buffer&& payload, std::vector<ParseResult> ParsePayload(rtc::Buffer&& payload,
uint32_t timestamp) /* override */ { uint32_t timestamp) override {
std::vector<ParseResult> results; std::vector<ParseResult> results;
if (fec_enabled_) { if (fec_enabled_) {
std::unique_ptr<MockFrame> fec_frame(new MockFrame(num_channels_)); std::unique_ptr<MockFrame> fec_frame(new MockFrame(num_channels_));
@ -96,23 +92,22 @@ class MockAudioDecoder final : public AudioDecoder {
return results; return results;
} }
int PacketDuration(const uint8_t* encoded, size_t encoded_len) const int PacketDuration(const uint8_t* encoded,
/* override */ { size_t encoded_len) const override {
ADD_FAILURE() << "Since going through ParsePayload, PacketDuration should " ADD_FAILURE() << "Since going through ParsePayload, PacketDuration should "
"never get called."; "never get called.";
return kPacketDuration; return kPacketDuration;
} }
bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override {
/* override */ {
ADD_FAILURE() << "Since going through ParsePayload, PacketHasFec should " ADD_FAILURE() << "Since going through ParsePayload, PacketHasFec should "
"never get called."; "never get called.";
return fec_enabled_; return fec_enabled_;
} }
int SampleRateHz() const /* override */ { return sample_rate_hz_; } int SampleRateHz() const override { return sample_rate_hz_; }
size_t Channels() const /* override */ { return num_channels_; } size_t Channels() const override { return num_channels_; }
void set_fec_enabled(bool enable_fec) { fec_enabled_ = enable_fec; } void set_fec_enabled(bool enable_fec) { fec_enabled_ = enable_fec; }
@ -123,7 +118,7 @@ class MockAudioDecoder final : public AudioDecoder {
size_t encoded_len, size_t encoded_len,
int sample_rate_hz, int sample_rate_hz,
int16_t* decoded, int16_t* decoded,
SpeechType* speech_type) /* override */ { SpeechType* speech_type) override {
ADD_FAILURE() << "Since going through ParsePayload, DecodeInternal should " ADD_FAILURE() << "Since going through ParsePayload, DecodeInternal should "
"never get called."; "never get called.";
return -1; return -1;

View file

@ -21,10 +21,6 @@ namespace webrtc {
class MockAudioEncoder : public AudioEncoder { class MockAudioEncoder : public AudioEncoder {
public: public:
// TODO(nisse): Valid overrides commented out, because the gmock
// methods don't use any override declarations, and we want to avoid
// warnings from -Winconsistent-missing-override. See
// http://crbug.com/428099.
MockAudioEncoder(); MockAudioEncoder();
~MockAudioEncoder(); ~MockAudioEncoder();
MOCK_METHOD(int, SampleRateHz, (), (const, override)); MOCK_METHOD(int, SampleRateHz, (), (const, override));