Enable -Winconsistent-missing-override flag.
The problem with gmock is worked around by commenting out any other override declarations in classes using gmock. NOPRESUBMIT=True BUG=webrtc:3970 Review-Url: https://codereview.webrtc.org/1921653002 Cr-Commit-Position: refs/heads/master@{#12563}
This commit is contained in:
@ -47,7 +47,7 @@ class AcmSendTestOldApi : public AudioPacketizationCallback,
|
||||
// Returns the next encoded packet. Returns NULL if the test duration was
|
||||
// exceeded. Ownership of the packet is handed over to the caller.
|
||||
// Inherited from PacketSource.
|
||||
Packet* NextPacket();
|
||||
Packet* NextPacket() override;
|
||||
|
||||
// Inherited from AudioPacketizationCallback.
|
||||
int32_t SendData(FrameType frame_type,
|
||||
|
||||
@ -608,7 +608,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
||||
|
||||
~AcmIsacMtTestOldApi() {}
|
||||
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
AudioCodingModuleTestOldApi::SetUp();
|
||||
RegisterCodec(); // Must be called before the threads start below.
|
||||
|
||||
@ -642,7 +642,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
||||
ASSERT_EQ(0, acm_->RegisterSendCodec(codec_));
|
||||
}
|
||||
|
||||
void InsertPacket() {
|
||||
void InsertPacket() override {
|
||||
int num_calls = packet_cb_.num_calls(); // Store locally for thread safety.
|
||||
if (num_calls > last_packet_number_) {
|
||||
// Get the new payload out from the callback handler.
|
||||
@ -661,7 +661,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
||||
&last_payload_vec_[0], last_payload_vec_.size(), rtp_header_));
|
||||
}
|
||||
|
||||
void InsertAudio() {
|
||||
void InsertAudio() override {
|
||||
// TODO(kwiberg): Use std::copy here. Might be complications because AFAICS
|
||||
// this call confuses the number of samples with the number of bytes, and
|
||||
// ends up copying only half of what it should.
|
||||
@ -677,7 +677,7 @@ class AcmIsacMtTestOldApi : public AudioCodingModuleMtTestOldApi {
|
||||
// This method is the same as AudioCodingModuleMtTestOldApi::TestDone(), but
|
||||
// here it is using the constants defined in this class (i.e., shorter test
|
||||
// run).
|
||||
virtual bool TestDone() {
|
||||
bool TestDone() override {
|
||||
if (packet_cb_.num_calls() > kNumPackets) {
|
||||
rtc::CritScope lock(&crit_sect_);
|
||||
if (pull_audio_count_ > kNumPullCalls) {
|
||||
@ -728,7 +728,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
||||
clock_ = fake_clock_.get();
|
||||
}
|
||||
|
||||
void SetUp() {
|
||||
void SetUp() override {
|
||||
AudioCodingModuleTestOldApi::SetUp();
|
||||
// Set up input audio source to read from specified file, loop after 5
|
||||
// seconds, and deliver blocks of 10 ms.
|
||||
@ -757,7 +757,7 @@ class AcmReRegisterIsacMtTestOldApi : public AudioCodingModuleTestOldApi {
|
||||
codec_registration_thread_.SetPriority(rtc::kRealtimePriority);
|
||||
}
|
||||
|
||||
void TearDown() {
|
||||
void TearDown() override {
|
||||
AudioCodingModuleTestOldApi::TearDown();
|
||||
receive_thread_.Stop();
|
||||
codec_registration_thread_.Stop();
|
||||
@ -1737,7 +1737,7 @@ class AcmSwitchingOutputFrequencyOldApi : public ::testing::Test,
|
||||
}
|
||||
|
||||
// Inherited from test::AudioSink.
|
||||
bool WriteArray(const int16_t* audio, size_t num_samples) {
|
||||
bool WriteArray(const int16_t* audio, size_t num_samples) override {
|
||||
// Skip checking the first output frame, since it has a number of zeros
|
||||
// due to how NetEq is initialized.
|
||||
if (first_output_) {
|
||||
|
||||
@ -25,10 +25,10 @@ class IsacSpeedTest : public AudioCodecSpeedTest {
|
||||
IsacSpeedTest();
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
virtual float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
||||
size_t max_bytes, size_t* encoded_bytes);
|
||||
virtual float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
||||
int16_t* out_data);
|
||||
float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
||||
size_t max_bytes, size_t* encoded_bytes) override;
|
||||
float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
||||
int16_t* out_data) override;
|
||||
ISACFIX_MainStruct *ISACFIX_main_inst_;
|
||||
};
|
||||
|
||||
|
||||
@ -22,7 +22,11 @@ namespace webrtc {
|
||||
|
||||
class MockAudioEncoder : public AudioEncoder {
|
||||
public:
|
||||
~MockAudioEncoder() override { Die(); }
|
||||
// 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() /* override */ { Die(); }
|
||||
MOCK_METHOD0(Die, void());
|
||||
MOCK_METHOD1(Mark, void(std::string desc));
|
||||
MOCK_CONST_METHOD0(SampleRateHz, int());
|
||||
|
||||
@ -23,10 +23,10 @@ class OpusSpeedTest : public AudioCodecSpeedTest {
|
||||
OpusSpeedTest();
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
virtual float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
||||
size_t max_bytes, size_t* encoded_bytes);
|
||||
virtual float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
||||
int16_t* out_data);
|
||||
float EncodeABlock(int16_t* in_data, uint8_t* bit_stream,
|
||||
size_t max_bytes, size_t* encoded_bytes) override;
|
||||
float DecodeABlock(const uint8_t* bit_stream, size_t encoded_bytes,
|
||||
int16_t* out_data) override;
|
||||
WebRtcOpusEncInst* opus_encoder_;
|
||||
WebRtcOpusDecInst* opus_decoder_;
|
||||
};
|
||||
|
||||
@ -783,11 +783,15 @@ TEST_F(NetEqImplTest, UnsupportedDecoder) {
|
||||
|
||||
class MockAudioDecoder : public AudioDecoder {
|
||||
public:
|
||||
void Reset() 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.
|
||||
void Reset() /* override */ {}
|
||||
MOCK_CONST_METHOD2(PacketDuration, int(const uint8_t*, size_t));
|
||||
MOCK_METHOD5(DecodeInternal, int(const uint8_t*, size_t, int, int16_t*,
|
||||
SpeechType*));
|
||||
size_t Channels() const override { return kChannels; }
|
||||
size_t Channels() const /* override */ { return kChannels; }
|
||||
} decoder_;
|
||||
|
||||
const uint8_t kFirstPayloadValue = 1;
|
||||
|
||||
@ -24,31 +24,36 @@ using ::testing::Return;
|
||||
|
||||
class MockAudioDecoder final : public AudioDecoder {
|
||||
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
|
||||
|
||||
explicit MockAudioDecoder(size_t num_channels)
|
||||
: num_channels_(num_channels), fec_enabled_(false) {
|
||||
}
|
||||
~MockAudioDecoder() override { Die(); }
|
||||
~MockAudioDecoder() /* override */ { Die(); }
|
||||
MOCK_METHOD0(Die, void());
|
||||
|
||||
MOCK_METHOD0(Reset, void());
|
||||
|
||||
int PacketDuration(const uint8_t* encoded,
|
||||
size_t encoded_len) const override {
|
||||
size_t encoded_len) const /* override */ {
|
||||
return kPacketDuration;
|
||||
}
|
||||
|
||||
int PacketDurationRedundant(const uint8_t* encoded,
|
||||
size_t encoded_len) const override {
|
||||
size_t encoded_len) const /* override */ {
|
||||
return kPacketDuration;
|
||||
}
|
||||
|
||||
bool PacketHasFec(const uint8_t* encoded, size_t encoded_len) const override {
|
||||
bool PacketHasFec(
|
||||
const uint8_t* encoded, size_t encoded_len) const /* override */ {
|
||||
return fec_enabled_;
|
||||
}
|
||||
|
||||
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; }
|
||||
|
||||
@ -60,7 +65,7 @@ class MockAudioDecoder final : public AudioDecoder {
|
||||
size_t encoded_len,
|
||||
int /*sample_rate_hz*/,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) override {
|
||||
SpeechType* speech_type) /* override */ {
|
||||
*speech_type = kSpeech;
|
||||
memset(decoded, 0, sizeof(int16_t) * kPacketDuration * Channels());
|
||||
return kPacketDuration * Channels();
|
||||
@ -70,7 +75,7 @@ class MockAudioDecoder final : public AudioDecoder {
|
||||
size_t encoded_len,
|
||||
int sample_rate_hz,
|
||||
int16_t* decoded,
|
||||
SpeechType* speech_type) override {
|
||||
SpeechType* speech_type) /* override */ {
|
||||
return DecodeInternal(encoded, encoded_len, sample_rate_hz, decoded,
|
||||
speech_type);
|
||||
}
|
||||
@ -294,7 +299,3 @@ TEST(NetEqNetworkStatsTest, NoiseExpansionTest) {
|
||||
|
||||
} // namespace test
|
||||
} // namespace webrtc
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@ -43,8 +43,8 @@ class NetEqIsacQualityTest : public NetEqQualityTest {
|
||||
NetEqIsacQualityTest();
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
||||
rtc::Buffer* payload, size_t max_bytes);
|
||||
int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
||||
rtc::Buffer* payload, size_t max_bytes) override;
|
||||
private:
|
||||
ISACFIX_MainStruct* isac_encoder_;
|
||||
int bit_rate_kbps_;
|
||||
|
||||
@ -103,8 +103,8 @@ class NetEqOpusQualityTest : public NetEqQualityTest {
|
||||
NetEqOpusQualityTest();
|
||||
void SetUp() override;
|
||||
void TearDown() override;
|
||||
virtual int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
||||
rtc::Buffer* payload, size_t max_bytes);
|
||||
int EncodeBlock(int16_t* in_data, size_t block_size_samples,
|
||||
rtc::Buffer* payload, size_t max_bytes) override;
|
||||
private:
|
||||
WebRtcOpusEncInst* opus_encoder_;
|
||||
OpusRepacketizer* repacketizer_;
|
||||
|
||||
Reference in New Issue
Block a user