diff --git a/.clang-tidy b/.clang-tidy index 981246fbb172..3e39eb682ee8 100644 --- a/.clang-tidy +++ b/.clang-tidy @@ -24,6 +24,7 @@ WarningsAsErrors: 'abseil-duration-*, modernize-make-unique, modernize-return-braced-init-list, modernize-use-equals-default, + modernize-use-override, modernize-use-using, performance-faster-string-find, performance-for-range-copy, diff --git a/include/envoy/stats/stats.h b/include/envoy/stats/stats.h index 21d19ffa21b4..f92715d9406b 100644 --- a/include/envoy/stats/stats.h +++ b/include/envoy/stats/stats.h @@ -22,7 +22,7 @@ struct Tag; */ class Metric : public RefcountInterface { public: - virtual ~Metric() = default; + ~Metric() override = default; /** * Returns the full name of the Metric. This is intended for most uses, such * as streaming out the name to a stats sink or admin request, or comparing diff --git a/source/common/access_log/access_log_manager_impl.h b/source/common/access_log/access_log_manager_impl.h index df09d2ad7863..4a8dedcdf367 100644 --- a/source/common/access_log/access_log_manager_impl.h +++ b/source/common/access_log/access_log_manager_impl.h @@ -64,7 +64,7 @@ class AccessLogFileImpl : public AccessLogFile { Thread::BasicLockable& lock, AccessLogFileStats& stats_, std::chrono::milliseconds flush_interval_msec, Thread::ThreadFactory& thread_factory); - ~AccessLogFileImpl(); + ~AccessLogFileImpl() override; // AccessLog::AccessLogFile void write(absl::string_view data) override; diff --git a/source/common/common/assert.cc b/source/common/common/assert.cc index cb01008c121e..ab4b1b8776a4 100644 --- a/source/common/common/assert.cc +++ b/source/common/common/assert.cc @@ -10,7 +10,7 @@ class ActionRegistrationImpl : public ActionRegistration { debug_assertion_failure_record_action_ = action; } - ~ActionRegistrationImpl() { + ~ActionRegistrationImpl() override { ASSERT(debug_assertion_failure_record_action_ != nullptr); debug_assertion_failure_record_action_ = nullptr; } diff --git a/source/common/config/grpc_mux_impl.h b/source/common/config/grpc_mux_impl.h index 1181ef0dfec5..33ef94150822 100644 --- a/source/common/config/grpc_mux_impl.h +++ b/source/common/config/grpc_mux_impl.h @@ -29,7 +29,7 @@ class GrpcMuxImpl : public GrpcMux, Event::Dispatcher& dispatcher, const Protobuf::MethodDescriptor& service_method, Runtime::RandomGenerator& random, Stats::Scope& scope, const RateLimitSettings& rate_limit_settings); - ~GrpcMuxImpl(); + ~GrpcMuxImpl() override; void start() override; GrpcMuxWatchPtr subscribe(const std::string& type_url, const std::set& resources, diff --git a/source/common/config/remote_data_fetcher.h b/source/common/config/remote_data_fetcher.h index 687dfe8a7ef9..6455e44abf1b 100644 --- a/source/common/config/remote_data_fetcher.h +++ b/source/common/config/remote_data_fetcher.h @@ -47,7 +47,7 @@ class RemoteDataFetcher : public Logger::Loggable, RemoteDataFetcher(Upstream::ClusterManager& cm, const ::envoy::api::v2::core::HttpUri& uri, const std::string& content_hash, RemoteDataFetcherCallback& callback); - virtual ~RemoteDataFetcher() override; + ~RemoteDataFetcher() override; // Http::AsyncClient::Callbacks void onSuccess(Http::MessagePtr&& response) override; diff --git a/source/common/event/dispatcher_impl.h b/source/common/event/dispatcher_impl.h index 3777762265b1..508e18e2a312 100644 --- a/source/common/event/dispatcher_impl.h +++ b/source/common/event/dispatcher_impl.h @@ -33,7 +33,7 @@ class DispatcherImpl : Logger::Loggable, DispatcherImpl(Api::Api& api, Event::TimeSystem& time_system); DispatcherImpl(Buffer::WatermarkFactoryPtr&& factory, Api::Api& api, Event::TimeSystem& time_system); - ~DispatcherImpl(); + ~DispatcherImpl() override; /** * @return event_base& the libevent base. diff --git a/source/common/filesystem/posix/directory_iterator_impl.h b/source/common/filesystem/posix/directory_iterator_impl.h index 513b5f98406d..889ffef1b5ac 100644 --- a/source/common/filesystem/posix/directory_iterator_impl.h +++ b/source/common/filesystem/posix/directory_iterator_impl.h @@ -15,7 +15,7 @@ class DirectoryIteratorImpl : public DirectoryIterator { DirectoryIteratorImpl() : directory_path_(""), dir_(nullptr), os_sys_calls_(Api::OsSysCallsSingleton::get()) {} - ~DirectoryIteratorImpl(); + ~DirectoryIteratorImpl() override; DirectoryIteratorImpl& operator++() override; diff --git a/source/common/grpc/google_async_client_impl.h b/source/common/grpc/google_async_client_impl.h index b14456235b21..f2e9eb651b7e 100644 --- a/source/common/grpc/google_async_client_impl.h +++ b/source/common/grpc/google_async_client_impl.h @@ -66,7 +66,7 @@ class GoogleAsyncClientThreadLocal : public ThreadLocal::ThreadLocalObject, Logger::Loggable { public: GoogleAsyncClientThreadLocal(Api::Api& api); - ~GoogleAsyncClientThreadLocal(); + ~GoogleAsyncClientThreadLocal() override; grpc::CompletionQueue& completionQueue() { return cq_; } @@ -199,7 +199,7 @@ class GoogleAsyncStreamImpl : public RawAsyncStream, GoogleAsyncStreamImpl(GoogleAsyncClientImpl& parent, absl::string_view service_full_name, absl::string_view method_name, RawAsyncStreamCallbacks& callbacks, const absl::optional& timeout); - ~GoogleAsyncStreamImpl(); + ~GoogleAsyncStreamImpl() override; virtual void initialize(bool buffer_body_for_retry); diff --git a/source/common/http/codec_client.h b/source/common/http/codec_client.h index 4bf2487da76c..cc27050e8fbe 100644 --- a/source/common/http/codec_client.h +++ b/source/common/http/codec_client.h @@ -53,7 +53,7 @@ class CodecClient : Logger::Loggable, */ enum class Type { HTTP1, HTTP2 }; - ~CodecClient(); + ~CodecClient() override; /** * Add a connection callback to the underlying network connection. diff --git a/source/common/http/http1/codec_impl.h b/source/common/http/http1/codec_impl.h index a9bf7111b73b..a15bdbe913ff 100644 --- a/source/common/http/http1/codec_impl.h +++ b/source/common/http/http1/codec_impl.h @@ -300,7 +300,7 @@ class ServerConnectionImpl : public ServerConnection, public ConnectionImpl { Http1Settings settings, uint32_t max_request_headers_kb, bool strict_header_validation); - virtual bool supports_http_10() override { return codec_settings_.accept_http_10_; } + bool supports_http_10() override { return codec_settings_.accept_http_10_; } private: /** diff --git a/source/common/http/http2/codec_impl.h b/source/common/http/http2/codec_impl.h index 0b8c8bd0c4be..c8df6ee4499d 100644 --- a/source/common/http/http2/codec_impl.h +++ b/source/common/http/http2/codec_impl.h @@ -80,7 +80,7 @@ class ConnectionImpl : public virtual Connection, protected Logger::Loggable, downstream_end_stream_(false), do_shadowing_(false), is_retry_(false), attempting_internal_redirect_with_complete_stream_(false) {} - ~Filter(); + ~Filter() override; // Http::StreamFilterBase void onDestroy() override; @@ -357,7 +357,7 @@ class Filter : Logger::Loggable, public Http::ConnectionPool::Callbacks, public LinkedObject { UpstreamRequest(Filter& parent, Http::ConnectionPool::Instance& pool); - ~UpstreamRequest(); + ~UpstreamRequest() override; void encodeHeaders(bool end_stream); void encodeData(Buffer::Instance& data, bool end_stream); diff --git a/source/common/stats/histogram_impl.h b/source/common/stats/histogram_impl.h index 926b3496d2b0..0177d9f3317e 100644 --- a/source/common/stats/histogram_impl.h +++ b/source/common/stats/histogram_impl.h @@ -72,7 +72,7 @@ class HistogramImpl : public HistogramImplHelper { const std::vector& tags) : HistogramImplHelper(name, tag_extracted_name, tags, parent.symbolTable()), parent_(parent) { } - ~HistogramImpl() { + ~HistogramImpl() override { // We must explicitly free the StatName here in order to supply the // SymbolTable reference. An RAII alternative would be to store a // reference to the SymbolTable in MetricImpl, which would cost 8 bytes @@ -99,7 +99,7 @@ class NullHistogramImpl : public HistogramImplHelper { public: explicit NullHistogramImpl(SymbolTable& symbol_table) : HistogramImplHelper(symbol_table), symbol_table_(symbol_table) {} - ~NullHistogramImpl() { MetricImpl::clear(symbol_table_); } + ~NullHistogramImpl() override { MetricImpl::clear(symbol_table_); } bool used() const override { return false; } SymbolTable& symbolTable() override { return symbol_table_; } diff --git a/source/common/stats/scope_prefixer.h b/source/common/stats/scope_prefixer.h index d4c63df99d8b..f85cfc3ff098 100644 --- a/source/common/stats/scope_prefixer.h +++ b/source/common/stats/scope_prefixer.h @@ -40,7 +40,7 @@ class ScopePrefixer : public Scope { OptionalHistogram findHistogram(StatName name) const override; const SymbolTable& constSymbolTable() const override { return scope_.constSymbolTable(); } - virtual SymbolTable& symbolTable() override { return scope_.symbolTable(); } + SymbolTable& symbolTable() override { return scope_.symbolTable(); } NullGaugeImpl& nullGauge(const std::string& str) override { return scope_.nullGauge(str); } diff --git a/source/common/tcp/conn_pool.h b/source/common/tcp/conn_pool.h index ff28802476cf..217b79cfdfbb 100644 --- a/source/common/tcp/conn_pool.h +++ b/source/common/tcp/conn_pool.h @@ -25,7 +25,7 @@ class ConnPoolImpl : Logger::Loggable, public ConnectionPool:: const Network::ConnectionSocket::OptionsSharedPtr& options, Network::TransportSocketOptionsSharedPtr transport_socket_options); - ~ConnPoolImpl(); + ~ConnPoolImpl() override; // ConnectionPool::Instance void addDrainedCallback(DrainedCb cb) override; @@ -59,7 +59,7 @@ class ConnPoolImpl : Logger::Loggable, public ConnectionPool:: struct ConnectionDataImpl : public ConnectionPool::ConnectionData { ConnectionDataImpl(ConnectionWrapperSharedPtr wrapper) : wrapper_(std::move(wrapper)) {} - ~ConnectionDataImpl() { wrapper_->release(false); } + ~ConnectionDataImpl() override { wrapper_->release(false); } // ConnectionPool::ConnectionData Network::ClientConnection& connection() override { return wrapper_->connection(); } @@ -80,7 +80,7 @@ class ConnPoolImpl : Logger::Loggable, public ConnectionPool:: ConnReadFilter(ActiveConn& parent) : parent_(parent) {} // Network::ReadFilter - Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) { + Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override { parent_.onUpstreamData(data, end_stream); return Network::FilterStatus::StopIteration; } @@ -92,7 +92,7 @@ class ConnPoolImpl : Logger::Loggable, public ConnectionPool:: public Network::ConnectionCallbacks, public Event::DeferredDeletable { ActiveConn(ConnPoolImpl& parent); - ~ActiveConn(); + ~ActiveConn() override; void onConnectTimeout(); void onUpstreamData(Buffer::Instance& data, bool end_stream); @@ -122,7 +122,7 @@ class ConnPoolImpl : Logger::Loggable, public ConnectionPool:: struct PendingRequest : LinkedObject, public ConnectionPool::Cancellable { PendingRequest(ConnPoolImpl& parent, ConnectionPool::Callbacks& callbacks); - ~PendingRequest(); + ~PendingRequest() override; // ConnectionPool::Cancellable void cancel(ConnectionPool::CancelPolicy cancel_policy) override { diff --git a/source/common/tcp_proxy/tcp_proxy.h b/source/common/tcp_proxy/tcp_proxy.h index 44cdd35aeacf..5a8534a56287 100644 --- a/source/common/tcp_proxy/tcp_proxy.h +++ b/source/common/tcp_proxy/tcp_proxy.h @@ -178,7 +178,7 @@ class Filter : public Network::ReadFilter, public: Filter(ConfigSharedPtr config, Upstream::ClusterManager& cluster_manager, TimeSource& time_source); - ~Filter(); + ~Filter() override; // Network::ReadFilter Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override; @@ -315,7 +315,7 @@ using DrainerPtr = std::unique_ptr; class UpstreamDrainManager : public ThreadLocal::ThreadLocalObject { public: - ~UpstreamDrainManager(); + ~UpstreamDrainManager() override; void add(const Config::SharedConfigSharedPtr& config, Tcp::ConnectionPool::ConnectionDataPtr&& upstream_conn_data, const std::shared_ptr& callbacks, diff --git a/source/common/thread_local/thread_local_impl.h b/source/common/thread_local/thread_local_impl.h index 820cd1504a95..25e346809f5a 100644 --- a/source/common/thread_local/thread_local_impl.h +++ b/source/common/thread_local/thread_local_impl.h @@ -18,7 +18,7 @@ namespace ThreadLocal { class InstanceImpl : Logger::Loggable, public Instance { public: InstanceImpl() : main_thread_id_(std::this_thread::get_id()) {} - ~InstanceImpl(); + ~InstanceImpl() override; // ThreadLocal::Instance SlotPtr allocateSlot() override; @@ -30,7 +30,7 @@ class InstanceImpl : Logger::Loggable, public Instance { private: struct SlotImpl : public Slot { SlotImpl(InstanceImpl& parent, uint64_t index) : parent_(parent), index_(index) {} - ~SlotImpl() { parent_.removeSlot(*this); } + ~SlotImpl() override { parent_.removeSlot(*this); } // ThreadLocal::Slot ThreadLocalObjectSharedPtr get() override; diff --git a/source/common/upstream/cluster_factory_impl.h b/source/common/upstream/cluster_factory_impl.h index cb5128a53763..ae709eb094c2 100644 --- a/source/common/upstream/cluster_factory_impl.h +++ b/source/common/upstream/cluster_factory_impl.h @@ -169,7 +169,7 @@ template class ConfigurableClusterFactoryBase : public Clust ConfigurableClusterFactoryBase(const std::string& name) : ClusterFactoryImplBase(name) {} private: - virtual std::pair + std::pair createClusterImpl(const envoy::api::v2::Cluster& cluster, ClusterFactoryContext& context, Server::Configuration::TransportSocketFactoryContext& socket_factory_context, Stats::ScopePtr&& stats_scope) override { diff --git a/source/common/upstream/cluster_manager_impl.h b/source/common/upstream/cluster_manager_impl.h index abe595033747..055cb9fd2cce 100644 --- a/source/common/upstream/cluster_manager_impl.h +++ b/source/common/upstream/cluster_manager_impl.h @@ -293,7 +293,7 @@ class ClusterManagerImpl : public ClusterManager, Logger::Loggable& local_cluster_name); - ~ThreadLocalClusterManagerImpl(); + ~ThreadLocalClusterManagerImpl() override; void drainConnPools(const HostVector& hosts); void drainConnPools(HostSharedPtr old_host, ConnPoolsContainer& container); void clearContainer(HostSharedPtr old_host, ConnPoolsContainer& container); diff --git a/source/common/upstream/health_checker_base_impl.h b/source/common/upstream/health_checker_base_impl.h index 39aa9a8687aa..5008cf9d3907 100644 --- a/source/common/upstream/health_checker_base_impl.h +++ b/source/common/upstream/health_checker_base_impl.h @@ -46,7 +46,7 @@ class HealthCheckerImplBase : public HealthChecker, protected: class ActiveHealthCheckSession : public Event::DeferredDeletable { public: - virtual ~ActiveHealthCheckSession(); + ~ActiveHealthCheckSession() override; HealthTransition setUnhealthy(envoy::data::core::v2alpha::HealthCheckFailureType type); void onDeferredDeleteBase(); void start() { onInitialInterval(); } diff --git a/source/common/upstream/load_balancer_impl.h b/source/common/upstream/load_balancer_impl.h index 79e3a1eca77d..518ea5071121 100644 --- a/source/common/upstream/load_balancer_impl.h +++ b/source/common/upstream/load_balancer_impl.h @@ -162,7 +162,7 @@ class ZoneAwareLoadBalancerBase : public LoadBalancerBase { ClusterStats& stats, Runtime::Loader& runtime, Runtime::RandomGenerator& random, const envoy::api::v2::Cluster::CommonLbConfig& common_config); - ~ZoneAwareLoadBalancerBase(); + ~ZoneAwareLoadBalancerBase() override; // When deciding which hosts to use on an LB decision, we need to know how to index into the // priority_set. This priority_set cursor is used by ZoneAwareLoadBalancerBase subclasses, e.g. diff --git a/source/common/upstream/outlier_detection_impl.h b/source/common/upstream/outlier_detection_impl.h index 3a03a7556c00..2b703c2adba4 100644 --- a/source/common/upstream/outlier_detection_impl.h +++ b/source/common/upstream/outlier_detection_impl.h @@ -290,7 +290,7 @@ class DetectorImpl : public Detector, public std::enable_shared_from_this(new_metadata); } @@ -483,13 +483,12 @@ class PrioritySetImpl : public PrioritySet { ASSERT(!parent_.batch_update_); parent_.batch_update_ = true; } - ~BatchUpdateScope() { parent_.batch_update_ = false; } + ~BatchUpdateScope() override { parent_.batch_update_ = false; } - virtual void updateHosts(uint32_t priority, - PrioritySet::UpdateHostsParams&& update_hosts_params, - LocalityWeightsConstSharedPtr locality_weights, - const HostVector& hosts_added, const HostVector& hosts_removed, - absl::optional overprovisioning_factor) override; + void updateHosts(uint32_t priority, PrioritySet::UpdateHostsParams&& update_hosts_params, + LocalityWeightsConstSharedPtr locality_weights, const HostVector& hosts_added, + const HostVector& hosts_removed, + absl::optional overprovisioning_factor) override; std::unordered_set all_hosts_added_; std::unordered_set all_hosts_removed_; diff --git a/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h b/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h index 440617b61c70..af3b81704b38 100644 --- a/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h +++ b/source/extensions/common/dynamic_forward_proxy/dns_cache_impl.h @@ -39,7 +39,7 @@ class DnsCacheImpl : public DnsCache, Logger::Loggable& timeout, bool use_alpha); - ~GrpcClientImpl(); + ~GrpcClientImpl() override; // ExtAuthz::Client void cancel() override; diff --git a/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h b/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h index 376ccdc64c70..a26d5e4532f4 100644 --- a/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h +++ b/source/extensions/filters/common/ext_authz/ext_authz_http_impl.h @@ -129,7 +129,7 @@ class RawHttpClientImpl : public Client, Logger::Loggable { public: explicit RawHttpClientImpl(Upstream::ClusterManager& cm, ClientConfigSharedPtr config); - ~RawHttpClientImpl(); + ~RawHttpClientImpl() override; // ExtAuthz::Client void cancel() override; diff --git a/source/extensions/filters/common/original_src/original_src_socket_option.h b/source/extensions/filters/common/original_src/original_src_socket_option.h index e030456c2089..3e428bf9b329 100644 --- a/source/extensions/filters/common/original_src/original_src_socket_option.h +++ b/source/extensions/filters/common/original_src/original_src_socket_option.h @@ -18,7 +18,7 @@ class OriginalSrcSocketOption : public Network::Socket::Option { * Constructs a socket option which will set the socket to use source @c src_address */ OriginalSrcSocketOption(Network::Address::InstanceConstSharedPtr src_address); - ~OriginalSrcSocketOption() = default; + ~OriginalSrcSocketOption() override = default; /** * Updates the source address of the socket to match `src_address_`. diff --git a/source/extensions/filters/common/ratelimit/ratelimit_impl.h b/source/extensions/filters/common/ratelimit/ratelimit_impl.h index 11ca4c4396b0..fcd4cb520b1d 100644 --- a/source/extensions/filters/common/ratelimit/ratelimit_impl.h +++ b/source/extensions/filters/common/ratelimit/ratelimit_impl.h @@ -47,7 +47,7 @@ class GrpcClientImpl : public Client, public: GrpcClientImpl(Grpc::RawAsyncClientPtr&& async_client, const absl::optional& timeout); - ~GrpcClientImpl(); + ~GrpcClientImpl() override; static void createRequest(envoy::service::ratelimit::v2::RateLimitRequest& request, const std::string& domain, diff --git a/source/extensions/filters/http/common/aws/credentials_provider_impl.h b/source/extensions/filters/http/common/aws/credentials_provider_impl.h index 31e4d25d5d87..5f9b3816cfe0 100644 --- a/source/extensions/filters/http/common/aws/credentials_provider_impl.h +++ b/source/extensions/filters/http/common/aws/credentials_provider_impl.h @@ -98,7 +98,7 @@ class TaskRoleCredentialsProvider : public MetadataCredentialsProviderBase { class CredentialsProviderChain : public CredentialsProvider, public Logger::Loggable { public: - virtual ~CredentialsProviderChain() = default; + ~CredentialsProviderChain() override = default; void add(const CredentialsProviderSharedPtr& credentials_provider) { providers_.emplace_back(credentials_provider); diff --git a/source/extensions/filters/http/common/jwks_fetcher.cc b/source/extensions/filters/http/common/jwks_fetcher.cc index d5c7a6c26d90..0eba021cf41e 100644 --- a/source/extensions/filters/http/common/jwks_fetcher.cc +++ b/source/extensions/filters/http/common/jwks_fetcher.cc @@ -18,9 +18,9 @@ class JwksFetcherImpl : public JwksFetcher, public: JwksFetcherImpl(Upstream::ClusterManager& cm) : cm_(cm) { ENVOY_LOG(trace, "{}", __func__); } - ~JwksFetcherImpl() { cancel(); } + ~JwksFetcherImpl() override { cancel(); } - void cancel() { + void cancel() override { if (request_ && !complete_) { request_->cancel(); ENVOY_LOG(debug, "fetch pubkey [uri = {}]: canceled", uri_->uri()); @@ -28,7 +28,8 @@ class JwksFetcherImpl : public JwksFetcher, reset(); } - void fetch(const ::envoy::api::v2::core::HttpUri& uri, JwksFetcher::JwksReceiver& receiver) { + void fetch(const ::envoy::api::v2::core::HttpUri& uri, + JwksFetcher::JwksReceiver& receiver) override { ENVOY_LOG(trace, "{}", __func__); ASSERT(!receiver_); complete_ = false; @@ -44,7 +45,7 @@ class JwksFetcherImpl : public JwksFetcher, } // HTTP async receive methods - void onSuccess(Http::MessagePtr&& response) { + void onSuccess(Http::MessagePtr&& response) override { ENVOY_LOG(trace, "{}", __func__); complete_ = true; const uint64_t status_code = Http::Utility::getResponseStatus(response->headers()); @@ -74,7 +75,7 @@ class JwksFetcherImpl : public JwksFetcher, reset(); } - void onFailure(Http::AsyncClient::FailureReason reason) { + void onFailure(Http::AsyncClient::FailureReason reason) override { ENVOY_LOG(debug, "{}: fetch pubkey [uri = {}]: network error {}", __func__, uri_->uri(), enumToInt(reason)); complete_ = true; diff --git a/source/extensions/filters/http/fault/fault_filter.h b/source/extensions/filters/http/fault/fault_filter.h index b350ce61ce64..2a592c98a0f7 100644 --- a/source/extensions/filters/http/fault/fault_filter.h +++ b/source/extensions/filters/http/fault/fault_filter.h @@ -168,7 +168,7 @@ class StreamRateLimiter : Logger::Loggable { class FaultFilter : public Http::StreamFilter, Logger::Loggable { public: FaultFilter(FaultFilterConfigSharedPtr config); - ~FaultFilter(); + ~FaultFilter() override; // Http::StreamFilterBase void onDestroy() override; diff --git a/source/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_impl.h b/source/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_impl.h index 7c4dfa4dc3f9..f5b4159be0d1 100644 --- a/source/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_impl.h +++ b/source/extensions/filters/http/grpc_json_transcoder/transcoder_input_stream_impl.h @@ -13,8 +13,8 @@ class TranscoderInputStreamImpl : public Buffer::ZeroCopyInputStreamImpl, public google::grpc::transcoding::TranscoderInputStream { public: // TranscoderInputStream - virtual int64_t BytesAvailable() const override; - virtual bool Finished() const override; + int64_t BytesAvailable() const override; + bool Finished() const override; }; } // namespace GrpcJsonTranscoder diff --git a/source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.h b/source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.h index 188124e9d16f..e10da6e3eba9 100644 --- a/source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.h +++ b/source/extensions/filters/http/header_to_metadata/header_to_metadata_filter.h @@ -66,7 +66,7 @@ class HeaderToMetadataFilter : public Http::StreamFilter, public Logger::Loggable { public: HeaderToMetadataFilter(const ConfigSharedPtr config); - ~HeaderToMetadataFilter(); + ~HeaderToMetadataFilter() override; // Http::StreamFilterBase void onDestroy() override {} diff --git a/source/extensions/filters/http/ip_tagging/ip_tagging_filter.h b/source/extensions/filters/http/ip_tagging/ip_tagging_filter.h index 14a35a9a914b..3eaa7f22c841 100644 --- a/source/extensions/filters/http/ip_tagging/ip_tagging_filter.h +++ b/source/extensions/filters/http/ip_tagging/ip_tagging_filter.h @@ -107,7 +107,7 @@ using IpTaggingFilterConfigSharedPtr = std::shared_ptr; class IpTaggingFilter : public Http::StreamDecoderFilter { public: IpTaggingFilter(IpTaggingFilterConfigSharedPtr config); - ~IpTaggingFilter(); + ~IpTaggingFilter() override; // Http::StreamFilterBase void onDestroy() override; diff --git a/source/extensions/filters/network/common/redis/client_impl.h b/source/extensions/filters/network/common/redis/client_impl.h index d88fc4c93e23..ffeb0ee458d8 100644 --- a/source/extensions/filters/network/common/redis/client_impl.h +++ b/source/extensions/filters/network/common/redis/client_impl.h @@ -65,7 +65,7 @@ class ClientImpl : public Client, public DecoderCallbacks, public Network::Conne EncoderPtr&& encoder, DecoderFactory& decoder_factory, const Config& config); - ~ClientImpl(); + ~ClientImpl() override; // Client void addConnectionCallbacks(Network::ConnectionCallbacks& callbacks) override { @@ -93,7 +93,7 @@ class ClientImpl : public Client, public DecoderCallbacks, public Network::Conne struct PendingRequest : public PoolRequest { PendingRequest(ClientImpl& parent, PoolCallbacks& callbacks); - ~PendingRequest(); + ~PendingRequest() override; // PoolRequest void cancel() override; diff --git a/source/extensions/filters/network/dubbo_proxy/decoder.h b/source/extensions/filters/network/dubbo_proxy/decoder.h index 627dc314428b..2723633c79a6 100644 --- a/source/extensions/filters/network/dubbo_proxy/decoder.h +++ b/source/extensions/filters/network/dubbo_proxy/decoder.h @@ -128,7 +128,7 @@ class DecoderBase : public DecoderStateMachine::Delegate, public Logger::Loggable { public: DecoderBase(Protocol& protocol); - virtual ~DecoderBase(); + ~DecoderBase() override; /** * Drains data from the given buffer diff --git a/source/extensions/filters/network/dubbo_proxy/dubbo_hessian2_serializer_impl.h b/source/extensions/filters/network/dubbo_proxy/dubbo_hessian2_serializer_impl.h index eeffb0c1044e..5af5e5d59622 100644 --- a/source/extensions/filters/network/dubbo_proxy/dubbo_hessian2_serializer_impl.h +++ b/source/extensions/filters/network/dubbo_proxy/dubbo_hessian2_serializer_impl.h @@ -8,20 +8,20 @@ namespace NetworkFilters { namespace DubboProxy { class DubboHessian2SerializerImpl : public Serializer { public: - ~DubboHessian2SerializerImpl() = default; - virtual const std::string& name() const override { + ~DubboHessian2SerializerImpl() override = default; + const std::string& name() const override { return ProtocolSerializerNames::get().fromType(ProtocolType::Dubbo, type()); } - virtual SerializationType type() const override { return SerializationType::Hessian2; } + SerializationType type() const override { return SerializationType::Hessian2; } - virtual std::pair + std::pair deserializeRpcInvocation(Buffer::Instance& buffer, ContextSharedPtr context) override; - virtual std::pair - deserializeRpcResult(Buffer::Instance& buffer, ContextSharedPtr context) override; + std::pair deserializeRpcResult(Buffer::Instance& buffer, + ContextSharedPtr context) override; - virtual size_t serializeRpcResult(Buffer::Instance& output_buffer, const std::string& content, - RpcResponseType type) override; + size_t serializeRpcResult(Buffer::Instance& output_buffer, const std::string& content, + RpcResponseType type) override; }; } // namespace DubboProxy diff --git a/source/extensions/filters/network/dubbo_proxy/filters/filter.h b/source/extensions/filters/network/dubbo_proxy/filters/filter.h index 5b4a5e5625c3..7ff4cbf5a030 100644 --- a/source/extensions/filters/network/dubbo_proxy/filters/filter.h +++ b/source/extensions/filters/network/dubbo_proxy/filters/filter.h @@ -115,7 +115,7 @@ class FilterCallbacksBase { */ class DecoderFilterCallbacks : public virtual FilterCallbacksBase { public: - virtual ~DecoderFilterCallbacks() = default; + ~DecoderFilterCallbacks() override = default; /** * Continue iterating through the filter chain with buffered data. This routine can only be @@ -158,7 +158,7 @@ class DecoderFilterCallbacks : public virtual FilterCallbacksBase { */ class EncoderFilterCallbacks : public virtual FilterCallbacksBase { public: - virtual ~EncoderFilterCallbacks() = default; + ~EncoderFilterCallbacks() override = default; /** * Continue iterating through the filter chain with buffered data. This routine can only be @@ -194,7 +194,7 @@ class FilterBase { */ class DecoderFilter : public StreamDecoder, public FilterBase { public: - virtual ~DecoderFilter() = default; + ~DecoderFilter() override = default; /** * Called by the connection manager once to initialize the filter decoder callbacks that the @@ -210,7 +210,7 @@ using DecoderFilterSharedPtr = std::shared_ptr; */ class EncoderFilter : public StreamEncoder, public FilterBase { public: - virtual ~EncoderFilter() = default; + ~EncoderFilter() override = default; /** * Called by the connection manager once to initialize the filter encoder callbacks that the diff --git a/source/extensions/filters/network/dubbo_proxy/router/route_matcher.h b/source/extensions/filters/network/dubbo_proxy/router/route_matcher.h index 551d658f6ba0..caa8b9ca3112 100644 --- a/source/extensions/filters/network/dubbo_proxy/router/route_matcher.h +++ b/source/extensions/filters/network/dubbo_proxy/router/route_matcher.h @@ -30,7 +30,7 @@ class RouteEntryImplBase : public RouteEntry, public Logger::Loggable { public: RouteEntryImplBase(const envoy::config::filter::network::dubbo_proxy::v2alpha1::Route& route); - virtual ~RouteEntryImplBase() = default; + ~RouteEntryImplBase() override = default; // Router::RouteEntry const std::string& clusterName() const override; diff --git a/source/extensions/filters/network/dubbo_proxy/router/router_impl.h b/source/extensions/filters/network/dubbo_proxy/router/router_impl.h index c4840015a5b5..9fc078a5aa4b 100644 --- a/source/extensions/filters/network/dubbo_proxy/router/router_impl.h +++ b/source/extensions/filters/network/dubbo_proxy/router/router_impl.h @@ -47,7 +47,7 @@ class Router : public Tcp::ConnectionPool::UpstreamCallbacks, UpstreamRequest(Router& parent, Tcp::ConnectionPool::Instance& pool, MessageMetadataSharedPtr& metadata, SerializationType serialization_type, ProtocolType protocol_type); - ~UpstreamRequest(); + ~UpstreamRequest() override; FilterStatus start(); void resetStream(); diff --git a/source/extensions/filters/network/ext_authz/ext_authz.h b/source/extensions/filters/network/ext_authz/ext_authz.h index 276509c5d8e0..a0a963750be1 100644 --- a/source/extensions/filters/network/ext_authz/ext_authz.h +++ b/source/extensions/filters/network/ext_authz/ext_authz.h @@ -73,7 +73,7 @@ class Filter : public Network::ReadFilter, public: Filter(ConfigSharedPtr config, Filters::Common::ExtAuthz::ClientPtr&& client) : config_(config), client_(std::move(client)) {} - ~Filter() = default; + ~Filter() override = default; // Network::ReadFilter Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override; diff --git a/source/extensions/filters/network/kafka/codec.h b/source/extensions/filters/network/kafka/codec.h index 6dfe638d31d0..54e5709981be 100644 --- a/source/extensions/filters/network/kafka/codec.h +++ b/source/extensions/filters/network/kafka/codec.h @@ -48,7 +48,7 @@ template class MessageCallback template class AbstractMessageDecoder : public MessageDecoder { public: - virtual ~AbstractMessageDecoder() = default; + ~AbstractMessageDecoder() override = default; /** * Creates a decoder that will invoke given callbacks when a message has been parsed. diff --git a/source/extensions/filters/network/mongo_proxy/proxy.h b/source/extensions/filters/network/mongo_proxy/proxy.h index 35cdc29c17d1..f81ef86017ef 100644 --- a/source/extensions/filters/network/mongo_proxy/proxy.h +++ b/source/extensions/filters/network/mongo_proxy/proxy.h @@ -111,7 +111,7 @@ class ProxyFilter : public Network::Filter, const Filters::Common::Fault::FaultDelayConfigSharedPtr& fault_config, const Network::DrainDecision& drain_decision, TimeSource& time_system, bool emit_dynamic_metadata); - ~ProxyFilter(); + ~ProxyFilter() override; virtual DecoderPtr createDecoder(DecoderCallbacks& callbacks) PURE; diff --git a/source/extensions/filters/network/rbac/rbac_filter.h b/source/extensions/filters/network/rbac/rbac_filter.h index 3fffefd23e93..b548424c63de 100644 --- a/source/extensions/filters/network/rbac/rbac_filter.h +++ b/source/extensions/filters/network/rbac/rbac_filter.h @@ -55,7 +55,7 @@ class RoleBasedAccessControlFilter : public Network::ReadFilter, public: RoleBasedAccessControlFilter(RoleBasedAccessControlFilterConfigSharedPtr config) : config_(config) {} - ~RoleBasedAccessControlFilter() = default; + ~RoleBasedAccessControlFilter() override = default; // Network::ReadFilter Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override; diff --git a/source/extensions/filters/network/redis_proxy/command_splitter_impl.h b/source/extensions/filters/network/redis_proxy/command_splitter_impl.h index e530fe8d3fdf..f4ee4c6f79d4 100644 --- a/source/extensions/filters/network/redis_proxy/command_splitter_impl.h +++ b/source/extensions/filters/network/redis_proxy/command_splitter_impl.h @@ -100,7 +100,7 @@ class SplitRequestBase : public SplitRequest { */ class SingleServerRequest : public SplitRequestBase, public Common::Redis::Client::PoolCallbacks { public: - ~SingleServerRequest(); + ~SingleServerRequest() override; // Common::Redis::Client::PoolCallbacks void onResponse(Common::Redis::RespValuePtr&& response) override; @@ -158,7 +158,7 @@ class EvalRequest : public SingleServerRequest { */ class FragmentedRequest : public SplitRequestBase { public: - ~FragmentedRequest(); + ~FragmentedRequest() override; // RedisProxy::CommandSplitter::SplitRequest void cancel() override; @@ -277,7 +277,7 @@ class CommandHandlerFactory : public CommandHandler, CommandHandlerBase { CommandHandlerFactory(Router& router) : CommandHandlerBase(router) {} SplitRequestPtr startRequest(Common::Redis::RespValuePtr&& request, SplitCallbacks& callbacks, CommandStats& command_stats, TimeSource& time_source, - bool latency_in_micros) { + bool latency_in_micros) override { return RequestClass::create(router_, std::move(request), callbacks, command_stats, time_source, latency_in_micros); } diff --git a/source/extensions/filters/network/redis_proxy/conn_pool_impl.h b/source/extensions/filters/network/redis_proxy/conn_pool_impl.h index ff5b52ed5067..91ea51f3e752 100644 --- a/source/extensions/filters/network/redis_proxy/conn_pool_impl.h +++ b/source/extensions/filters/network/redis_proxy/conn_pool_impl.h @@ -84,7 +84,7 @@ class InstanceImpl : public Instance { struct ThreadLocalPool : public ThreadLocal::ThreadLocalObject, public Upstream::ClusterUpdateCallbacks { ThreadLocalPool(InstanceImpl& parent, Event::Dispatcher& dispatcher, std::string cluster_name); - ~ThreadLocalPool(); + ~ThreadLocalPool() override; ThreadLocalActiveClientPtr& threadLocalActiveClient(Upstream::HostConstSharedPtr host); Common::Redis::Client::PoolRequest* makeRequest(const std::string& key, const Common::Redis::RespValue& request, diff --git a/source/extensions/filters/network/redis_proxy/proxy_filter.h b/source/extensions/filters/network/redis_proxy/proxy_filter.h index d916a97f6fad..aefa3b9a7efa 100644 --- a/source/extensions/filters/network/redis_proxy/proxy_filter.h +++ b/source/extensions/filters/network/redis_proxy/proxy_filter.h @@ -75,7 +75,7 @@ class ProxyFilter : public Network::ReadFilter, public: ProxyFilter(Common::Redis::DecoderFactory& factory, Common::Redis::EncoderPtr&& encoder, CommandSplitter::Instance& splitter, ProxyFilterConfigSharedPtr config); - ~ProxyFilter(); + ~ProxyFilter() override; // Network::ReadFilter void initializeReadFilterCallbacks(Network::ReadFilterCallbacks& callbacks) override; @@ -95,7 +95,7 @@ class ProxyFilter : public Network::ReadFilter, private: struct PendingRequest : public CommandSplitter::SplitCallbacks { PendingRequest(ProxyFilter& parent); - ~PendingRequest(); + ~PendingRequest() override; // RedisProxy::CommandSplitter::SplitCallbacks bool connectionAllowed() override { return parent_.connectionAllowed(); } diff --git a/source/extensions/filters/network/thrift_proxy/conn_manager.h b/source/extensions/filters/network/thrift_proxy/conn_manager.h index afdcbcc8ff34..2188ad7ee9eb 100644 --- a/source/extensions/filters/network/thrift_proxy/conn_manager.h +++ b/source/extensions/filters/network/thrift_proxy/conn_manager.h @@ -61,7 +61,7 @@ class ConnectionManager : public Network::ReadFilter, public: ConnectionManager(Config& config, Runtime::RandomGenerator& random_generator, TimeSource& time_system); - ~ConnectionManager(); + ~ConnectionManager() override; // Network::ReadFilter Network::FilterStatus onData(Buffer::Instance& data, bool end_stream) override; @@ -164,7 +164,7 @@ class ConnectionManager : public Network::ReadFilter, stream_info_.setDownstreamRemoteAddress( parent_.read_callbacks_->connection().remoteAddress()); } - ~ActiveRpc() { + ~ActiveRpc() override { request_timer_->complete(); parent_.stats_.request_active_.dec(); diff --git a/source/extensions/filters/network/thrift_proxy/thrift_object_impl.h b/source/extensions/filters/network/thrift_proxy/thrift_object_impl.h index 39c31b3c79a0..d6961ce87357 100644 --- a/source/extensions/filters/network/thrift_proxy/thrift_object_impl.h +++ b/source/extensions/filters/network/thrift_proxy/thrift_object_impl.h @@ -18,7 +18,7 @@ namespace ThriftProxy { class ThriftBase : public DecoderEventHandler { public: ThriftBase(ThriftBase* parent); - ~ThriftBase() = default; + ~ThriftBase() override = default; // DecoderEventHandler FilterStatus transportBegin(MessageMetadataSharedPtr) override { return FilterStatus::Continue; } @@ -61,7 +61,7 @@ class ThriftValueBase : public ThriftValue, public ThriftBase { public: ThriftValueBase(ThriftBase* parent, FieldType value_type) : ThriftBase(parent), value_type_(value_type) {} - ~ThriftValueBase() = default; + ~ThriftValueBase() override = default; // ThriftValue FieldType type() const override { return value_type_; } diff --git a/source/extensions/grpc_credentials/example/config.h b/source/extensions/grpc_credentials/example/config.h index 06f2d2f2b498..f10557a30a55 100644 --- a/source/extensions/grpc_credentials/example/config.h +++ b/source/extensions/grpc_credentials/example/config.h @@ -27,7 +27,7 @@ namespace Example { */ class AccessTokenExampleGrpcCredentialsFactory : public Grpc::GoogleGrpcCredentialsFactory { public: - virtual std::shared_ptr + std::shared_ptr getChannelCredentials(const envoy::api::v2::core::GrpcService& grpc_service_config, Api::Api& api) override; diff --git a/source/extensions/health_checkers/redis/redis.h b/source/extensions/health_checkers/redis/redis.h index 63f9dd0de0d5..346b27e9b951 100644 --- a/source/extensions/health_checkers/redis/redis.h +++ b/source/extensions/health_checkers/redis/redis.h @@ -51,7 +51,7 @@ class RedisHealthChecker : public Upstream::HealthCheckerImplBase { public Extensions::NetworkFilters::Common::Redis::Client::PoolCallbacks, public Network::ConnectionCallbacks { RedisActiveHealthCheckSession(RedisHealthChecker& parent, const Upstream::HostSharedPtr& host); - ~RedisActiveHealthCheckSession(); + ~RedisActiveHealthCheckSession() override; // ActiveHealthCheckSession void onInterval() override; diff --git a/source/extensions/stat_sinks/common/statsd/statsd.h b/source/extensions/stat_sinks/common/statsd/statsd.h index a13cd0a730bc..a6eb91a62750 100644 --- a/source/extensions/stat_sinks/common/statsd/statsd.h +++ b/source/extensions/stat_sinks/common/statsd/statsd.h @@ -30,7 +30,7 @@ class Writer : public ThreadLocal::ThreadLocalObject { Writer(Network::Address::InstanceConstSharedPtr address); // For testing. Writer() : io_handle_(std::make_unique()) {} - virtual ~Writer(); + ~Writer() override; virtual void write(const std::string& message); // Called in unit test to validate address. @@ -98,7 +98,7 @@ class TcpStatsdSink : public Stats::Sink { private: struct TlsSink : public ThreadLocal::ThreadLocalObject, public Network::ConnectionCallbacks { TlsSink(TcpStatsdSink& parent, Event::Dispatcher& dispatcher); - ~TlsSink(); + ~TlsSink() override; void beginFlush(bool expect_empty_buffer); void checkSize(); diff --git a/source/extensions/tracers/common/factory_base.h b/source/extensions/tracers/common/factory_base.h index 67191834c65b..6b57de7b3c35 100644 --- a/source/extensions/tracers/common/factory_base.h +++ b/source/extensions/tracers/common/factory_base.h @@ -15,8 +15,8 @@ namespace Common { template class FactoryBase : public Server::Configuration::TracerFactory { public: // Server::Configuration::TracerFactory - virtual Tracing::HttpTracerPtr createHttpTracer(const Protobuf::Message& config, - Server::Instance& server) override { + Tracing::HttpTracerPtr createHttpTracer(const Protobuf::Message& config, + Server::Instance& server) override { return createHttpTracerTyped(MessageUtil::downcastAndValidate(config), server); } diff --git a/source/extensions/tracers/lightstep/lightstep_tracer_impl.h b/source/extensions/tracers/lightstep/lightstep_tracer_impl.h index d6046ccd4e40..6988ce504bcc 100644 --- a/source/extensions/tracers/lightstep/lightstep_tracer_impl.h +++ b/source/extensions/tracers/lightstep/lightstep_tracer_impl.h @@ -74,7 +74,7 @@ class LightStepDriver : public Common::Ot::OpenTracingDriver { public: explicit LightStepTransporter(LightStepDriver& driver); - ~LightStepTransporter(); + ~LightStepTransporter() override; // lightstep::AsyncTransporter void Send(const Protobuf::Message& request, Protobuf::Message& response, diff --git a/source/extensions/transport_sockets/alts/config.cc b/source/extensions/transport_sockets/alts/config.cc index 1549a2a33d77..a85bb9d7fa85 100644 --- a/source/extensions/transport_sockets/alts/config.cc +++ b/source/extensions/transport_sockets/alts/config.cc @@ -64,7 +64,7 @@ class AltsSharedState : public Singleton::Instance { public: AltsSharedState() { grpc_alts_shared_resource_dedicated_init(); } - ~AltsSharedState() { grpc_alts_shared_resource_dedicated_shutdown(); } + ~AltsSharedState() override { grpc_alts_shared_resource_dedicated_shutdown(); } }; SINGLETON_MANAGER_REGISTRATION(alts_shared_state); diff --git a/source/extensions/transport_sockets/alts/tsi_handshaker.h b/source/extensions/transport_sockets/alts/tsi_handshaker.h index d578493573ec..71cd6989e71a 100644 --- a/source/extensions/transport_sockets/alts/tsi_handshaker.h +++ b/source/extensions/transport_sockets/alts/tsi_handshaker.h @@ -51,7 +51,7 @@ class TsiHandshakerCallbacks { class TsiHandshaker final : public Event::DeferredDeletable { public: explicit TsiHandshaker(CHandshakerPtr&& handshaker, Event::Dispatcher& dispatcher); - ~TsiHandshaker(); + ~TsiHandshaker() override; /** * Conduct next step of handshake, see diff --git a/source/extensions/transport_sockets/alts/tsi_socket.h b/source/extensions/transport_sockets/alts/tsi_socket.h index 31b4571db096..bbd7b19fadcb 100644 --- a/source/extensions/transport_sockets/alts/tsi_socket.h +++ b/source/extensions/transport_sockets/alts/tsi_socket.h @@ -51,7 +51,7 @@ class TsiSocket : public Network::TransportSocket, * The connection will be closed immediately if it returns false. */ TsiSocket(HandshakerFactory handshaker_factory, HandshakeValidator handshake_validator); - virtual ~TsiSocket(); + ~TsiSocket() override; // Network::TransportSocket void setTransportSocketCallbacks(Envoy::Network::TransportSocketCallbacks& callbacks) override; diff --git a/source/extensions/transport_sockets/tls/context_manager_impl.h b/source/extensions/transport_sockets/tls/context_manager_impl.h index 2bb82342940c..88ef9e67d546 100644 --- a/source/extensions/transport_sockets/tls/context_manager_impl.h +++ b/source/extensions/transport_sockets/tls/context_manager_impl.h @@ -22,7 +22,7 @@ namespace Tls { class ContextManagerImpl final : public Envoy::Ssl::ContextManager { public: ContextManagerImpl(TimeSource& time_source) : time_source_(time_source) {} - ~ContextManagerImpl(); + ~ContextManagerImpl() override; // Ssl::ContextManager Ssl::ClientContextSharedPtr diff --git a/source/server/config_validation/connection.h b/source/server/config_validation/connection.h index 7c6d5b6db062..6fb9839ff890 100644 --- a/source/server/config_validation/connection.h +++ b/source/server/config_validation/connection.h @@ -24,7 +24,7 @@ class ConfigValidateConnection : public Network::ClientConnectionImpl { // Unit tests may instantiate it without proper event machine and leave opened sockets. // Do some cleanup before invoking base class's destructor. - virtual ~ConfigValidateConnection() { close(ConnectionCloseType::NoFlush); } + ~ConfigValidateConnection() override { close(ConnectionCloseType::NoFlush); } // connect may be called in config verification mode. // It is redefined as no-op. Calling parent's method triggers connection to upstream host. diff --git a/source/server/http/config_tracker_impl.h b/source/server/http/config_tracker_impl.h index 0bcb840b7478..3c8ab1c156bf 100644 --- a/source/server/http/config_tracker_impl.h +++ b/source/server/http/config_tracker_impl.h @@ -22,7 +22,7 @@ class ConfigTrackerImpl : public ConfigTracker { class EntryOwnerImpl : public ConfigTracker::EntryOwner { public: EntryOwnerImpl(const std::shared_ptr& map, const std::string& key); - ~EntryOwnerImpl(); + ~EntryOwnerImpl() override; private: std::shared_ptr map_; diff --git a/source/server/listener_manager_impl.h b/source/server/listener_manager_impl.h index c3c9055ae4fd..43edef1e2f3e 100644 --- a/source/server/listener_manager_impl.h +++ b/source/server/listener_manager_impl.h @@ -226,7 +226,7 @@ class ListenerImpl : public Network::ListenerConfig, ListenerImpl(const envoy::api::v2::Listener& config, const std::string& version_info, ListenerManagerImpl& parent, const std::string& name, bool modifiable, bool workers_started, uint64_t hash); - ~ListenerImpl(); + ~ListenerImpl() override; /** * Helper functions to determine whether a listener is blocked for update or remove. diff --git a/source/server/options_impl.h b/source/server/options_impl.h index cddf660f79f4..3269050f5fc4 100644 --- a/source/server/options_impl.h +++ b/source/server/options_impl.h @@ -103,7 +103,7 @@ class OptionsImpl : public Server::Options, protected Logger::Loggable= threshold_; } + bool isFired() const override { return value_.has_value() && value_ >= threshold_; } private: const double threshold_; diff --git a/test/common/config/delta_subscription_test_harness.h b/test/common/config/delta_subscription_test_harness.h index e14599210884..a2431c154bc8 100644 --- a/test/common/config/delta_subscription_test_harness.h +++ b/test/common/config/delta_subscription_test_harness.h @@ -38,7 +38,7 @@ class DeltaSubscriptionTestHarness : public SubscriptionTestHarness { rate_limit_settings_, callbacks_, stats_, init_fetch_timeout); } - ~DeltaSubscriptionTestHarness() { + ~DeltaSubscriptionTestHarness() override { while (!nonce_acks_required_.empty()) { EXPECT_FALSE(nonce_acks_sent_.empty()); EXPECT_EQ(nonce_acks_required_.front(), nonce_acks_sent_.front()); diff --git a/test/common/config/filesystem_subscription_test_harness.h b/test/common/config/filesystem_subscription_test_harness.h index 9a14fc73dd5c..28dea555e0d5 100644 --- a/test/common/config/filesystem_subscription_test_harness.h +++ b/test/common/config/filesystem_subscription_test_harness.h @@ -32,7 +32,7 @@ class FilesystemSubscriptionTestHarness : public SubscriptionTestHarness { api_(Api::createApiForTest(stats_store_)), dispatcher_(api_->allocateDispatcher()), subscription_(*dispatcher_, path_, callbacks_, stats_, validation_visitor_, *api_) {} - ~FilesystemSubscriptionTestHarness() { + ~FilesystemSubscriptionTestHarness() override { if (::access(path_.c_str(), F_OK) != -1) { EXPECT_EQ(0, ::unlink(path_.c_str())); } diff --git a/test/common/config/http_subscription_test_harness.h b/test/common/config/http_subscription_test_harness.h index c769a40cc4ff..ecf5c056950e 100644 --- a/test/common/config/http_subscription_test_harness.h +++ b/test/common/config/http_subscription_test_harness.h @@ -51,7 +51,7 @@ class HttpSubscriptionTestHarness : public SubscriptionTestHarness { init_fetch_timeout, validation_visitor_); } - ~HttpSubscriptionTestHarness() { + ~HttpSubscriptionTestHarness() override { // Stop subscribing on the way out. if (request_in_progress_) { EXPECT_CALL(http_request_, cancel()); diff --git a/test/common/config/metadata_test.cc b/test/common/config/metadata_test.cc index 28d5cb67b4a8..885d69f82117 100644 --- a/test/common/config/metadata_test.cc +++ b/test/common/config/metadata_test.cc @@ -61,9 +61,10 @@ class TypedMetadataTest : public testing::Test { class FooFactory : public TypedMetadataFactory::TypedMetadataFactory { public: - const std::string name() const { return "foo"; } + const std::string name() const override { return "foo"; } // Throws EnvoyException (conversion failure) if d is empty. - std::unique_ptr parse(const ProtobufWkt::Struct& d) const { + std::unique_ptr + parse(const ProtobufWkt::Struct& d) const override { if (d.fields().find("name") != d.fields().end()) { return std::make_unique(d.fields().at("name").string_value()); } diff --git a/test/common/event/dispatcher_impl_test.cc b/test/common/event/dispatcher_impl_test.cc index 97a36cc43c03..b6fc1de1b124 100644 --- a/test/common/event/dispatcher_impl_test.cc +++ b/test/common/event/dispatcher_impl_test.cc @@ -28,7 +28,7 @@ namespace { class TestDeferredDeletable : public DeferredDeletable { public: TestDeferredDeletable(std::function on_destroy) : on_destroy_(on_destroy) {} - ~TestDeferredDeletable() { on_destroy_(); } + ~TestDeferredDeletable() override { on_destroy_(); } private: std::function on_destroy_; diff --git a/test/common/grpc/grpc_client_integration_test.cc b/test/common/grpc/grpc_client_integration_test.cc index 5044cace4d40..f7b7505b4ad8 100644 --- a/test/common/grpc/grpc_client_integration_test.cc +++ b/test/common/grpc/grpc_client_integration_test.cc @@ -406,7 +406,7 @@ class GrpcAccessTokenClientIntegrationTest : public GrpcSslClientIntegrationTest } } - virtual envoy::api::v2::core::GrpcService createGoogleGrpcConfig() override { + envoy::api::v2::core::GrpcService createGoogleGrpcConfig() override { auto config = GrpcClientIntegrationTest::createGoogleGrpcConfig(); auto* google_grpc = config.mutable_google_grpc(); google_grpc->set_credentials_factory_name(credentials_factory_name_); diff --git a/test/common/grpc/grpc_client_integration_test_harness.h b/test/common/grpc/grpc_client_integration_test_harness.h index ad8a997d770b..997bae8b6bb8 100644 --- a/test/common/grpc/grpc_client_integration_test_harness.h +++ b/test/common/grpc/grpc_client_integration_test_harness.h @@ -471,7 +471,7 @@ class GrpcSslClientIntegrationTest : public GrpcClientIntegrationTest { mock_cluster_info_->transport_socket_factory_.reset(); } - virtual envoy::api::v2::core::GrpcService createGoogleGrpcConfig() override { + envoy::api::v2::core::GrpcService createGoogleGrpcConfig() override { auto config = GrpcClientIntegrationTest::createGoogleGrpcConfig(); TestUtility::setTestSslGoogleGrpcConfig(config, use_client_cert_); return config; diff --git a/test/common/http/codec_client_test.cc b/test/common/http/codec_client_test.cc index 911b8a64c55f..7fc083eba090 100644 --- a/test/common/http/codec_client_test.cc +++ b/test/common/http/codec_client_test.cc @@ -58,7 +58,7 @@ class CodecClientTest : public testing::Test { dispatcher_); } - ~CodecClientTest() { EXPECT_EQ(0U, client_->numActiveRequests()); } + ~CodecClientTest() override { EXPECT_EQ(0U, client_->numActiveRequests()); } Event::MockDispatcher dispatcher_; Network::MockClientConnection* connection_; diff --git a/test/common/http/common.h b/test/common/http/common.h index e2c4d4a5e12c..9aa57ef87c8e 100644 --- a/test/common/http/common.h +++ b/test/common/http/common.h @@ -24,7 +24,7 @@ class CodecClientForTest : public Http::CodecClient { destroy_cb_(destroy_cb) { codec_.reset(codec); } - ~CodecClientForTest() { + ~CodecClientForTest() override { if (destroy_cb_) { destroy_cb_(this); } diff --git a/test/common/http/conn_manager_impl_test.cc b/test/common/http/conn_manager_impl_test.cc index 31865f3f7287..7f2abde9ba58 100644 --- a/test/common/http/conn_manager_impl_test.cc +++ b/test/common/http/conn_manager_impl_test.cc @@ -89,7 +89,7 @@ class HttpConnectionManagerImplTest : public testing::Test, public ConnectionMan EXPECT_CALL(response_encoder_, getStream()).Times(AtLeast(0)); } - ~HttpConnectionManagerImplTest() { + ~HttpConnectionManagerImplTest() override { filter_callbacks_.connection_.dispatcher_.clearDeferredDeleteList(); } diff --git a/test/common/http/http1/conn_pool_test.cc b/test/common/http/http1/conn_pool_test.cc index 002aecc3ce52..df25c3ee3bf5 100644 --- a/test/common/http/http1/conn_pool_test.cc +++ b/test/common/http/http1/conn_pool_test.cc @@ -50,7 +50,7 @@ class ConnPoolImplForTest : public ConnPoolImpl { api_(Api::createApiForTest()), mock_dispatcher_(dispatcher), mock_upstream_ready_timer_(upstream_ready_timer) {} - ~ConnPoolImplForTest() { + ~ConnPoolImplForTest() override { EXPECT_EQ(0U, ready_clients_.size()); EXPECT_EQ(0U, busy_clients_.size()); EXPECT_EQ(0U, pending_requests_.size()); @@ -128,7 +128,7 @@ class Http1ConnPoolImplTest : public testing::Test { : upstream_ready_timer_(new NiceMock(&dispatcher_)), conn_pool_(dispatcher_, cluster_, upstream_ready_timer_) {} - ~Http1ConnPoolImplTest() { + ~Http1ConnPoolImplTest() override { EXPECT_TRUE(TestUtility::gaugesZeroed(cluster_->stats_store_.gauges())); } diff --git a/test/common/http/http2/conn_pool_test.cc b/test/common/http/http2/conn_pool_test.cc index b63d04c9afa5..9a17581301c7 100644 --- a/test/common/http/http2/conn_pool_test.cc +++ b/test/common/http/http2/conn_pool_test.cc @@ -67,7 +67,7 @@ class Http2ConnPoolImplTest : public testing::Test { : api_(Api::createApiForTest(stats_store_)), pool_(dispatcher_, host_, Upstream::ResourcePriority::Default, nullptr) {} - ~Http2ConnPoolImplTest() { + ~Http2ConnPoolImplTest() override { EXPECT_TRUE(TestUtility::gaugesZeroed(cluster_->stats_store_.gauges())); } diff --git a/test/common/network/connection_impl_test.cc b/test/common/network/connection_impl_test.cc index dd7f751d55ed..0526b0ec97dc 100644 --- a/test/common/network/connection_impl_test.cc +++ b/test/common/network/connection_impl_test.cc @@ -1336,21 +1336,23 @@ TEST_P(ConnectionImplTest, DelayedCloseTimeoutNullStats) { class FakeReadFilter : public Network::ReadFilter { public: FakeReadFilter() = default; - ~FakeReadFilter() { + ~FakeReadFilter() override { EXPECT_TRUE(callbacks_ != nullptr); // The purpose is to verify that when FilterManger is destructed, ConnectionSocketImpl is not // destructed, and ConnectionSocketImpl can still be accessed via ReadFilterCallbacks. EXPECT_TRUE(callbacks_->connection().state() != Network::Connection::State::Open); } - Network::FilterStatus onData(Buffer::Instance& data, bool) { + Network::FilterStatus onData(Buffer::Instance& data, bool) override { data.drain(data.length()); return Network::FilterStatus::Continue; } - Network::FilterStatus onNewConnection() { return Network::FilterStatus::Continue; } + Network::FilterStatus onNewConnection() override { return Network::FilterStatus::Continue; } - void initializeReadFilterCallbacks(ReadFilterCallbacks& callbacks) { callbacks_ = &callbacks; } + void initializeReadFilterCallbacks(ReadFilterCallbacks& callbacks) override { + callbacks_ = &callbacks; + } private: ReadFilterCallbacks* callbacks_{nullptr}; @@ -1380,7 +1382,7 @@ class MockTransportConnectionImplTest : public testing::Test { connection_->addConnectionCallbacks(callbacks_); } - ~MockTransportConnectionImplTest() { connection_->close(ConnectionCloseType::NoFlush); } + ~MockTransportConnectionImplTest() override { connection_->close(ConnectionCloseType::NoFlush); } // This may be invoked for doWrite() on the transport to simulate all the data // being written. diff --git a/test/common/network/filter_manager_impl_test.cc b/test/common/network/filter_manager_impl_test.cc index cccbac597e73..f713a79a63e3 100644 --- a/test/common/network/filter_manager_impl_test.cc +++ b/test/common/network/filter_manager_impl_test.cc @@ -56,7 +56,7 @@ class NetworkFilterManagerTest : public testing::Test { class LocalMockFilter : public MockFilter { public: - ~LocalMockFilter() { + ~LocalMockFilter() override { // Make sure the upstream host is still valid in the filter destructor. callbacks_->upstreamHost()->address(); } diff --git a/test/common/router/config_impl_test.cc b/test/common/router/config_impl_test.cc index 755ef68d98d9..5af81cbc1ff9 100644 --- a/test/common/router/config_impl_test.cc +++ b/test/common/router/config_impl_test.cc @@ -3521,10 +3521,10 @@ struct Baz : public Envoy::Config::TypedMetadata::Object { }; class BazFactory : public HttpRouteTypedMetadataFactory { public: - const std::string name() const { return "baz"; } + const std::string name() const override { return "baz"; } // Returns nullptr (conversion failure) if d is empty. std::unique_ptr - parse(const ProtobufWkt::Struct& d) const { + parse(const ProtobufWkt::Struct& d) const override { if (d.fields().find("name") != d.fields().end()) { return std::make_unique(d.fields().at("name").string_value()); } diff --git a/test/common/router/rds_impl_test.cc b/test/common/router/rds_impl_test.cc index daa93436b370..303589eb9750 100644 --- a/test/common/router/rds_impl_test.cc +++ b/test/common/router/rds_impl_test.cc @@ -75,7 +75,7 @@ class RdsImplTest : public RdsTestBase { route_config_provider_manager_ = std::make_unique(factory_context_.admin_); } - ~RdsImplTest() { factory_context_.thread_local_.shutdownThread(); } + ~RdsImplTest() override { factory_context_.thread_local_.shutdownThread(); } void setup() { const std::string config_json = R"EOF( @@ -276,7 +276,9 @@ class RouteConfigProviderManagerImplTest : public RdsTestBase { std::make_unique(factory_context_.admin_); } - ~RouteConfigProviderManagerImplTest() { factory_context_.thread_local_.shutdownThread(); } + ~RouteConfigProviderManagerImplTest() override { + factory_context_.thread_local_.shutdownThread(); + } envoy::config::filter::network::http_connection_manager::v2::Rds rds_; std::unique_ptr route_config_provider_manager_; diff --git a/test/common/secret/sds_api_test.cc b/test/common/secret/sds_api_test.cc index ae59bf16a54c..5db20fa89e3b 100644 --- a/test/common/secret/sds_api_test.cc +++ b/test/common/secret/sds_api_test.cc @@ -241,7 +241,7 @@ class CvcValidationCallback { class MockCvcValidationCallback : public CvcValidationCallback { public: MockCvcValidationCallback() = default; - ~MockCvcValidationCallback() = default; + ~MockCvcValidationCallback() override = default; MOCK_METHOD1(validateCvc, void(const envoy::api::v2::auth::CertificateValidationContext&)); }; diff --git a/test/common/signal/signals_test.cc b/test/common/signal/signals_test.cc index 0dda4fe752c8..98753f047d0f 100644 --- a/test/common/signal/signals_test.cc +++ b/test/common/signal/signals_test.cc @@ -36,7 +36,7 @@ TEST(SignalsDeathTest, InvalidAddressDeathTest) { } class TestFatalErrorHandler : public FatalErrorHandlerInterface { - virtual void onFatalError() const override { std::cerr << "HERE!"; } + void onFatalError() const override { std::cerr << "HERE!"; } }; TEST(SignalsDeathTest, RegisteredHandlerTest) { diff --git a/test/common/singleton/manager_impl_test.cc b/test/common/singleton/manager_impl_test.cc index 14b3d9eacad2..95b3b768a151 100644 --- a/test/common/singleton/manager_impl_test.cc +++ b/test/common/singleton/manager_impl_test.cc @@ -29,7 +29,7 @@ static Registry::RegisterFactory on_destructor) : id_(id), on_destructor_(on_destructor) {} - ~TestConnectionState() { on_destructor_(); } + ~TestConnectionState() override { on_destructor_(); } int id_; std::function on_destructor_; @@ -79,7 +79,7 @@ class ConnPoolImplForTest : public ConnPoolImpl { Upstream::ResourcePriority::Default, nullptr, nullptr), mock_dispatcher_(dispatcher), mock_upstream_ready_timer_(upstream_ready_timer) {} - ~ConnPoolImplForTest() { + ~ConnPoolImplForTest() override { EXPECT_EQ(0U, ready_conns_.size()); EXPECT_EQ(0U, busy_conns_.size()); EXPECT_EQ(0U, pending_requests_.size()); @@ -158,7 +158,7 @@ class TcpConnPoolImplTest : public testing::Test { : upstream_ready_timer_(new NiceMock(&dispatcher_)), conn_pool_(dispatcher_, cluster_, upstream_ready_timer_) {} - ~TcpConnPoolImplTest() { + ~TcpConnPoolImplTest() override { EXPECT_TRUE(TestUtility::gaugesZeroed(cluster_->stats_store_.gauges())); } @@ -180,7 +180,7 @@ class TcpConnPoolImplDestructorTest : public testing::Test { Upstream::makeTestHost(cluster_, "tcp://127.0.0.1:9000"), Upstream::ResourcePriority::Default, nullptr, nullptr)} {} - ~TcpConnPoolImplDestructorTest() = default; + ~TcpConnPoolImplDestructorTest() override = default; void prepareConn() { connection_ = new NiceMock(); diff --git a/test/common/tcp_proxy/tcp_proxy_test.cc b/test/common/tcp_proxy/tcp_proxy_test.cc index ec747aa3dca3..dbfb840d619c 100644 --- a/test/common/tcp_proxy/tcp_proxy_test.cc +++ b/test/common/tcp_proxy/tcp_proxy_test.cc @@ -357,7 +357,7 @@ class TcpProxyTest : public testing::Test { .WillByDefault(SaveArg<0>(&access_log_data_)); } - ~TcpProxyTest() { + ~TcpProxyTest() override { if (filter_ != nullptr) { filter_callbacks_.connection_.raiseEvent(Network::ConnectionEvent::RemoteClose); } diff --git a/test/common/thread_local/thread_local_impl_test.cc b/test/common/thread_local/thread_local_impl_test.cc index 49ba114a2daf..5a678c839384 100644 --- a/test/common/thread_local/thread_local_impl_test.cc +++ b/test/common/thread_local/thread_local_impl_test.cc @@ -18,7 +18,7 @@ namespace { class TestThreadLocalObject : public ThreadLocalObject { public: - ~TestThreadLocalObject() { onDestroy(); } + ~TestThreadLocalObject() override { onDestroy(); } MOCK_METHOD0(onDestroy, void()); }; diff --git a/test/common/upstream/cluster_manager_impl_test.cc b/test/common/upstream/cluster_manager_impl_test.cc index e9aa3293d89a..039490906a11 100644 --- a/test/common/upstream/cluster_manager_impl_test.cc +++ b/test/common/upstream/cluster_manager_impl_test.cc @@ -2130,14 +2130,14 @@ TEST_F(ClusterManagerImplTest, DynamicHostRemoveDefaultPriority) { class MockConnPoolWithDestroy : public Http::ConnectionPool::MockInstance { public: - ~MockConnPoolWithDestroy() { onDestroy(); } + ~MockConnPoolWithDestroy() override { onDestroy(); } MOCK_METHOD0(onDestroy, void()); }; class MockTcpConnPoolWithDestroy : public Tcp::ConnectionPool::MockInstance { public: - ~MockTcpConnPoolWithDestroy() { onDestroy(); } + ~MockTcpConnPoolWithDestroy() override { onDestroy(); } MOCK_METHOD0(onDestroy, void()); }; diff --git a/test/common/upstream/upstream_impl_test.cc b/test/common/upstream/upstream_impl_test.cc index b0b8094c55b2..688e53b06e7b 100644 --- a/test/common/upstream/upstream_impl_test.cc +++ b/test/common/upstream/upstream_impl_test.cc @@ -1872,10 +1872,10 @@ struct Baz : public Envoy::Config::TypedMetadata::Object { class BazFactory : public ClusterTypedMetadataFactory { public: - const std::string name() const { return "baz"; } + const std::string name() const override { return "baz"; } // Returns nullptr (conversion failure) if d is empty. std::unique_ptr - parse(const ProtobufWkt::Struct& d) const { + parse(const ProtobufWkt::Struct& d) const override { if (d.fields().find("name") != d.fields().end()) { return std::make_unique(d.fields().at("name").string_value()); } diff --git a/test/exe/main_common_test.cc b/test/exe/main_common_test.cc index baeeb243976a..1d412d13a6e1 100644 --- a/test/exe/main_common_test.cc +++ b/test/exe/main_common_test.cc @@ -210,7 +210,7 @@ class AdminRequestTest : public MainCommonTest { main_common_->dispatcherForTest().post([this, &done] { struct Sacrifice : Event::DeferredDeletable { Sacrifice(absl::Notification& notify) : notify_(notify) {} - ~Sacrifice() { notify_.Notify(); } + ~Sacrifice() override { notify_.Notify(); } absl::Notification& notify_; }; auto sacrifice = std::make_unique(done); diff --git a/test/extensions/clusters/redis/mocks.h b/test/extensions/clusters/redis/mocks.h index 3f4940836f91..7269548b1b2c 100644 --- a/test/extensions/clusters/redis/mocks.h +++ b/test/extensions/clusters/redis/mocks.h @@ -15,7 +15,7 @@ namespace Redis { class MockClusterSlotUpdateCallBack : public ClusterSlotUpdateCallBack { public: MockClusterSlotUpdateCallBack(); - ~MockClusterSlotUpdateCallBack() = default; + ~MockClusterSlotUpdateCallBack() override = default; MOCK_METHOD2(onClusterSlotUpdate, bool(const std::vector&, Upstream::HostMap)); }; diff --git a/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc b/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc index 3fe6ddad32d3..36ebfec8391c 100644 --- a/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc +++ b/test/extensions/common/dynamic_forward_proxy/dns_cache_impl_test.cc @@ -28,7 +28,7 @@ class DnsCacheImplTest : public testing::Test, public Event::TestUsingSimulatedT update_callbacks_handle_ = dns_cache_->addUpdateCallbacks(update_callbacks_); } - ~DnsCacheImplTest() { + ~DnsCacheImplTest() override { dns_cache_.reset(); EXPECT_EQ(0, TestUtility::findGauge(store_, "dns_cache.foo.num_hosts")->value()); } diff --git a/test/extensions/common/dynamic_forward_proxy/mocks.h b/test/extensions/common/dynamic_forward_proxy/mocks.h index 0c65895c1f7d..0ac9e476deac 100644 --- a/test/extensions/common/dynamic_forward_proxy/mocks.h +++ b/test/extensions/common/dynamic_forward_proxy/mocks.h @@ -12,7 +12,7 @@ namespace DynamicForwardProxy { class MockDnsCache : public DnsCache { public: MockDnsCache(); - ~MockDnsCache(); + ~MockDnsCache() override; struct MockLoadDnsCacheEntryResult { LoadDnsCacheEntryStatus status_; @@ -38,7 +38,7 @@ class MockDnsCache : public DnsCache { class MockLoadDnsCacheEntryHandle : public DnsCache::LoadDnsCacheEntryHandle { public: MockLoadDnsCacheEntryHandle(); - ~MockLoadDnsCacheEntryHandle(); + ~MockLoadDnsCacheEntryHandle() override; MOCK_METHOD0(onDestroy, void()); }; @@ -46,7 +46,7 @@ class MockLoadDnsCacheEntryHandle : public DnsCache::LoadDnsCacheEntryHandle { class MockDnsCacheManager : public DnsCacheManager { public: MockDnsCacheManager(); - ~MockDnsCacheManager(); + ~MockDnsCacheManager() override; MOCK_METHOD1( getCache, @@ -59,7 +59,7 @@ class MockDnsCacheManager : public DnsCacheManager { class MockDnsHostInfo : public DnsHostInfo { public: MockDnsHostInfo(); - ~MockDnsHostInfo(); + ~MockDnsHostInfo() override; MOCK_METHOD0(address, Network::Address::InstanceConstSharedPtr()); MOCK_METHOD0(resolvedHost, const std::string&()); @@ -72,7 +72,7 @@ class MockDnsHostInfo : public DnsHostInfo { class MockUpdateCallbacks : public DnsCache::UpdateCallbacks { public: MockUpdateCallbacks(); - ~MockUpdateCallbacks(); + ~MockUpdateCallbacks() override; MOCK_METHOD2(onDnsHostAddOrUpdate, void(const std::string& host, const DnsHostInfoSharedPtr& address)); @@ -82,7 +82,7 @@ class MockUpdateCallbacks : public DnsCache::UpdateCallbacks { class MockLoadDnsCacheEntryCallbacks : public DnsCache::LoadDnsCacheEntryCallbacks { public: MockLoadDnsCacheEntryCallbacks(); - ~MockLoadDnsCacheEntryCallbacks(); + ~MockLoadDnsCacheEntryCallbacks() override; MOCK_METHOD0(onLoadDnsCacheComplete, void()); }; diff --git a/test/extensions/common/tap/admin_test.cc b/test/extensions/common/tap/admin_test.cc index 8af525043213..4c7428a62820 100644 --- a/test/extensions/common/tap/admin_test.cc +++ b/test/extensions/common/tap/admin_test.cc @@ -30,7 +30,9 @@ class AdminHandlerTest : public testing::Test { handler_ = std::make_unique(admin_, main_thread_dispatcher_); } - ~AdminHandlerTest() { EXPECT_CALL(admin_, removeHandler("/tap")).WillOnce(Return(true)); } + ~AdminHandlerTest() override { + EXPECT_CALL(admin_, removeHandler("/tap")).WillOnce(Return(true)); + } Server::MockAdmin admin_; Event::MockDispatcher main_thread_dispatcher_; diff --git a/test/extensions/common/tap/common.h b/test/extensions/common/tap/common.h index b98ed66f60b6..dda23a913472 100644 --- a/test/extensions/common/tap/common.h +++ b/test/extensions/common/tap/common.h @@ -37,7 +37,7 @@ namespace Tap { class MockPerTapSinkHandleManager : public PerTapSinkHandleManager { public: MockPerTapSinkHandleManager(); - ~MockPerTapSinkHandleManager(); + ~MockPerTapSinkHandleManager() override; void submitTrace(TraceWrapperPtr&& trace) override { submitTrace_(*trace); } @@ -47,7 +47,7 @@ class MockPerTapSinkHandleManager : public PerTapSinkHandleManager { class MockMatcher : public Matcher { public: using Matcher::Matcher; - ~MockMatcher(); + ~MockMatcher() override; MOCK_CONST_METHOD1(onNewStream, void(MatchStatusVector& statuses)); MOCK_CONST_METHOD2(onHttpRequestHeaders, diff --git a/test/extensions/filters/common/ext_authz/mocks.h b/test/extensions/filters/common/ext_authz/mocks.h index 75ffe3d391c8..8d2dd1a31365 100644 --- a/test/extensions/filters/common/ext_authz/mocks.h +++ b/test/extensions/filters/common/ext_authz/mocks.h @@ -16,7 +16,7 @@ namespace ExtAuthz { class MockClient : public Client { public: MockClient(); - ~MockClient(); + ~MockClient() override; // ExtAuthz::Client MOCK_METHOD0(cancel, void()); @@ -28,7 +28,7 @@ class MockClient : public Client { class MockRequestCallbacks : public RequestCallbacks { public: MockRequestCallbacks(); - ~MockRequestCallbacks(); + ~MockRequestCallbacks() override; void onComplete(ResponsePtr&& response) override { onComplete_(response); } diff --git a/test/extensions/filters/common/lua/lua_test.cc b/test/extensions/filters/common/lua/lua_test.cc index b2996f1b92aa..5c430403793a 100644 --- a/test/extensions/filters/common/lua/lua_test.cc +++ b/test/extensions/filters/common/lua/lua_test.cc @@ -23,7 +23,7 @@ namespace { // not aligned by Envoy. See https://github.com/envoyproxy/envoy/issues/5551 for details. class alignas(32) TestObject : public BaseLuaObject { public: - ~TestObject() { onDestroy(); } + ~TestObject() override { onDestroy(); } static ExportedFunctions exportedFunctions() { return {{"testCall", static_luaTestCall}}; } diff --git a/test/extensions/filters/common/lua/wrappers_test.cc b/test/extensions/filters/common/lua/wrappers_test.cc index 46428f22aec7..926db9ce3d5e 100644 --- a/test/extensions/filters/common/lua/wrappers_test.cc +++ b/test/extensions/filters/common/lua/wrappers_test.cc @@ -18,7 +18,7 @@ class LuaBufferWrapperTest : public LuaWrappersTestBase {}; class LuaMetadataMapWrapperTest : public LuaWrappersTestBase { public: - virtual void setup(const std::string& script) { + void setup(const std::string& script) override { LuaWrappersTestBase::setup(script); state_->registerType(); } @@ -32,7 +32,7 @@ class LuaMetadataMapWrapperTest : public LuaWrappersTestBase class LuaConnectionWrapperTest : public LuaWrappersTestBase { public: - virtual void setup(const std::string& script) { + void setup(const std::string& script) override { LuaWrappersTestBase::setup(script); state_->registerType(); } diff --git a/test/extensions/filters/common/ratelimit/mocks.h b/test/extensions/filters/common/ratelimit/mocks.h index accaa311aa4c..4c84e385eef2 100644 --- a/test/extensions/filters/common/ratelimit/mocks.h +++ b/test/extensions/filters/common/ratelimit/mocks.h @@ -18,7 +18,7 @@ namespace RateLimit { class MockClient : public Client { public: MockClient(); - ~MockClient(); + ~MockClient() override; // RateLimit::Client MOCK_METHOD0(cancel, void()); diff --git a/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc b/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc index 85c704dfa2de..97a5863c0bb6 100644 --- a/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc +++ b/test/extensions/filters/common/ratelimit/ratelimit_impl_test.cc @@ -36,7 +36,7 @@ namespace { class MockRequestCallbacks : public RequestCallbacks { public: - void complete(LimitStatus status, Http::HeaderMapPtr&& headers) { + void complete(LimitStatus status, Http::HeaderMapPtr&& headers) override { complete_(status, headers.get()); } diff --git a/test/extensions/filters/http/common/aws/credentials_provider_impl_test.cc b/test/extensions/filters/http/common/aws/credentials_provider_impl_test.cc index d4c22e6215af..b72ea27af87f 100644 --- a/test/extensions/filters/http/common/aws/credentials_provider_impl_test.cc +++ b/test/extensions/filters/http/common/aws/credentials_provider_impl_test.cc @@ -20,7 +20,7 @@ namespace Aws { class EvironmentCredentialsProviderTest : public testing::Test { public: - ~EvironmentCredentialsProviderTest() { + ~EvironmentCredentialsProviderTest() override { TestEnvironment::unsetEnvVar("AWS_ACCESS_KEY_ID"); TestEnvironment::unsetEnvVar("AWS_SECRET_ACCESS_KEY"); TestEnvironment::unsetEnvVar("AWS_SESSION_TOKEN"); @@ -330,7 +330,7 @@ class DefaultCredentialsProviderChainTest : public testing::Test { EXPECT_CALL(factories_, createEnvironmentCredentialsProvider()); } - ~DefaultCredentialsProviderChainTest() { + ~DefaultCredentialsProviderChainTest() override { TestEnvironment::unsetEnvVar("AWS_CONTAINER_CREDENTIALS_RELATIVE_URI"); TestEnvironment::unsetEnvVar("AWS_CONTAINER_CREDENTIALS_FULL_URI"); TestEnvironment::unsetEnvVar("AWS_CONTAINER_AUTHORIZATION_TOKEN"); @@ -349,9 +349,9 @@ class DefaultCredentialsProviderChainTest : public testing::Test { Api::Api&, const MetadataCredentialsProviderBase::MetadataFetcher& fetcher)); - virtual CredentialsProviderSharedPtr createTaskRoleCredentialsProvider( + CredentialsProviderSharedPtr createTaskRoleCredentialsProvider( Api::Api& api, const MetadataCredentialsProviderBase::MetadataFetcher& metadata_fetcher, - const std::string& credential_uri, const std::string& authorization_token) const { + const std::string& credential_uri, const std::string& authorization_token) const override { return createTaskRoleCredentialsProviderMock(api, metadata_fetcher, credential_uri, authorization_token); } diff --git a/test/extensions/filters/http/common/aws/mocks.h b/test/extensions/filters/http/common/aws/mocks.h index 0e4ced802301..df97224efb5e 100644 --- a/test/extensions/filters/http/common/aws/mocks.h +++ b/test/extensions/filters/http/common/aws/mocks.h @@ -14,7 +14,7 @@ namespace Aws { class MockCredentialsProvider : public CredentialsProvider { public: MockCredentialsProvider(); - ~MockCredentialsProvider(); + ~MockCredentialsProvider() override; MOCK_METHOD0(getCredentials, Credentials()); }; @@ -22,7 +22,7 @@ class MockCredentialsProvider : public CredentialsProvider { class MockSigner : public Signer { public: MockSigner(); - ~MockSigner(); + ~MockSigner() override; MOCK_METHOD2(sign, void(Http::Message&, bool)); }; diff --git a/test/extensions/filters/http/common/aws/region_provider_impl_test.cc b/test/extensions/filters/http/common/aws/region_provider_impl_test.cc index 42ce4d907bef..7cb14439a521 100644 --- a/test/extensions/filters/http/common/aws/region_provider_impl_test.cc +++ b/test/extensions/filters/http/common/aws/region_provider_impl_test.cc @@ -12,7 +12,7 @@ namespace Aws { class EnvironmentRegionProviderTest : public testing::Test { public: - virtual ~EnvironmentRegionProviderTest() { TestEnvironment::unsetEnvVar("AWS_REGION"); } + ~EnvironmentRegionProviderTest() override { TestEnvironment::unsetEnvVar("AWS_REGION"); } EnvironmentRegionProvider provider_; }; diff --git a/test/extensions/filters/http/common/mock.h b/test/extensions/filters/http/common/mock.h index 2e16a0c2774f..a60fc266aa06 100644 --- a/test/extensions/filters/http/common/mock.h +++ b/test/extensions/filters/http/common/mock.h @@ -46,7 +46,7 @@ class MockJwksReceiver : public JwksFetcher::JwksReceiver { * Expectations and assertions should be made on onJwksSuccessImpl in place * of onJwksSuccess. */ - void onJwksSuccess(google::jwt_verify::JwksPtr&& jwks) { + void onJwksSuccess(google::jwt_verify::JwksPtr&& jwks) override { ASSERT(jwks); onJwksSuccessImpl(*jwks.get()); } diff --git a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc index 4718dee34720..b741cbc592f3 100644 --- a/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc +++ b/test/extensions/filters/http/dynamic_forward_proxy/proxy_filter_test.cc @@ -40,7 +40,7 @@ class ProxyFilterTest : public testing::Test, cm_.thread_local_cluster_.cluster_.info_->resetResourceManager(0, 1, 0, 0, 0); } - ~ProxyFilterTest() { + ~ProxyFilterTest() override { EXPECT_TRUE( cm_.thread_local_cluster_.cluster_.info_->resource_manager_->pendingRequests().canCreate()); } diff --git a/test/extensions/filters/http/dynamo/dynamo_filter_test.cc b/test/extensions/filters/http/dynamo/dynamo_filter_test.cc index f7021a9b05e9..a21e4734963f 100644 --- a/test/extensions/filters/http/dynamo/dynamo_filter_test.cc +++ b/test/extensions/filters/http/dynamo/dynamo_filter_test.cc @@ -41,7 +41,7 @@ class DynamoFilterTest : public testing::Test { filter_->setEncoderFilterCallbacks(encoder_callbacks_); } - ~DynamoFilterTest() { filter_->onDestroy(); } + ~DynamoFilterTest() override { filter_->onDestroy(); } std::unique_ptr filter_; NiceMock loader_; diff --git a/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc b/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc index 437bc9d373b4..40181c29e9b7 100644 --- a/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc +++ b/test/extensions/filters/http/grpc_json_transcoder/json_transcoder_filter_test.cc @@ -740,7 +740,7 @@ class GrpcJsonTranscoderFilterPrintTest filter_->setEncoderFilterCallbacks(encoder_callbacks_); } - ~GrpcJsonTranscoderFilterPrintTest() { + ~GrpcJsonTranscoderFilterPrintTest() override { delete filter_; delete config_; } diff --git a/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc b/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc index 5dfaeaa7cd1b..50679f090c42 100644 --- a/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc +++ b/test/extensions/filters/http/ip_tagging/ip_tagging_filter_test.cc @@ -50,7 +50,7 @@ request_type: internal filter_->setDecoderFilterCallbacks(filter_callbacks_); } - ~IpTaggingFilterTest() { filter_->onDestroy(); } + ~IpTaggingFilterTest() override { filter_->onDestroy(); } IpTaggingFilterConfigSharedPtr config_; std::unique_ptr filter_; diff --git a/test/extensions/filters/http/jwt_authn/filter_integration_test.cc b/test/extensions/filters/http/jwt_authn/filter_integration_test.cc index f65637c7fcfb..7f064293f3e2 100644 --- a/test/extensions/filters/http/jwt_authn/filter_integration_test.cc +++ b/test/extensions/filters/http/jwt_authn/filter_integration_test.cc @@ -47,7 +47,8 @@ class HeaderToFilterStateFilterConfig : public Common::EmptyHttpFilterConfig { HeaderToFilterStateFilterConfig() : Common::EmptyHttpFilterConfig(HeaderToFilterStateFilterName) {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamDecoderFilter( std::make_shared("jwt_selector", "jwt_selector")); diff --git a/test/extensions/filters/http/jwt_authn/mock.h b/test/extensions/filters/http/jwt_authn/mock.h index a97342ae11b4..025351a35dc0 100644 --- a/test/extensions/filters/http/jwt_authn/mock.h +++ b/test/extensions/filters/http/jwt_authn/mock.h @@ -28,7 +28,7 @@ class MockAuthenticator : public Authenticator { SetPayloadCallback set_payload_cb, AuthenticatorCallback callback)); void verify(Http::HeaderMap& headers, std::vector&& tokens, - SetPayloadCallback set_payload_cb, AuthenticatorCallback callback) { + SetPayloadCallback set_payload_cb, AuthenticatorCallback callback) override { doVerify(headers, &tokens, std::move(set_payload_cb), std::move(callback)); } diff --git a/test/extensions/filters/http/lua/lua_filter_test.cc b/test/extensions/filters/http/lua/lua_filter_test.cc index d9be20d3f301..2d444fc6f61a 100644 --- a/test/extensions/filters/http/lua/lua_filter_test.cc +++ b/test/extensions/filters/http/lua/lua_filter_test.cc @@ -66,7 +66,7 @@ class LuaHttpFilterTest : public testing::Test { EXPECT_CALL(encoder_callbacks_, encodingBuffer()).Times(AtLeast(0)); } - ~LuaHttpFilterTest() { filter_->onDestroy(); } + ~LuaHttpFilterTest() override { filter_->onDestroy(); } void setup(const std::string& lua_code) { config_.reset(new FilterConfig(lua_code, tls_, cluster_manager_)); diff --git a/test/extensions/filters/http/rbac/rbac_filter_test.cc b/test/extensions/filters/http/rbac/rbac_filter_test.cc index 62967602dfc6..ecc0b1dcafac 100644 --- a/test/extensions/filters/http/rbac/rbac_filter_test.cc +++ b/test/extensions/filters/http/rbac/rbac_filter_test.cc @@ -47,7 +47,7 @@ class RoleBasedAccessControlFilterTest : public testing::Test { RoleBasedAccessControlFilterTest() : config_(setupConfig()), filter_(config_) {} - void SetUp() { + void SetUp() override { EXPECT_CALL(callbacks_, connection()).WillRepeatedly(Return(&connection_)); EXPECT_CALL(callbacks_, streamInfo()).WillRepeatedly(ReturnRef(req_info_)); filter_.setDecoderFilterCallbacks(callbacks_); diff --git a/test/extensions/filters/listener/http_inspector/http_inspector_test.cc b/test/extensions/filters/listener/http_inspector/http_inspector_test.cc index f1aa3012c7bf..e5cb254902c8 100644 --- a/test/extensions/filters/listener/http_inspector/http_inspector_test.cc +++ b/test/extensions/filters/listener/http_inspector/http_inspector_test.cc @@ -33,7 +33,7 @@ class HttpInspectorTest : public testing::Test { HttpInspectorTest() : cfg_(std::make_shared(store_)), io_handle_(std::make_unique(42)) {} - ~HttpInspectorTest() { io_handle_->close(); } + ~HttpInspectorTest() override { io_handle_->close(); } void init() { filter_ = std::make_unique(cfg_); diff --git a/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc b/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc index 9412e3a0caf6..63cff699cffe 100644 --- a/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc +++ b/test/extensions/filters/listener/tls_inspector/tls_inspector_test.cc @@ -34,7 +34,7 @@ class TlsInspectorTest : public testing::Test { TlsInspectorTest() : cfg_(std::make_shared(store_)), io_handle_(std::make_unique(42)) {} - ~TlsInspectorTest() { io_handle_->close(); } + ~TlsInspectorTest() override { io_handle_->close(); } void init() { filter_ = std::make_unique(cfg_); diff --git a/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc b/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc index 7c5e09642488..5321d370a189 100644 --- a/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc +++ b/test/extensions/filters/network/client_ssl_auth/client_ssl_auth_test.cc @@ -59,7 +59,7 @@ class ClientSslAuthFilterTest : public testing::Test { ClientSslAuthFilterTest() : request_(&cm_.async_client_), interval_timer_(new Event::MockTimer(&dispatcher_)), api_(Api::createApiForTest(stats_store_)) {} - ~ClientSslAuthFilterTest() { tls_.shutdownThread(); } + ~ClientSslAuthFilterTest() override { tls_.shutdownThread(); } void setup() { std::string yaml = R"EOF( diff --git a/test/extensions/filters/network/common/redis/client_impl_test.cc b/test/extensions/filters/network/common/redis/client_impl_test.cc index ecea5c887c22..fd7d9ec9b7e5 100644 --- a/test/extensions/filters/network/common/redis/client_impl_test.cc +++ b/test/extensions/filters/network/common/redis/client_impl_test.cc @@ -43,7 +43,7 @@ class RedisClientImplTest : public testing::Test, public Common::Redis::DecoderF return Common::Redis::DecoderPtr{decoder_}; } - ~RedisClientImplTest() { + ~RedisClientImplTest() override { client_.reset(); EXPECT_TRUE(TestUtility::gaugesZeroed(host_->cluster_.stats_store_.gauges())); diff --git a/test/extensions/filters/network/common/redis/mocks.h b/test/extensions/filters/network/common/redis/mocks.h index 829983abd53d..859ea03cf42b 100644 --- a/test/extensions/filters/network/common/redis/mocks.h +++ b/test/extensions/filters/network/common/redis/mocks.h @@ -27,7 +27,7 @@ void PrintTo(const RespValuePtr& value, std::ostream* os); class MockEncoder : public Common::Redis::Encoder { public: MockEncoder(); - ~MockEncoder(); + ~MockEncoder() override; MOCK_METHOD2(encode, void(const Common::Redis::RespValue& value, Buffer::Instance& out)); @@ -38,7 +38,7 @@ class MockEncoder : public Common::Redis::Encoder { class MockDecoder : public Common::Redis::Decoder { public: MockDecoder(); - ~MockDecoder(); + ~MockDecoder() override; MOCK_METHOD1(decode, void(Buffer::Instance& data)); }; @@ -48,7 +48,7 @@ namespace Client { class MockClient : public Client { public: MockClient(); - ~MockClient(); + ~MockClient() override; void raiseEvent(Network::ConnectionEvent event) { for (Network::ConnectionCallbacks* callbacks : callbacks_) { @@ -80,7 +80,7 @@ class MockClient : public Client { class MockPoolRequest : public PoolRequest { public: MockPoolRequest(); - ~MockPoolRequest(); + ~MockPoolRequest() override; MOCK_METHOD0(cancel, void()); }; @@ -88,7 +88,7 @@ class MockPoolRequest : public PoolRequest { class MockPoolCallbacks : public PoolCallbacks { public: MockPoolCallbacks(); - ~MockPoolCallbacks(); + ~MockPoolCallbacks() override; void onResponse(Common::Redis::RespValuePtr&& value) override { onResponse_(value); } diff --git a/test/extensions/filters/network/dubbo_proxy/conn_manager_test.cc b/test/extensions/filters/network/dubbo_proxy/conn_manager_test.cc index f099e1dae233..a8dc3e35d24c 100644 --- a/test/extensions/filters/network/dubbo_proxy/conn_manager_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/conn_manager_test.cc @@ -89,7 +89,9 @@ class TestConfigImpl : public ConfigImpl { class ConnectionManagerTest : public testing::Test { public: ConnectionManagerTest() : stats_(DubboFilterStats::generateStats("test.", store_)) {} - ~ConnectionManagerTest() { filter_callbacks_.connection_.dispatcher_.clearDeferredDeleteList(); } + ~ConnectionManagerTest() override { + filter_callbacks_.connection_.dispatcher_.clearDeferredDeleteList(); + } TimeSource& timeSystem() { return factory_context_.dispatcher().timeSource(); } diff --git a/test/extensions/filters/network/dubbo_proxy/decoder_test.cc b/test/extensions/filters/network/dubbo_proxy/decoder_test.cc index ae9c291011c2..aade1c594766 100644 --- a/test/extensions/filters/network/dubbo_proxy/decoder_test.cc +++ b/test/extensions/filters/network/dubbo_proxy/decoder_test.cc @@ -60,7 +60,7 @@ class DubboDecoderStateMachineTest : public DecoderStateMachineTestBase, public class DubboDecoderTest : public testing::Test { public: DubboDecoderTest() = default; - virtual ~DubboDecoderTest() override = default; + ~DubboDecoderTest() override = default; NiceMock protocol_; NiceMock handler_; diff --git a/test/extensions/filters/network/dubbo_proxy/mocks.h b/test/extensions/filters/network/dubbo_proxy/mocks.h index 884ab0f821ee..02a5176f1485 100644 --- a/test/extensions/filters/network/dubbo_proxy/mocks.h +++ b/test/extensions/filters/network/dubbo_proxy/mocks.h @@ -47,7 +47,7 @@ class MockStreamHandler : public StreamHandler { class MockRequestDecoderCallbacks : public RequestDecoderCallbacks { public: MockRequestDecoderCallbacks(); - ~MockRequestDecoderCallbacks() = default; + ~MockRequestDecoderCallbacks() override = default; MOCK_METHOD0(newStream, StreamHandler&()); MOCK_METHOD1(onHeartbeat, void(MessageMetadataSharedPtr)); @@ -57,7 +57,7 @@ class MockRequestDecoderCallbacks : public RequestDecoderCallbacks { class MockResponseDecoderCallbacks : public ResponseDecoderCallbacks { public: MockResponseDecoderCallbacks(); - ~MockResponseDecoderCallbacks() = default; + ~MockResponseDecoderCallbacks() override = default; MOCK_METHOD0(newStream, StreamHandler&()); MOCK_METHOD1(onHeartbeat, void(MessageMetadataSharedPtr)); @@ -79,7 +79,7 @@ class MockActiveStream : public ActiveStream { class MockDecoderStateMachineDelegate : public DecoderStateMachine::Delegate { public: MockDecoderStateMachineDelegate() = default; - ~MockDecoderStateMachineDelegate() = default; + ~MockDecoderStateMachineDelegate() override = default; MOCK_METHOD2(newStream, ActiveStream*(MessageMetadataSharedPtr, ContextSharedPtr)); MOCK_METHOD1(onHeartbeat, void(MessageMetadataSharedPtr)); @@ -88,7 +88,7 @@ class MockDecoderStateMachineDelegate : public DecoderStateMachine::Delegate { class MockSerializer : public Serializer { public: MockSerializer(); - ~MockSerializer(); + ~MockSerializer() override; // DubboProxy::Serializer MOCK_CONST_METHOD0(name, const std::string&()); @@ -106,7 +106,7 @@ class MockSerializer : public Serializer { class MockProtocol : public Protocol { public: MockProtocol(); - ~MockProtocol(); + ~MockProtocol() override; MOCK_CONST_METHOD0(name, const std::string&()); MOCK_CONST_METHOD0(type, ProtocolType()); @@ -157,7 +157,7 @@ namespace DubboFilters { class MockFilterChainFactoryCallbacks : public FilterChainFactoryCallbacks { public: MockFilterChainFactoryCallbacks(); - ~MockFilterChainFactoryCallbacks(); + ~MockFilterChainFactoryCallbacks() override; MOCK_METHOD1(addDecoderFilter, void(DecoderFilterSharedPtr)); MOCK_METHOD1(addEncoderFilter, void(EncoderFilterSharedPtr)); @@ -167,7 +167,7 @@ class MockFilterChainFactoryCallbacks : public FilterChainFactoryCallbacks { class MockDecoderFilter : public DecoderFilter { public: MockDecoderFilter(); - ~MockDecoderFilter(); + ~MockDecoderFilter() override; // DubboProxy::DubboFilters::DecoderFilter MOCK_METHOD0(onDestroy, void()); @@ -178,7 +178,7 @@ class MockDecoderFilter : public DecoderFilter { class MockDecoderFilterCallbacks : public DecoderFilterCallbacks { public: MockDecoderFilterCallbacks(); - ~MockDecoderFilterCallbacks(); + ~MockDecoderFilterCallbacks() override; // DubboProxy::DubboFilters::DecoderFilterCallbacks MOCK_CONST_METHOD0(requestId, uint64_t()); @@ -206,7 +206,7 @@ class MockDecoderFilterCallbacks : public DecoderFilterCallbacks { class MockEncoderFilter : public EncoderFilter { public: MockEncoderFilter(); - ~MockEncoderFilter(); + ~MockEncoderFilter() override; // DubboProxy::DubboFilters::EncoderFilter MOCK_METHOD0(onDestroy, void()); @@ -217,7 +217,7 @@ class MockEncoderFilter : public EncoderFilter { class MockEncoderFilterCallbacks : public EncoderFilterCallbacks { public: MockEncoderFilterCallbacks(); - ~MockEncoderFilterCallbacks(); + ~MockEncoderFilterCallbacks() override; // DubboProxy::DubboFilters::MockEncoderFilterCallbacks MOCK_CONST_METHOD0(requestId, uint64_t()); @@ -242,7 +242,7 @@ class MockEncoderFilterCallbacks : public EncoderFilterCallbacks { class MockCodecFilter : public CodecFilter { public: MockCodecFilter(); - ~MockCodecFilter(); + ~MockCodecFilter() override; MOCK_METHOD0(onDestroy, void()); MOCK_METHOD1(setEncoderFilterCallbacks, void(EncoderFilterCallbacks& callbacks)); @@ -254,7 +254,7 @@ class MockCodecFilter : public CodecFilter { class MockDirectResponse : public DirectResponse { public: MockDirectResponse() = default; - ~MockDirectResponse() = default; + ~MockDirectResponse() override = default; MOCK_CONST_METHOD3(encode, DirectResponse::ResponseType(MessageMetadata&, Protocol&, Buffer::Instance&)); @@ -291,7 +291,7 @@ template class MockFactoryBase : public NamedDubboFilterConf class MockFilterConfigFactory : public MockFactoryBase { public: MockFilterConfigFactory(); - ~MockFilterConfigFactory(); + ~MockFilterConfigFactory() override; DubboFilters::FilterFactoryCb createFilterFactoryFromProtoTyped(const ProtobufWkt::Struct& proto_config, @@ -310,7 +310,7 @@ namespace Router { class MockRouteEntry : public RouteEntry { public: MockRouteEntry(); - ~MockRouteEntry(); + ~MockRouteEntry() override; // DubboProxy::Router::RouteEntry MOCK_CONST_METHOD0(clusterName, const std::string&()); @@ -322,7 +322,7 @@ class MockRouteEntry : public RouteEntry { class MockRoute : public Route { public: MockRoute(); - ~MockRoute(); + ~MockRoute() override; // DubboProxy::Router::Route MOCK_CONST_METHOD0(routeEntry, const RouteEntry*()); diff --git a/test/extensions/filters/network/ext_authz/ext_authz_test.cc b/test/extensions/filters/network/ext_authz/ext_authz_test.cc index 1e4d08186dce..8a344ed162f5 100644 --- a/test/extensions/filters/network/ext_authz/ext_authz_test.cc +++ b/test/extensions/filters/network/ext_authz/ext_authz_test.cc @@ -69,7 +69,7 @@ class ExtAuthzFilterTest : public testing::Test { return response; } - ~ExtAuthzFilterTest() { + ~ExtAuthzFilterTest() override { for (const Stats::GaugeSharedPtr& gauge : stats_store_.gauges()) { EXPECT_EQ(0U, gauge->value()); } diff --git a/test/extensions/filters/network/kafka/serialization_utilities.h b/test/extensions/filters/network/kafka/serialization_utilities.h index caadecb8b69d..8417afb6e61e 100644 --- a/test/extensions/filters/network/kafka/serialization_utilities.h +++ b/test/extensions/filters/network/kafka/serialization_utilities.h @@ -120,16 +120,14 @@ template class CapturingCall /** * Stores the message. */ - virtual void onMessage(Message message) override { captured_messages_.push_back(message); } + void onMessage(Message message) override { captured_messages_.push_back(message); } /** * Returns the stored messages. */ const std::vector& getCapturedMessages() const { return captured_messages_; } - virtual void onFailedParse(Failure failure_data) override { - parse_failures_.push_back(failure_data); - } + void onFailedParse(Failure failure_data) override { parse_failures_.push_back(failure_data); } const std::vector& getParseFailures() const { return parse_failures_; } diff --git a/test/extensions/filters/network/ratelimit/ratelimit_test.cc b/test/extensions/filters/network/ratelimit/ratelimit_test.cc index 1ff47f4dbe6c..0b639e1275d2 100644 --- a/test/extensions/filters/network/ratelimit/ratelimit_test.cc +++ b/test/extensions/filters/network/ratelimit/ratelimit_test.cc @@ -50,7 +50,7 @@ class RateLimitFilterTest : public testing::Test { filter_->onBelowWriteBufferLowWatermark(); } - ~RateLimitFilterTest() { + ~RateLimitFilterTest() override { for (const Stats::GaugeSharedPtr& gauge : stats_store_.gauges()) { EXPECT_EQ(0U, gauge->value()); } diff --git a/test/extensions/filters/network/redis_proxy/command_lookup_speed_test.cc b/test/extensions/filters/network/redis_proxy/command_lookup_speed_test.cc index b4be8f79419f..173e5efc8c2a 100644 --- a/test/extensions/filters/network/redis_proxy/command_lookup_speed_test.cc +++ b/test/extensions/filters/network/redis_proxy/command_lookup_speed_test.cc @@ -24,7 +24,7 @@ namespace RedisProxy { class NoOpSplitCallbacks : public CommandSplitter::SplitCallbacks { public: NoOpSplitCallbacks() = default; - ~NoOpSplitCallbacks() = default; + ~NoOpSplitCallbacks() override = default; bool connectionAllowed() override { return true; } void onAuth(const std::string&) override {} diff --git a/test/extensions/filters/network/redis_proxy/mocks.h b/test/extensions/filters/network/redis_proxy/mocks.h index cafd3f31966d..7a169df1f767 100644 --- a/test/extensions/filters/network/redis_proxy/mocks.h +++ b/test/extensions/filters/network/redis_proxy/mocks.h @@ -22,7 +22,7 @@ namespace RedisProxy { class MockRouter : public Router { public: MockRouter(); - ~MockRouter(); + ~MockRouter() override; MOCK_METHOD1(upstreamPool, RouteSharedPtr(std::string& key)); }; @@ -30,7 +30,7 @@ class MockRouter : public Router { class MockRoute : public Route { public: MockRoute(ConnPool::InstanceSharedPtr); - ~MockRoute(); + ~MockRoute() override; MOCK_CONST_METHOD0(upstream, ConnPool::InstanceSharedPtr()); MOCK_CONST_METHOD0(mirrorPolicies, const MirrorPolicies&()); @@ -45,7 +45,7 @@ namespace ConnPool { class MockInstance : public Instance { public: MockInstance(); - ~MockInstance(); + ~MockInstance() override; MOCK_METHOD3(makeRequest, Common::Redis::Client::PoolRequest*( @@ -64,7 +64,7 @@ namespace CommandSplitter { class MockSplitRequest : public SplitRequest { public: MockSplitRequest(); - ~MockSplitRequest(); + ~MockSplitRequest() override; MOCK_METHOD0(cancel, void()); }; @@ -72,7 +72,7 @@ class MockSplitRequest : public SplitRequest { class MockSplitCallbacks : public SplitCallbacks { public: MockSplitCallbacks(); - ~MockSplitCallbacks(); + ~MockSplitCallbacks() override; MOCK_METHOD0(connectionAllowed, bool()); MOCK_METHOD1(onAuth, void(const std::string& password)); @@ -85,7 +85,7 @@ class MockSplitCallbacks : public SplitCallbacks { class MockInstance : public Instance { public: MockInstance(); - ~MockInstance(); + ~MockInstance() override; SplitRequestPtr makeRequest(Common::Redis::RespValuePtr&& request, SplitCallbacks& callbacks) override { diff --git a/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc b/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc index c29cf0a02220..791a2f9f4d59 100644 --- a/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc +++ b/test/extensions/filters/network/thrift_proxy/header_transport_impl_test.cc @@ -25,7 +25,7 @@ namespace { class MockBuffer : public Envoy::MockBuffer { public: MockBuffer() = default; - ~MockBuffer() = default; + ~MockBuffer() override = default; MOCK_CONST_METHOD0(length, uint64_t()); }; diff --git a/test/extensions/filters/network/thrift_proxy/mocks.h b/test/extensions/filters/network/thrift_proxy/mocks.h index 1d4f8631eba1..542cbca2f170 100644 --- a/test/extensions/filters/network/thrift_proxy/mocks.h +++ b/test/extensions/filters/network/thrift_proxy/mocks.h @@ -28,7 +28,7 @@ namespace ThriftProxy { class MockConfig : public Config { public: MockConfig(); - ~MockConfig(); + ~MockConfig() override; // ThriftProxy::Config MOCK_METHOD0(filterFactory, ThriftFilters::FilterChainFactory&()); @@ -40,7 +40,7 @@ class MockConfig : public Config { class MockTransport : public Transport { public: MockTransport(); - ~MockTransport(); + ~MockTransport() override; // ThriftProxy::Transport MOCK_CONST_METHOD0(name, const std::string&()); @@ -56,7 +56,7 @@ class MockTransport : public Transport { class MockProtocol : public Protocol { public: MockProtocol(); - ~MockProtocol(); + ~MockProtocol() override; // ThriftProxy::Protocol MOCK_CONST_METHOD0(name, const std::string&()); @@ -121,7 +121,7 @@ class MockProtocol : public Protocol { class MockDecoderCallbacks : public DecoderCallbacks { public: MockDecoderCallbacks(); - ~MockDecoderCallbacks(); + ~MockDecoderCallbacks() override; // ThriftProxy::DecoderCallbacks MOCK_METHOD0(newDecoderEventHandler, DecoderEventHandler&()); @@ -130,7 +130,7 @@ class MockDecoderCallbacks : public DecoderCallbacks { class MockDecoderEventHandler : public DecoderEventHandler { public: MockDecoderEventHandler(); - ~MockDecoderEventHandler(); + ~MockDecoderEventHandler() override; // ThriftProxy::DecoderEventHandler MOCK_METHOD1(transportBegin, FilterStatus(MessageMetadataSharedPtr metadata)); @@ -160,7 +160,7 @@ class MockDecoderEventHandler : public DecoderEventHandler { class MockDirectResponse : public DirectResponse { public: MockDirectResponse(); - ~MockDirectResponse(); + ~MockDirectResponse() override; // ThriftProxy::DirectResponse MOCK_CONST_METHOD3(encode, @@ -170,7 +170,7 @@ class MockDirectResponse : public DirectResponse { class MockThriftObject : public ThriftObject { public: MockThriftObject(); - ~MockThriftObject(); + ~MockThriftObject() override; MOCK_CONST_METHOD0(fields, ThriftFieldPtrList&()); MOCK_METHOD1(onData, bool(Buffer::Instance&)); @@ -185,7 +185,7 @@ namespace ThriftFilters { class MockFilterChainFactoryCallbacks : public FilterChainFactoryCallbacks { public: MockFilterChainFactoryCallbacks(); - ~MockFilterChainFactoryCallbacks(); + ~MockFilterChainFactoryCallbacks() override; MOCK_METHOD1(addDecoderFilter, void(DecoderFilterSharedPtr)); }; @@ -193,7 +193,7 @@ class MockFilterChainFactoryCallbacks : public FilterChainFactoryCallbacks { class MockDecoderFilter : public DecoderFilter { public: MockDecoderFilter(); - ~MockDecoderFilter(); + ~MockDecoderFilter() override; // ThriftProxy::ThriftFilters::DecoderFilter MOCK_METHOD0(onDestroy, void()); @@ -228,7 +228,7 @@ class MockDecoderFilter : public DecoderFilter { class MockDecoderFilterCallbacks : public DecoderFilterCallbacks { public: MockDecoderFilterCallbacks(); - ~MockDecoderFilterCallbacks(); + ~MockDecoderFilterCallbacks() override; // ThriftProxy::ThriftFilters::DecoderFilterCallbacks MOCK_CONST_METHOD0(streamId, uint64_t()); @@ -252,7 +252,7 @@ class MockDecoderFilterCallbacks : public DecoderFilterCallbacks { class MockFilterConfigFactory : public ThriftFilters::FactoryBase { public: MockFilterConfigFactory(); - ~MockFilterConfigFactory(); + ~MockFilterConfigFactory() override; ThriftFilters::FilterFactoryCb createFilterFactoryFromProtoTyped(const ProtobufWkt::Struct& proto_config, @@ -271,7 +271,7 @@ namespace Router { class MockRateLimitPolicyEntry : public RateLimitPolicyEntry { public: MockRateLimitPolicyEntry(); - ~MockRateLimitPolicyEntry(); + ~MockRateLimitPolicyEntry() override; MOCK_CONST_METHOD0(stage, uint32_t()); MOCK_CONST_METHOD0(disableKey, const std::string&()); @@ -286,7 +286,7 @@ class MockRateLimitPolicyEntry : public RateLimitPolicyEntry { class MockRateLimitPolicy : public RateLimitPolicy { public: MockRateLimitPolicy(); - ~MockRateLimitPolicy(); + ~MockRateLimitPolicy() override; MOCK_CONST_METHOD0(empty, bool()); MOCK_CONST_METHOD1( @@ -299,7 +299,7 @@ class MockRateLimitPolicy : public RateLimitPolicy { class MockRouteEntry : public RouteEntry { public: MockRouteEntry(); - ~MockRouteEntry(); + ~MockRouteEntry() override; // ThriftProxy::Router::RouteEntry MOCK_CONST_METHOD0(clusterName, const std::string&()); @@ -313,7 +313,7 @@ class MockRouteEntry : public RouteEntry { class MockRoute : public Route { public: MockRoute(); - ~MockRoute(); + ~MockRoute() override; // ThriftProxy::Router::Route MOCK_CONST_METHOD0(routeEntry, const RouteEntry*()); diff --git a/test/extensions/grpc_credentials/file_based_metadata/file_based_metadata_grpc_credentials_test.cc b/test/extensions/grpc_credentials/file_based_metadata/file_based_metadata_grpc_credentials_test.cc index ec1f153c8d4f..d683abfa4974 100644 --- a/test/extensions/grpc_credentials/file_based_metadata/file_based_metadata_grpc_credentials_test.cc +++ b/test/extensions/grpc_credentials/file_based_metadata/file_based_metadata_grpc_credentials_test.cc @@ -30,7 +30,7 @@ class GrpcFileBasedMetadataClientIntegrationTest : public GrpcSslClientIntegrati } } - virtual envoy::api::v2::core::GrpcService createGoogleGrpcConfig() override { + envoy::api::v2::core::GrpcService createGoogleGrpcConfig() override { auto config = GrpcClientIntegrationTest::createGoogleGrpcConfig(); auto* google_grpc = config.mutable_google_grpc(); google_grpc->set_credentials_factory_name(credentials_factory_name_); diff --git a/test/extensions/quic_listeners/quiche/platform/quic_mock_log_impl.h b/test/extensions/quic_listeners/quiche/platform/quic_mock_log_impl.h index b57b9fe48ffc..ea9326cc4eb2 100644 --- a/test/extensions/quic_listeners/quiche/platform/quic_mock_log_impl.h +++ b/test/extensions/quic_listeners/quiche/platform/quic_mock_log_impl.h @@ -21,7 +21,7 @@ class QuicEnvoyMockLog : public QuicLogSink { public: QuicEnvoyMockLog() : is_capturing_(false) {} - virtual ~QuicEnvoyMockLog() { + ~QuicEnvoyMockLog() override { if (is_capturing_) { StopCapturingLogs(); } diff --git a/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc b/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc index 34e406378117..090d948bfa6f 100644 --- a/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc +++ b/test/extensions/quic_listeners/quiche/platform/quic_platform_test.cc @@ -85,7 +85,7 @@ class QuicPlatformTest : public testing::Test { GetLogger().set_level(ERROR); } - ~QuicPlatformTest() { + ~QuicPlatformTest() override { SetVerbosityLogThreshold(verbosity_log_threshold_); GetLogger().set_level(log_level_); } diff --git a/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc b/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc index 30fabc69b5f2..4ed180c0a05f 100644 --- a/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc +++ b/test/extensions/stats_sinks/metrics_service/grpc_metrics_service_impl_test.cc @@ -91,7 +91,7 @@ class TestGrpcMetricsStreamer : public GrpcMetricsStreamer { public: int metric_count; // GrpcMetricsStreamer - void send(envoy::service::metrics::v2::StreamMetricsMessage& message) { + void send(envoy::service::metrics::v2::StreamMetricsMessage& message) override { metric_count = message.envoy_metrics_size(); } }; diff --git a/test/extensions/tracers/zipkin/tracer_test.cc b/test/extensions/tracers/zipkin/tracer_test.cc index 0b1de42b7221..04fdbe3e07b4 100644 --- a/test/extensions/tracers/zipkin/tracer_test.cc +++ b/test/extensions/tracers/zipkin/tracer_test.cc @@ -28,7 +28,7 @@ namespace { class TestReporterImpl : public Reporter { public: TestReporterImpl(int value) : value_(value) {} - void reportSpan(const Span& span) { reported_spans_.push_back(span); } + void reportSpan(const Span& span) override { reported_spans_.push_back(span); } int getValue() { return value_; } std::vector& reportedSpans() { return reported_spans_; } diff --git a/test/integration/autonomous_upstream.h b/test/integration/autonomous_upstream.h index bdfc8a8eaa73..e749294d7426 100644 --- a/test/integration/autonomous_upstream.h +++ b/test/integration/autonomous_upstream.h @@ -22,7 +22,7 @@ class AutonomousStream : public FakeStream { AutonomousStream(FakeHttpConnection& parent, Http::StreamEncoder& encoder, AutonomousUpstream& upstream); - ~AutonomousStream(); + ~AutonomousStream() override; void setEndStream(bool set) override; @@ -55,7 +55,7 @@ class AutonomousUpstream : public FakeUpstream { AutonomousUpstream(uint32_t port, FakeHttpConnection::Type type, Network::Address::IpVersion version, Event::TestTimeSystem& time_system) : FakeUpstream(port, type, version, time_system) {} - ~AutonomousUpstream(); + ~AutonomousUpstream() override; bool createNetworkFilterChain(Network::Connection& connection, const std::vector& filter_factories) override; diff --git a/test/integration/fake_upstream.h b/test/integration/fake_upstream.h index 72b831ad4664..4338e4a1e998 100644 --- a/test/integration/fake_upstream.h +++ b/test/integration/fake_upstream.h @@ -531,7 +531,7 @@ class FakeUpstream : Logger::Loggable, FakeUpstream(Network::TransportSocketFactoryPtr&& transport_socket_factory, uint32_t port, FakeHttpConnection::Type type, Network::Address::IpVersion version, Event::TestTimeSystem& time_system); - ~FakeUpstream(); + ~FakeUpstream() override; FakeHttpConnection::Type httpType() { return http_type_; } diff --git a/test/integration/filters/add_trailers_filter.cc b/test/integration/filters/add_trailers_filter.cc index dd6c0f0fa0d2..cd698d71e736 100644 --- a/test/integration/filters/add_trailers_filter.cc +++ b/test/integration/filters/add_trailers_filter.cc @@ -12,7 +12,7 @@ namespace Envoy { // A test filter that inserts trailers at the end of encode/decode class AddTrailersStreamFilter : public Http::PassThroughFilter { public: - Http::FilterDataStatus decodeData(Buffer::Instance&, bool end_stream) { + Http::FilterDataStatus decodeData(Buffer::Instance&, bool end_stream) override { if (end_stream) { decoder_callbacks_->addDecodedTrailers().insertGrpcMessage().value(std::string("decode")); } @@ -20,7 +20,7 @@ class AddTrailersStreamFilter : public Http::PassThroughFilter { return Http::FilterDataStatus::Continue; } - Http::FilterDataStatus encodeData(Buffer::Instance&, bool end_stream) { + Http::FilterDataStatus encodeData(Buffer::Instance&, bool end_stream) override { if (end_stream) { encoder_callbacks_->addEncodedTrailers().insertGrpcMessage().value(std::string("encode")); } @@ -34,7 +34,8 @@ class AddTrailersStreamFilterConfig public: AddTrailersStreamFilterConfig() : EmptyHttpFilterConfig("add-trailers-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared<::Envoy::AddTrailersStreamFilter>()); }; diff --git a/test/integration/filters/clear_route_cache_filter.cc b/test/integration/filters/clear_route_cache_filter.cc index 1e7f72cf6627..94f75d1beb61 100644 --- a/test/integration/filters/clear_route_cache_filter.cc +++ b/test/integration/filters/clear_route_cache_filter.cc @@ -22,7 +22,8 @@ class ClearRouteCacheFilterConfig : public Extensions::HttpFilters::Common::Empt public: ClearRouteCacheFilterConfig() : EmptyHttpFilterConfig("clear-route-cache") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared<::Envoy::ClearRouteCacheFilter>()); }; diff --git a/test/integration/filters/common.h b/test/integration/filters/common.h index 524fbce49272..247e756d5e45 100644 --- a/test/integration/filters/common.h +++ b/test/integration/filters/common.h @@ -15,7 +15,8 @@ class SimpleFilterConfig : public Extensions::HttpFilters::Common::EmptyHttpFilt public: SimpleFilterConfig() : EmptyHttpFilterConfig(T::name) {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared()); }; diff --git a/test/integration/filters/modify_buffer_filter.cc b/test/integration/filters/modify_buffer_filter.cc index 82fc65d6ffe9..f96a258b09ce 100644 --- a/test/integration/filters/modify_buffer_filter.cc +++ b/test/integration/filters/modify_buffer_filter.cc @@ -13,7 +13,7 @@ namespace Envoy { // the content of the filter buffer. class ModifyBufferStreamFilter : public Http::PassThroughFilter { public: - Http::FilterDataStatus decodeData(Buffer::Instance& data, bool end_stream) { + Http::FilterDataStatus decodeData(Buffer::Instance& data, bool end_stream) override { decoder_callbacks_->addDecodedData(data, true); if (end_stream) { @@ -27,7 +27,7 @@ class ModifyBufferStreamFilter : public Http::PassThroughFilter { return Http::FilterDataStatus::StopIterationNoBuffer; } - Http::FilterDataStatus encodeData(Buffer::Instance& data, bool end_stream) { + Http::FilterDataStatus encodeData(Buffer::Instance& data, bool end_stream) override { encoder_callbacks_->addEncodedData(data, true); if (end_stream) { @@ -46,7 +46,8 @@ class ModifyBuffferFilterConfig : public Extensions::HttpFilters::Common::EmptyH public: ModifyBuffferFilterConfig() : EmptyHttpFilterConfig("modify-buffer-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared<::Envoy::ModifyBufferStreamFilter>()); }; diff --git a/test/integration/filters/pause_filter.cc b/test/integration/filters/pause_filter.cc index 228dce27f725..8ed74d4198b8 100644 --- a/test/integration/filters/pause_filter.cc +++ b/test/integration/filters/pause_filter.cc @@ -63,7 +63,8 @@ class TestPauseFilterConfig : public Extensions::HttpFilters::Common::EmptyHttpF public: TestPauseFilterConfig() : EmptyHttpFilterConfig("pause-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [&](Http::FilterChainFactoryCallbacks& callbacks) -> void { // GUARDED_BY insists the lock be held when the guarded variables are passed by reference. absl::WriterMutexLock m(&encode_lock_); diff --git a/test/integration/filters/random_pause_filter.cc b/test/integration/filters/random_pause_filter.cc index 15f3f71e160e..b709da758ce9 100644 --- a/test/integration/filters/random_pause_filter.cc +++ b/test/integration/filters/random_pause_filter.cc @@ -49,7 +49,8 @@ class RandomPauseFilterConfig : public Extensions::HttpFilters::Common::EmptyHtt public: RandomPauseFilterConfig() : EmptyHttpFilterConfig("random-pause-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [&](Http::FilterChainFactoryCallbacks& callbacks) -> void { absl::WriterMutexLock m(&rand_lock_); if (rng_ == nullptr) { diff --git a/test/integration/filters/request_metadata_filter.cc b/test/integration/filters/request_metadata_filter.cc index 19c6425bdc3a..b3823542213d 100644 --- a/test/integration/filters/request_metadata_filter.cc +++ b/test/integration/filters/request_metadata_filter.cc @@ -51,7 +51,8 @@ class AddRequestMetadataStreamFilterConfig : public Extensions::HttpFilters::Common::EmptyHttpFilterConfig { public: AddRequestMetadataStreamFilterConfig() : EmptyHttpFilterConfig("request-metadata-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared<::Envoy::RequestMetadataStreamFilter>()); }; diff --git a/test/integration/filters/response_metadata_filter.cc b/test/integration/filters/response_metadata_filter.cc index 4d5f45f07a3c..bc3779d3692e 100644 --- a/test/integration/filters/response_metadata_filter.cc +++ b/test/integration/filters/response_metadata_filter.cc @@ -83,7 +83,8 @@ class AddMetadataStreamFilterConfig public: AddMetadataStreamFilterConfig() : EmptyHttpFilterConfig("response-metadata-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared<::Envoy::ResponseMetadataStreamFilter>()); }; diff --git a/test/integration/filters/stop_iteration_and_continue_filter.cc b/test/integration/filters/stop_iteration_and_continue_filter.cc index b86cccbb1396..f90f9d483182 100644 --- a/test/integration/filters/stop_iteration_and_continue_filter.cc +++ b/test/integration/filters/stop_iteration_and_continue_filter.cc @@ -12,7 +12,7 @@ namespace Envoy { // A test filter that does StopIterationNoBuffer then continues after a 0ms alarm. class StopIterationAndContinueFilter : public Http::PassThroughFilter { public: - Http::FilterDataStatus decodeData(Buffer::Instance&, bool end_stream) { + Http::FilterDataStatus decodeData(Buffer::Instance&, bool end_stream) override { RELEASE_ASSERT(!end_stream_seen_, "end stream seen twice"); if (end_stream) { end_stream_seen_ = true; @@ -33,7 +33,8 @@ class StopIterationAndContinueFilterConfig StopIterationAndContinueFilterConfig() : EmptyHttpFilterConfig("stop-iteration-and-continue-filter") {} - Http::FilterFactoryCb createFilter(const std::string&, Server::Configuration::FactoryContext&) { + Http::FilterFactoryCb createFilter(const std::string&, + Server::Configuration::FactoryContext&) override { return [](Http::FilterChainFactoryCallbacks& callbacks) -> void { callbacks.addStreamFilter(std::make_shared<::Envoy::StopIterationAndContinueFilter>()); }; diff --git a/test/integration/http_integration.h b/test/integration/http_integration.h index 2df23c0462d0..bbeda044911e 100644 --- a/test/integration/http_integration.h +++ b/test/integration/http_integration.h @@ -98,7 +98,7 @@ class HttpIntegrationTest : public BaseIntegrationTest { const InstanceConstSharedPtrFn& upstream_address_fn, Network::Address::IpVersion version, const std::string& config = ConfigHelper::HTTP_PROXY_CONFIG); - virtual ~HttpIntegrationTest(); + ~HttpIntegrationTest() override; // Waits for the first access log entry. std::string waitForAccessLog(const std::string& filename); diff --git a/test/integration/server.h b/test/integration/server.h index 3cc7489cad55..55e3c11eab23 100644 --- a/test/integration/server.h +++ b/test/integration/server.h @@ -236,7 +236,7 @@ class IntegrationTestServer : public Logger::Loggable, absl::optional> process_object = absl::nullopt); // Note that the derived class is responsible for tearing down the server in its // destructor. - ~IntegrationTestServer(); + ~IntegrationTestServer() override; void waitUntilListenersReady(); diff --git a/test/mocks/access_log/mocks.h b/test/mocks/access_log/mocks.h index 562d817e896b..51748550b559 100644 --- a/test/mocks/access_log/mocks.h +++ b/test/mocks/access_log/mocks.h @@ -13,7 +13,7 @@ namespace AccessLog { class MockAccessLogFile : public AccessLogFile { public: MockAccessLogFile(); - ~MockAccessLogFile(); + ~MockAccessLogFile() override; // AccessLog::AccessLogFile MOCK_METHOD1(write, void(absl::string_view data)); @@ -24,7 +24,7 @@ class MockAccessLogFile : public AccessLogFile { class MockFilter : public Filter { public: MockFilter(); - ~MockFilter(); + ~MockFilter() override; // AccessLog::Filter MOCK_METHOD4(evaluate, @@ -36,7 +36,7 @@ class MockFilter : public Filter { class MockAccessLogManager : public AccessLogManager { public: MockAccessLogManager(); - ~MockAccessLogManager(); + ~MockAccessLogManager() override; // AccessLog::AccessLogManager MOCK_METHOD0(reopen, void()); @@ -48,7 +48,7 @@ class MockAccessLogManager : public AccessLogManager { class MockInstance : public Instance { public: MockInstance(); - ~MockInstance(); + ~MockInstance() override; // AccessLog::Instance MOCK_METHOD4(log, diff --git a/test/mocks/api/mocks.h b/test/mocks/api/mocks.h index 4bda9755288a..a85587a62683 100644 --- a/test/mocks/api/mocks.h +++ b/test/mocks/api/mocks.h @@ -26,7 +26,7 @@ namespace Api { class MockApi : public Api { public: MockApi(); - ~MockApi(); + ~MockApi() override; // Api::Api Event::DispatcherPtr allocateDispatcher() override; @@ -49,7 +49,7 @@ class MockApi : public Api { class MockOsSysCalls : public OsSysCallsImpl { public: MockOsSysCalls(); - ~MockOsSysCalls(); + ~MockOsSysCalls() override; // Api::OsSysCalls SysCallIntResult setsockopt(int sockfd, int level, int optname, const void* optval, diff --git a/test/mocks/buffer/mocks.h b/test/mocks/buffer/mocks.h index 6713259969f7..2f9eb963eca4 100644 --- a/test/mocks/buffer/mocks.h +++ b/test/mocks/buffer/mocks.h @@ -90,7 +90,7 @@ class MockWatermarkBuffer : public MockBufferBase { class MockBufferFactory : public Buffer::WatermarkFactory { public: MockBufferFactory(); - ~MockBufferFactory(); + ~MockBufferFactory() override; Buffer::InstancePtr create(std::function below_low, std::function above_high) override { diff --git a/test/mocks/common.h b/test/mocks/common.h index 77637b83ade2..2bc37836c50e 100644 --- a/test/mocks/common.h +++ b/test/mocks/common.h @@ -43,7 +43,7 @@ class ReadyWatcher { class MockTimeSystem : public Event::TestTimeSystem { public: MockTimeSystem(); - ~MockTimeSystem(); + ~MockTimeSystem() override; // TODO(#4160): Eliminate all uses of MockTimeSystem, replacing with SimulatedTimeSystem, // where timer callbacks are triggered by the advancement of time. This implementation diff --git a/test/mocks/event/mocks.h b/test/mocks/event/mocks.h index 5cbd2f076f5f..ad190e23e939 100644 --- a/test/mocks/event/mocks.h +++ b/test/mocks/event/mocks.h @@ -28,7 +28,7 @@ namespace Event { class MockDispatcher : public Dispatcher { public: MockDispatcher(); - ~MockDispatcher(); + ~MockDispatcher() override; // Dispatcher TimeSource& timeSource() override { return time_system_; } @@ -125,7 +125,7 @@ class MockTimer : public Timer { public: MockTimer(); MockTimer(MockDispatcher* dispatcher); - ~MockTimer(); + ~MockTimer() override; void invokeCallback() { EXPECT_TRUE(enabled_); @@ -147,7 +147,7 @@ class MockTimer : public Timer { class MockSignalEvent : public SignalEvent { public: MockSignalEvent(MockDispatcher* dispatcher); - ~MockSignalEvent(); + ~MockSignalEvent() override; SignalCb callback_; }; @@ -155,7 +155,7 @@ class MockSignalEvent : public SignalEvent { class MockFileEvent : public FileEvent { public: MockFileEvent(); - ~MockFileEvent(); + ~MockFileEvent() override; MOCK_METHOD1(activate, void(uint32_t events)); MOCK_METHOD1(setEnabled, void(uint32_t events)); diff --git a/test/mocks/grpc/mocks.h b/test/mocks/grpc/mocks.h index f851f0e0176d..a2393b32444a 100644 --- a/test/mocks/grpc/mocks.h +++ b/test/mocks/grpc/mocks.h @@ -19,7 +19,7 @@ namespace Grpc { class MockAsyncRequest : public AsyncRequest { public: MockAsyncRequest(); - ~MockAsyncRequest(); + ~MockAsyncRequest() override; MOCK_METHOD0(cancel, void()); }; @@ -27,9 +27,9 @@ class MockAsyncRequest : public AsyncRequest { class MockAsyncStream : public RawAsyncStream { public: MockAsyncStream(); - ~MockAsyncStream(); + ~MockAsyncStream() override; - void sendMessageRaw(Buffer::InstancePtr&& request, bool end_stream) { + void sendMessageRaw(Buffer::InstancePtr&& request, bool end_stream) override { sendMessageRaw_(request, end_stream); } MOCK_METHOD2_T(sendMessageRaw_, void(Buffer::InstancePtr& request, bool end_stream)); @@ -85,7 +85,7 @@ class MockAsyncClient : public RawAsyncClient { class MockAsyncClientFactory : public AsyncClientFactory { public: MockAsyncClientFactory(); - ~MockAsyncClientFactory(); + ~MockAsyncClientFactory() override; MOCK_METHOD0(create, RawAsyncClientPtr()); }; @@ -93,7 +93,7 @@ class MockAsyncClientFactory : public AsyncClientFactory { class MockAsyncClientManager : public AsyncClientManager { public: MockAsyncClientManager(); - ~MockAsyncClientManager(); + ~MockAsyncClientManager() override; MOCK_METHOD3(factoryForGrpcService, AsyncClientFactoryPtr(const envoy::api::v2::core::GrpcService& grpc_service, diff --git a/test/mocks/http/conn_pool.h b/test/mocks/http/conn_pool.h index 18ea24063c56..60566c96b129 100644 --- a/test/mocks/http/conn_pool.h +++ b/test/mocks/http/conn_pool.h @@ -14,7 +14,7 @@ class MockCancellable : public Cancellable { public: MockCancellable(); - ~MockCancellable(); + ~MockCancellable() override; // Http::ConnectionPool::Cancellable MOCK_METHOD0(cancel, void()); @@ -23,7 +23,7 @@ class MockCancellable : public Cancellable { class MockInstance : public Instance { public: MockInstance(); - ~MockInstance(); + ~MockInstance() override; // Http::ConnectionPool::Instance MOCK_CONST_METHOD0(protocol, Http::Protocol()); diff --git a/test/mocks/http/mocks.h b/test/mocks/http/mocks.h index a3a3f53768c9..34cb97b465b9 100644 --- a/test/mocks/http/mocks.h +++ b/test/mocks/http/mocks.h @@ -41,7 +41,7 @@ namespace Http { class MockConnectionCallbacks : public virtual ConnectionCallbacks { public: MockConnectionCallbacks(); - ~MockConnectionCallbacks(); + ~MockConnectionCallbacks() override; // Http::ConnectionCallbacks MOCK_METHOD0(onGoAway, void()); @@ -51,7 +51,7 @@ class MockServerConnectionCallbacks : public ServerConnectionCallbacks, public MockConnectionCallbacks { public: MockServerConnectionCallbacks(); - ~MockServerConnectionCallbacks(); + ~MockServerConnectionCallbacks() override; // Http::ServerConnectionCallbacks MOCK_METHOD2(newStream, @@ -61,7 +61,7 @@ class MockServerConnectionCallbacks : public ServerConnectionCallbacks, class MockStreamCallbacks : public StreamCallbacks { public: MockStreamCallbacks(); - ~MockStreamCallbacks(); + ~MockStreamCallbacks() override; // Http::StreamCallbacks MOCK_METHOD2(onResetStream, void(StreamResetReason reason, absl::string_view)); @@ -72,7 +72,7 @@ class MockStreamCallbacks : public StreamCallbacks { class MockServerConnection : public ServerConnection { public: MockServerConnection(); - ~MockServerConnection(); + ~MockServerConnection() override; // Http::Connection MOCK_METHOD1(dispatch, void(Buffer::Instance& data)); @@ -89,7 +89,7 @@ class MockServerConnection : public ServerConnection { class MockClientConnection : public ClientConnection { public: MockClientConnection(); - ~MockClientConnection(); + ~MockClientConnection() override; // Http::Connection MOCK_METHOD1(dispatch, void(Buffer::Instance& data)); @@ -107,7 +107,7 @@ class MockClientConnection : public ClientConnection { class MockFilterChainFactory : public FilterChainFactory { public: MockFilterChainFactory(); - ~MockFilterChainFactory(); + ~MockFilterChainFactory() override; // Http::FilterChainFactory MOCK_METHOD1(createFilterChain, void(FilterChainFactoryCallbacks& callbacks)); @@ -128,7 +128,7 @@ class MockStreamDecoderFilterCallbacks : public StreamDecoderFilterCallbacks, public MockStreamFilterCallbacksBase { public: MockStreamDecoderFilterCallbacks(); - ~MockStreamDecoderFilterCallbacks(); + ~MockStreamDecoderFilterCallbacks() override; // Http::StreamFilterCallbacks MOCK_METHOD0(connection, const Network::Connection*()); @@ -199,7 +199,7 @@ class MockStreamEncoderFilterCallbacks : public StreamEncoderFilterCallbacks, public MockStreamFilterCallbacksBase { public: MockStreamEncoderFilterCallbacks(); - ~MockStreamEncoderFilterCallbacks(); + ~MockStreamEncoderFilterCallbacks() override; // Http::StreamFilterCallbacks MOCK_METHOD0(connection, const Network::Connection*()); @@ -233,7 +233,7 @@ class MockStreamEncoderFilterCallbacks : public StreamEncoderFilterCallbacks, class MockStreamDecoderFilter : public StreamDecoderFilter { public: MockStreamDecoderFilter(); - ~MockStreamDecoderFilter(); + ~MockStreamDecoderFilter() override; // Http::StreamFilterBase MOCK_METHOD0(onDestroy, void()); @@ -252,7 +252,7 @@ class MockStreamDecoderFilter : public StreamDecoderFilter { class MockStreamEncoderFilter : public StreamEncoderFilter { public: MockStreamEncoderFilter(); - ~MockStreamEncoderFilter(); + ~MockStreamEncoderFilter() override; // Http::StreamFilterBase MOCK_METHOD0(onDestroy, void()); @@ -272,7 +272,7 @@ class MockStreamEncoderFilter : public StreamEncoderFilter { class MockStreamFilter : public StreamFilter { public: MockStreamFilter(); - ~MockStreamFilter(); + ~MockStreamFilter() override; // Http::StreamFilterBase MOCK_METHOD0(onDestroy, void()); @@ -299,7 +299,7 @@ class MockStreamFilter : public StreamFilter { class MockAsyncClient : public AsyncClient { public: MockAsyncClient(); - ~MockAsyncClient(); + ~MockAsyncClient() override; MOCK_METHOD0(onRequestDestroy, void()); @@ -321,7 +321,7 @@ class MockAsyncClient : public AsyncClient { class MockAsyncClientCallbacks : public AsyncClient::Callbacks { public: MockAsyncClientCallbacks(); - ~MockAsyncClientCallbacks(); + ~MockAsyncClientCallbacks() override; void onSuccess(MessagePtr&& response) override { onSuccess_(response.get()); } @@ -333,7 +333,7 @@ class MockAsyncClientCallbacks : public AsyncClient::Callbacks { class MockAsyncClientStreamCallbacks : public AsyncClient::StreamCallbacks { public: MockAsyncClientStreamCallbacks(); - ~MockAsyncClientStreamCallbacks(); + ~MockAsyncClientStreamCallbacks() override; void onHeaders(HeaderMapPtr&& headers, bool end_stream) override { onHeaders_(*headers, end_stream); @@ -349,7 +349,7 @@ class MockAsyncClientStreamCallbacks : public AsyncClient::StreamCallbacks { class MockAsyncClientRequest : public AsyncClient::Request { public: MockAsyncClientRequest(MockAsyncClient* client); - ~MockAsyncClientRequest(); + ~MockAsyncClientRequest() override; MOCK_METHOD0(cancel, void()); @@ -359,7 +359,7 @@ class MockAsyncClientRequest : public AsyncClient::Request { class MockAsyncClientStream : public AsyncClient::Stream { public: MockAsyncClientStream(); - ~MockAsyncClientStream(); + ~MockAsyncClientStream() override; MOCK_METHOD2(sendHeaders, void(HeaderMap& headers, bool end_stream)); MOCK_METHOD2(sendData, void(Buffer::Instance& data, bool end_stream)); @@ -370,7 +370,7 @@ class MockAsyncClientStream : public AsyncClient::Stream { class MockFilterChainFactoryCallbacks : public Http::FilterChainFactoryCallbacks { public: MockFilterChainFactoryCallbacks(); - ~MockFilterChainFactoryCallbacks(); + ~MockFilterChainFactoryCallbacks() override; MOCK_METHOD1(addStreamDecoderFilter, void(Http::StreamDecoderFilterSharedPtr filter)); MOCK_METHOD1(addStreamEncoderFilter, void(Http::StreamEncoderFilterSharedPtr filter)); diff --git a/test/mocks/http/stream_encoder.h b/test/mocks/http/stream_encoder.h index 5c2e067979e5..bc9138e37746 100644 --- a/test/mocks/http/stream_encoder.h +++ b/test/mocks/http/stream_encoder.h @@ -12,7 +12,7 @@ namespace Http { class MockStreamEncoder : public StreamEncoder { public: MockStreamEncoder(); - ~MockStreamEncoder(); + ~MockStreamEncoder() override; // Http::StreamEncoder MOCK_METHOD1(encode100ContinueHeaders, void(const HeaderMap& headers)); diff --git a/test/mocks/local_info/mocks.h b/test/mocks/local_info/mocks.h index 6c53a2c19a3f..655eaaf59030 100644 --- a/test/mocks/local_info/mocks.h +++ b/test/mocks/local_info/mocks.h @@ -12,7 +12,7 @@ namespace LocalInfo { class MockLocalInfo : public LocalInfo { public: MockLocalInfo(); - ~MockLocalInfo(); + ~MockLocalInfo() override; MOCK_CONST_METHOD0(address, Network::Address::InstanceConstSharedPtr()); MOCK_CONST_METHOD0(zoneName, const std::string&()); diff --git a/test/mocks/network/connection.h b/test/mocks/network/connection.h index 880802982a11..f660269de13a 100644 --- a/test/mocks/network/connection.h +++ b/test/mocks/network/connection.h @@ -17,7 +17,7 @@ namespace Network { class MockConnectionCallbacks : public ConnectionCallbacks { public: MockConnectionCallbacks(); - ~MockConnectionCallbacks(); + ~MockConnectionCallbacks() override; // Network::ConnectionCallbacks MOCK_METHOD1(onEvent, void(Network::ConnectionEvent event)); @@ -48,7 +48,7 @@ class MockConnectionBase { class MockConnection : public Connection, public MockConnectionBase { public: MockConnection(); - ~MockConnection(); + ~MockConnection() override; // Network::Connection MOCK_METHOD1(addConnectionCallbacks, void(ConnectionCallbacks& cb)); @@ -94,7 +94,7 @@ class MockConnection : public Connection, public MockConnectionBase { class MockClientConnection : public ClientConnection, public MockConnectionBase { public: MockClientConnection(); - ~MockClientConnection(); + ~MockClientConnection() override; // Network::Connection MOCK_METHOD1(addConnectionCallbacks, void(ConnectionCallbacks& cb)); @@ -143,7 +143,7 @@ class MockClientConnection : public ClientConnection, public MockConnectionBase class MockFilterManagerConnection : public FilterManagerConnection, public MockConnectionBase { public: MockFilterManagerConnection(); - ~MockFilterManagerConnection(); + ~MockFilterManagerConnection() override; // Network::Connection MOCK_METHOD1(addConnectionCallbacks, void(ConnectionCallbacks& cb)); diff --git a/test/mocks/network/mocks.h b/test/mocks/network/mocks.h index 28e12f6f4d02..00f9b902386b 100644 --- a/test/mocks/network/mocks.h +++ b/test/mocks/network/mocks.h @@ -29,7 +29,7 @@ namespace Network { class MockActiveDnsQuery : public ActiveDnsQuery { public: MockActiveDnsQuery(); - ~MockActiveDnsQuery(); + ~MockActiveDnsQuery() override; // Network::ActiveDnsQuery MOCK_METHOD0(cancel, void()); @@ -38,7 +38,7 @@ class MockActiveDnsQuery : public ActiveDnsQuery { class MockDnsResolver : public DnsResolver { public: MockDnsResolver(); - ~MockDnsResolver(); + ~MockDnsResolver() override; // Network::DnsResolver MOCK_METHOD3(resolve, ActiveDnsQuery*(const std::string& dns_name, @@ -50,7 +50,7 @@ class MockDnsResolver : public DnsResolver { class MockAddressResolver : public Address::Resolver { public: MockAddressResolver(); - ~MockAddressResolver(); + ~MockAddressResolver() override; MOCK_METHOD1(resolve, Address::InstanceConstSharedPtr(const envoy::api::v2::core::SocketAddress&)); @@ -60,7 +60,7 @@ class MockAddressResolver : public Address::Resolver { class MockReadFilterCallbacks : public ReadFilterCallbacks { public: MockReadFilterCallbacks(); - ~MockReadFilterCallbacks(); + ~MockReadFilterCallbacks() override; MOCK_METHOD0(connection, Connection&()); MOCK_METHOD0(continueReading, void()); @@ -75,7 +75,7 @@ class MockReadFilterCallbacks : public ReadFilterCallbacks { class MockReadFilter : public ReadFilter { public: MockReadFilter(); - ~MockReadFilter(); + ~MockReadFilter() override; MOCK_METHOD2(onData, FilterStatus(Buffer::Instance& data, bool end_stream)); MOCK_METHOD0(onNewConnection, FilterStatus()); @@ -87,7 +87,7 @@ class MockReadFilter : public ReadFilter { class MockWriteFilterCallbacks : public WriteFilterCallbacks { public: MockWriteFilterCallbacks(); - ~MockWriteFilterCallbacks(); + ~MockWriteFilterCallbacks() override; MOCK_METHOD0(connection, Connection&()); MOCK_METHOD2(injectWriteDataToFilterChain, void(Buffer::Instance& data, bool end_stream)); @@ -98,7 +98,7 @@ class MockWriteFilterCallbacks : public WriteFilterCallbacks { class MockWriteFilter : public WriteFilter { public: MockWriteFilter(); - ~MockWriteFilter(); + ~MockWriteFilter() override; MOCK_METHOD2(onWrite, FilterStatus(Buffer::Instance& data, bool end_stream)); MOCK_METHOD1(initializeWriteFilterCallbacks, void(WriteFilterCallbacks& callbacks)); @@ -109,7 +109,7 @@ class MockWriteFilter : public WriteFilter { class MockFilter : public Filter { public: MockFilter(); - ~MockFilter(); + ~MockFilter() override; MOCK_METHOD2(onData, FilterStatus(Buffer::Instance& data, bool end_stream)); MOCK_METHOD0(onNewConnection, FilterStatus()); @@ -124,7 +124,7 @@ class MockFilter : public Filter { class MockListenerCallbacks : public ListenerCallbacks { public: MockListenerCallbacks(); - ~MockListenerCallbacks(); + ~MockListenerCallbacks() override; void onAccept(ConnectionSocketPtr&& socket, bool redirected) override { onAccept_(socket, redirected); @@ -138,7 +138,7 @@ class MockListenerCallbacks : public ListenerCallbacks { class MockUdpListenerCallbacks : public UdpListenerCallbacks { public: MockUdpListenerCallbacks(); - ~MockUdpListenerCallbacks(); + ~MockUdpListenerCallbacks() override; void onData(UdpRecvData& data) override { onData_(data); } @@ -158,7 +158,7 @@ class MockUdpListenerCallbacks : public UdpListenerCallbacks { class MockDrainDecision : public DrainDecision { public: MockDrainDecision(); - ~MockDrainDecision(); + ~MockDrainDecision() override; MOCK_CONST_METHOD0(drainClose, bool()); }; @@ -166,7 +166,7 @@ class MockDrainDecision : public DrainDecision { class MockListenerFilter : public ListenerFilter { public: MockListenerFilter(); - ~MockListenerFilter(); + ~MockListenerFilter() override; MOCK_METHOD1(onAccept, Network::FilterStatus(ListenerFilterCallbacks&)); }; @@ -174,7 +174,7 @@ class MockListenerFilter : public ListenerFilter { class MockListenerFilterManager : public ListenerFilterManager { public: MockListenerFilterManager(); - ~MockListenerFilterManager(); + ~MockListenerFilterManager() override; void addAcceptFilter(ListenerFilterPtr&& filter) override { addAcceptFilter_(filter); } @@ -184,7 +184,7 @@ class MockListenerFilterManager : public ListenerFilterManager { class MockFilterChain : public FilterChain { public: MockFilterChain(); - ~MockFilterChain(); + ~MockFilterChain() override; // Network::FilterChain MOCK_CONST_METHOD0(transportSocketFactory, const TransportSocketFactory&()); @@ -194,7 +194,7 @@ class MockFilterChain : public FilterChain { class MockFilterChainManager : public FilterChainManager { public: MockFilterChainManager(); - ~MockFilterChainManager(); + ~MockFilterChainManager() override; // Network::FilterChainManager MOCK_CONST_METHOD1(findFilterChain, const FilterChain*(const ConnectionSocket& socket)); @@ -203,7 +203,7 @@ class MockFilterChainManager : public FilterChainManager { class MockFilterChainFactory : public FilterChainFactory { public: MockFilterChainFactory(); - ~MockFilterChainFactory(); + ~MockFilterChainFactory() override; MOCK_METHOD2(createNetworkFilterChain, bool(Connection& connection, @@ -239,7 +239,7 @@ class MockListenSocket : public Socket { class MockSocketOption : public Socket::Option { public: MockSocketOption(); - ~MockSocketOption(); + ~MockSocketOption() override; MOCK_CONST_METHOD2(setOption, bool(Socket&, envoy::api::v2::core::SocketOption::SocketState state)); @@ -285,7 +285,7 @@ class MockConnectionSocket : public ConnectionSocket { class MockListenerFilterCallbacks : public ListenerFilterCallbacks { public: MockListenerFilterCallbacks(); - ~MockListenerFilterCallbacks(); + ~MockListenerFilterCallbacks() override; MOCK_METHOD0(socket, ConnectionSocket&()); MOCK_METHOD0(dispatcher, Event::Dispatcher&()); @@ -297,7 +297,7 @@ class MockListenerFilterCallbacks : public ListenerFilterCallbacks { class MockListenerConfig : public ListenerConfig { public: MockListenerConfig(); - ~MockListenerConfig(); + ~MockListenerConfig() override; MOCK_METHOD0(filterChainManager, FilterChainManager&()); MOCK_METHOD0(filterChainFactory, FilterChainFactory&()); @@ -320,7 +320,7 @@ class MockListenerConfig : public ListenerConfig { class MockListener : public Listener { public: MockListener(); - ~MockListener(); + ~MockListener() override; MOCK_METHOD0(onDestroy, void()); MOCK_METHOD0(enable, void()); @@ -330,7 +330,7 @@ class MockListener : public Listener { class MockConnectionHandler : public ConnectionHandler { public: MockConnectionHandler(); - ~MockConnectionHandler(); + ~MockConnectionHandler() override; MOCK_METHOD0(numConnections, uint64_t()); MOCK_METHOD1(addListener, void(ListenerConfig& config)); @@ -346,7 +346,7 @@ class MockConnectionHandler : public ConnectionHandler { class MockIp : public Address::Ip { public: MockIp(); - ~MockIp(); + ~MockIp() override; MOCK_CONST_METHOD0(addressAsString, const std::string&()); MOCK_CONST_METHOD0(isAnyAddress, bool()); @@ -361,7 +361,7 @@ class MockResolvedAddress : public Address::Instance { public: MockResolvedAddress(const std::string& logical, const std::string& physical) : logical_(logical), physical_(physical) {} - ~MockResolvedAddress(); + ~MockResolvedAddress() override; bool operator==(const Address::Instance& other) const override { return asString() == other.asString(); @@ -385,7 +385,7 @@ class MockResolvedAddress : public Address::Instance { class MockTransportSocket : public TransportSocket { public: MockTransportSocket(); - ~MockTransportSocket(); + ~MockTransportSocket() override; MOCK_METHOD1(setTransportSocketCallbacks, void(TransportSocketCallbacks& callbacks)); MOCK_CONST_METHOD0(protocol, std::string()); @@ -403,7 +403,7 @@ class MockTransportSocket : public TransportSocket { class MockTransportSocketFactory : public TransportSocketFactory { public: MockTransportSocketFactory(); - ~MockTransportSocketFactory(); + ~MockTransportSocketFactory() override; MOCK_CONST_METHOD0(implementsSecureTransport, bool()); MOCK_CONST_METHOD1(createTransportSocket, TransportSocketPtr(TransportSocketOptionsSharedPtr)); @@ -412,7 +412,7 @@ class MockTransportSocketFactory : public TransportSocketFactory { class MockTransportSocketCallbacks : public TransportSocketCallbacks { public: MockTransportSocketCallbacks(); - ~MockTransportSocketCallbacks(); + ~MockTransportSocketCallbacks() override; MOCK_METHOD0(ioHandle, IoHandle&()); MOCK_CONST_METHOD0(ioHandle, const IoHandle&()); @@ -427,7 +427,7 @@ class MockTransportSocketCallbacks : public TransportSocketCallbacks { class MockUdpListener : public UdpListener { public: MockUdpListener(); - ~MockUdpListener(); + ~MockUdpListener() override; MOCK_METHOD0(onDestroy, void()); MOCK_METHOD0(enable, void()); @@ -440,7 +440,7 @@ class MockUdpListener : public UdpListener { class MockUdpReadFilterCallbacks : public UdpReadFilterCallbacks { public: MockUdpReadFilterCallbacks(); - ~MockUdpReadFilterCallbacks(); + ~MockUdpReadFilterCallbacks() override; MOCK_METHOD0(udpListener, UdpListener&()); @@ -450,7 +450,7 @@ class MockUdpReadFilterCallbacks : public UdpReadFilterCallbacks { class MockUdpListenerReadFilter : public UdpListenerReadFilter { public: MockUdpListenerReadFilter(UdpReadFilterCallbacks& callbacks); - ~MockUdpListenerReadFilter(); + ~MockUdpListenerReadFilter() override; MOCK_METHOD1(onData, void(UdpRecvData&)); }; @@ -458,7 +458,7 @@ class MockUdpListenerReadFilter : public UdpListenerReadFilter { class MockUdpListenerFilterManager : public UdpListenerFilterManager { public: MockUdpListenerFilterManager(); - ~MockUdpListenerFilterManager(); + ~MockUdpListenerFilterManager() override; void addReadFilter(UdpListenerReadFilterPtr&& filter) override { addReadFilter_(filter); } diff --git a/test/mocks/protobuf/mocks.h b/test/mocks/protobuf/mocks.h index 48c975e31ac1..66e2f5d2b9c1 100644 --- a/test/mocks/protobuf/mocks.h +++ b/test/mocks/protobuf/mocks.h @@ -10,7 +10,7 @@ namespace ProtobufMessage { class MockValidationVisitor : public ValidationVisitor { public: MockValidationVisitor(); - ~MockValidationVisitor(); + ~MockValidationVisitor() override; MOCK_METHOD1(onUnknownField, void(absl::string_view)); }; diff --git a/test/mocks/router/mocks.h b/test/mocks/router/mocks.h index f84aacda8ab8..aeda21400f98 100644 --- a/test/mocks/router/mocks.h +++ b/test/mocks/router/mocks.h @@ -34,7 +34,7 @@ namespace Router { class MockDirectResponseEntry : public DirectResponseEntry { public: MockDirectResponseEntry(); - ~MockDirectResponseEntry(); + ~MockDirectResponseEntry() override; // DirectResponseEntry MOCK_CONST_METHOD2(finalizeResponseHeaders, @@ -112,7 +112,7 @@ class TestRetryPolicy : public RetryPolicy { class MockRetryState : public RetryState { public: MockRetryState(); - ~MockRetryState(); + ~MockRetryState() override; void expectHeadersRetry(); void expectHedgedPerTryTimeoutRetry(); @@ -138,7 +138,7 @@ class MockRetryState : public RetryState { class MockRateLimitPolicyEntry : public RateLimitPolicyEntry { public: MockRateLimitPolicyEntry(); - ~MockRateLimitPolicyEntry(); + ~MockRateLimitPolicyEntry() override; // Router::RateLimitPolicyEntry MOCK_CONST_METHOD0(stage, uint64_t()); @@ -156,7 +156,7 @@ class MockRateLimitPolicyEntry : public RateLimitPolicyEntry { class MockRateLimitPolicy : public RateLimitPolicy { public: MockRateLimitPolicy(); - ~MockRateLimitPolicy(); + ~MockRateLimitPolicy() override; // Router::RateLimitPolicy MOCK_CONST_METHOD1( @@ -182,7 +182,7 @@ class TestShadowPolicy : public ShadowPolicy { class MockShadowWriter : public ShadowWriter { public: MockShadowWriter(); - ~MockShadowWriter(); + ~MockShadowWriter() override; // Router::ShadowWriter void shadow(const std::string& cluster, Http::MessagePtr&& request, @@ -206,7 +206,7 @@ class TestVirtualCluster : public VirtualCluster { class MockVirtualHost : public VirtualHost { public: MockVirtualHost(); - ~MockVirtualHost(); + ~MockVirtualHost() override; // Router::VirtualHost MOCK_CONST_METHOD0(name, const std::string&()); @@ -233,7 +233,7 @@ class MockVirtualHost : public VirtualHost { class MockHashPolicy : public HashPolicy { public: MockHashPolicy(); - ~MockHashPolicy(); + ~MockHashPolicy() override; // Router::HashPolicy MOCK_CONST_METHOD3(generateHash, @@ -245,7 +245,7 @@ class MockHashPolicy : public HashPolicy { class MockMetadataMatchCriteria : public MetadataMatchCriteria { public: MockMetadataMatchCriteria(); - ~MockMetadataMatchCriteria(); + ~MockMetadataMatchCriteria() override; // Router::MetadataMatchCriteria MOCK_CONST_METHOD0(metadataMatchCriteria, @@ -256,7 +256,7 @@ class MockMetadataMatchCriteria : public MetadataMatchCriteria { class MockPathMatchCriterion : public PathMatchCriterion { public: MockPathMatchCriterion(); - ~MockPathMatchCriterion(); + ~MockPathMatchCriterion() override; // Router::PathMatchCriterion MOCK_CONST_METHOD0(matchType, PathMatchType()); @@ -269,7 +269,7 @@ class MockPathMatchCriterion : public PathMatchCriterion { class MockRouteEntry : public RouteEntry { public: MockRouteEntry(); - ~MockRouteEntry(); + ~MockRouteEntry() override; // Router::Config MOCK_CONST_METHOD0(clusterName, const std::string&()); @@ -326,7 +326,7 @@ class MockRouteEntry : public RouteEntry { class MockDecorator : public Decorator { public: MockDecorator(); - ~MockDecorator(); + ~MockDecorator() override; // Router::Decorator MOCK_CONST_METHOD0(getOperation, const std::string&()); @@ -338,7 +338,7 @@ class MockDecorator : public Decorator { class MockRouteTracing : public RouteTracing { public: MockRouteTracing(); - ~MockRouteTracing(); + ~MockRouteTracing() override; // Router::RouteTracing MOCK_CONST_METHOD0(getClientSampling, const envoy::type::FractionalPercent&()); @@ -349,7 +349,7 @@ class MockRouteTracing : public RouteTracing { class MockRoute : public Route { public: MockRoute(); - ~MockRoute(); + ~MockRoute() override; // Router::Route MOCK_CONST_METHOD0(directResponseEntry, const DirectResponseEntry*()); @@ -366,7 +366,7 @@ class MockRoute : public Route { class MockConfig : public Config { public: MockConfig(); - ~MockConfig(); + ~MockConfig() override; // Router::Config MOCK_CONST_METHOD2(route, RouteConstSharedPtr(const Http::HeaderMap&, uint64_t random_value)); @@ -382,7 +382,7 @@ class MockConfig : public Config { class MockRouteConfigProviderManager : public RouteConfigProviderManager { public: MockRouteConfigProviderManager(); - ~MockRouteConfigProviderManager(); + ~MockRouteConfigProviderManager() override; MOCK_METHOD3(createRdsRouteConfigProvider, RouteConfigProviderPtr( @@ -397,7 +397,7 @@ class MockRouteConfigProviderManager : public RouteConfigProviderManager { class MockScopedConfig : public ScopedConfig { public: MockScopedConfig(); - ~MockScopedConfig(); + ~MockScopedConfig() override; MOCK_CONST_METHOD1(getRouteConfig, ConfigConstSharedPtr(const Http::HeaderMap& headers)); }; diff --git a/test/mocks/runtime/mocks.h b/test/mocks/runtime/mocks.h index e67e34361958..3592a40200fa 100644 --- a/test/mocks/runtime/mocks.h +++ b/test/mocks/runtime/mocks.h @@ -15,7 +15,7 @@ namespace Runtime { class MockRandomGenerator : public RandomGenerator { public: MockRandomGenerator(); - ~MockRandomGenerator(); + ~MockRandomGenerator() override; MOCK_METHOD0(random, uint64_t()); MOCK_METHOD0(uuid, std::string()); @@ -60,7 +60,7 @@ class MockSnapshot : public Snapshot { class MockLoader : public Loader { public: MockLoader(); - ~MockLoader(); + ~MockLoader() override; MOCK_METHOD1(initialize, void(Upstream::ClusterManager& cm)); MOCK_METHOD0(snapshot, Snapshot&()); @@ -72,7 +72,7 @@ class MockLoader : public Loader { class MockOverrideLayer : public Snapshot::OverrideLayer { public: MockOverrideLayer(); - ~MockOverrideLayer(); + ~MockOverrideLayer() override; MOCK_CONST_METHOD0(name, const std::string&()); MOCK_CONST_METHOD0(values, const Snapshot::EntryMap&()); diff --git a/test/mocks/secret/mocks.h b/test/mocks/secret/mocks.h index 428f1ec28faa..2f3f2c5f073e 100644 --- a/test/mocks/secret/mocks.h +++ b/test/mocks/secret/mocks.h @@ -14,7 +14,7 @@ namespace Secret { class MockSecretManager : public SecretManager { public: MockSecretManager(); - ~MockSecretManager(); + ~MockSecretManager() override; MOCK_METHOD1(addStaticSecret, void(const envoy::api::v2::auth::Secret& secret)); MOCK_CONST_METHOD1(findStaticTlsCertificateProvider, @@ -42,7 +42,7 @@ class MockSecretManager : public SecretManager { class MockSecretCallbacks : public SecretCallbacks { public: MockSecretCallbacks(); - ~MockSecretCallbacks(); + ~MockSecretCallbacks() override; MOCK_METHOD0(onAddOrUpdateSecret, void()); }; diff --git a/test/mocks/ssl/mocks.h b/test/mocks/ssl/mocks.h index cd91a237327f..20621bd29ca4 100644 --- a/test/mocks/ssl/mocks.h +++ b/test/mocks/ssl/mocks.h @@ -20,7 +20,7 @@ namespace Ssl { class MockContextManager : public ContextManager { public: MockContextManager(); - ~MockContextManager(); + ~MockContextManager() override; MOCK_METHOD2(createSslClientContext, ClientContextSharedPtr(Stats::Scope& scope, const ClientContextConfig& config)); @@ -34,7 +34,7 @@ class MockContextManager : public ContextManager { class MockConnectionInfo : public ConnectionInfo { public: MockConnectionInfo(); - ~MockConnectionInfo(); + ~MockConnectionInfo() override; MOCK_CONST_METHOD0(peerCertificatePresented, bool()); MOCK_CONST_METHOD0(uriSanLocalCertificate, std::vector()); @@ -59,7 +59,7 @@ class MockConnectionInfo : public ConnectionInfo { class MockClientContext : public ClientContext { public: MockClientContext(); - ~MockClientContext(); + ~MockClientContext() override; MOCK_CONST_METHOD0(daysUntilFirstCertExpires, size_t()); MOCK_CONST_METHOD0(getCaCertInformation, CertificateDetailsPtr()); @@ -69,7 +69,7 @@ class MockClientContext : public ClientContext { class MockClientContextConfig : public ClientContextConfig { public: MockClientContextConfig(); - ~MockClientContextConfig(); + ~MockClientContextConfig() override; MOCK_CONST_METHOD0(alpnProtocols, const std::string&()); MOCK_CONST_METHOD0(cipherSuites, const std::string&()); @@ -91,7 +91,7 @@ class MockClientContextConfig : public ClientContextConfig { class MockServerContextConfig : public ServerContextConfig { public: MockServerContextConfig(); - ~MockServerContextConfig(); + ~MockServerContextConfig() override; MOCK_CONST_METHOD0(alpnProtocols, const std::string&()); MOCK_CONST_METHOD0(cipherSuites, const std::string&()); diff --git a/test/mocks/stream_info/mocks.h b/test/mocks/stream_info/mocks.h index 9332fec087ec..0fbd34222291 100644 --- a/test/mocks/stream_info/mocks.h +++ b/test/mocks/stream_info/mocks.h @@ -14,7 +14,7 @@ namespace StreamInfo { class MockStreamInfo : public StreamInfo { public: MockStreamInfo(); - ~MockStreamInfo(); + ~MockStreamInfo() override; // StreamInfo::StreamInfo MOCK_METHOD1(setResponseFlag, void(ResponseFlag response_flag)); diff --git a/test/mocks/tcp/mocks.h b/test/mocks/tcp/mocks.h index 3f864ec3296d..5ac8b8ee6f80 100644 --- a/test/mocks/tcp/mocks.h +++ b/test/mocks/tcp/mocks.h @@ -18,7 +18,7 @@ namespace ConnectionPool { class MockCancellable : public Cancellable { public: MockCancellable(); - ~MockCancellable(); + ~MockCancellable() override; // Tcp::ConnectionPool::Cancellable MOCK_METHOD1(cancel, void(CancelPolicy cancel_policy)); @@ -27,7 +27,7 @@ class MockCancellable : public Cancellable { class MockUpstreamCallbacks : public UpstreamCallbacks { public: MockUpstreamCallbacks(); - ~MockUpstreamCallbacks(); + ~MockUpstreamCallbacks() override; // Tcp::ConnectionPool::UpstreamCallbacks MOCK_METHOD2(onUpstreamData, void(Buffer::Instance& data, bool end_stream)); @@ -39,7 +39,7 @@ class MockUpstreamCallbacks : public UpstreamCallbacks { class MockConnectionData : public ConnectionData { public: MockConnectionData(); - ~MockConnectionData(); + ~MockConnectionData() override; // Tcp::ConnectionPool::ConnectionData MOCK_METHOD0(connection, Network::ClientConnection&()); @@ -57,7 +57,7 @@ class MockConnectionData : public ConnectionData { class MockInstance : public Instance { public: MockInstance(); - ~MockInstance(); + ~MockInstance() override; // Tcp::ConnectionPool::Instance MOCK_METHOD1(addDrainedCallback, void(DrainedCb cb)); diff --git a/test/mocks/thread_local/mocks.h b/test/mocks/thread_local/mocks.h index 24393722887a..3824deac4ac4 100644 --- a/test/mocks/thread_local/mocks.h +++ b/test/mocks/thread_local/mocks.h @@ -15,7 +15,7 @@ namespace ThreadLocal { class MockInstance : public Instance { public: MockInstance(); - ~MockInstance(); + ~MockInstance() override; MOCK_METHOD1(runOnAllThreads, void(Event::PostCb cb)); MOCK_METHOD2(runOnAllThreads, void(Event::PostCb cb, Event::PostCb main_callback)); @@ -48,7 +48,7 @@ class MockInstance : public Instance { parent_.data_.resize(index_ + 1); } - ~SlotImpl() { + ~SlotImpl() override { // Do not actually clear slot data during shutdown. This mimics the production code. if (!parent_.shutdown_) { EXPECT_LT(index_, parent_.data_.size()); diff --git a/test/mocks/tracing/mocks.h b/test/mocks/tracing/mocks.h index d62036fd8d07..22a694edfd9a 100644 --- a/test/mocks/tracing/mocks.h +++ b/test/mocks/tracing/mocks.h @@ -13,7 +13,7 @@ namespace Tracing { class MockConfig : public Config { public: MockConfig(); - ~MockConfig(); + ~MockConfig() override; MOCK_CONST_METHOD0(operationName, OperationName()); MOCK_CONST_METHOD0(requestHeadersForTags, const std::vector&()); @@ -27,7 +27,7 @@ class MockConfig : public Config { class MockSpan : public Span { public: MockSpan(); - ~MockSpan(); + ~MockSpan() override; MOCK_METHOD1(setOperation, void(absl::string_view operation)); MOCK_METHOD2(setTag, void(absl::string_view name, absl::string_view value)); @@ -48,7 +48,7 @@ class MockSpan : public Span { class MockHttpTracer : public HttpTracer { public: MockHttpTracer(); - ~MockHttpTracer(); + ~MockHttpTracer() override; SpanPtr startSpan(const Config& config, Http::HeaderMap& request_headers, const StreamInfo::StreamInfo& stream_info, @@ -64,7 +64,7 @@ class MockHttpTracer : public HttpTracer { class MockDriver : public Driver { public: MockDriver(); - ~MockDriver(); + ~MockDriver() override; SpanPtr startSpan(const Config& config, Http::HeaderMap& request_headers, const std::string& operation_name, SystemTime start_time, diff --git a/test/mocks/upstream/cluster_info.h b/test/mocks/upstream/cluster_info.h index 46b318c3f36d..56df9fa4dcca 100644 --- a/test/mocks/upstream/cluster_info.h +++ b/test/mocks/upstream/cluster_info.h @@ -26,7 +26,7 @@ namespace Upstream { class MockLoadBalancerSubsetInfo : public LoadBalancerSubsetInfo { public: MockLoadBalancerSubsetInfo(); - ~MockLoadBalancerSubsetInfo(); + ~MockLoadBalancerSubsetInfo() override; // Upstream::LoadBalancerSubsetInfo MOCK_CONST_METHOD0(isEnabled, bool()); @@ -61,7 +61,7 @@ class MockClusterTypedMetadata : public Config::TypedMetadataImpl()); MOCK_METHOD0(metadataMatchCriteria, Router::MetadataMatchCriteria*()); diff --git a/test/mocks/upstream/mocks.h b/test/mocks/upstream/mocks.h index e9b86baf2be6..f194bffceca0 100644 --- a/test/mocks/upstream/mocks.h +++ b/test/mocks/upstream/mocks.h @@ -38,7 +38,7 @@ class MockHostSet : public HostSet { public: MockHostSet(uint32_t priority = 0, uint32_t overprovisioning_factor = kDefaultOverProvisioningFactor); - ~MockHostSet(); + ~MockHostSet() override; void runCallbacks(const HostVector added, const HostVector removed) { member_update_cb_helper_.runCallbacks(priority(), added, removed); @@ -92,7 +92,7 @@ class MockHostSet : public HostSet { class MockPrioritySet : public PrioritySet { public: MockPrioritySet(); - ~MockPrioritySet(); + ~MockPrioritySet() override; HostSet& getHostSet(uint32_t priority); void runUpdateCallbacks(uint32_t priority, const HostVector& hosts_added, @@ -125,10 +125,10 @@ class MockRetryPriority : public RetryPriority { const DegradedLoad& degraded_priority_load) : priority_load_({healthy_priority_load, degraded_priority_load}) {} MockRetryPriority(const MockRetryPriority& other) : priority_load_(other.priority_load_) {} - ~MockRetryPriority(); + ~MockRetryPriority() override; const HealthyAndDegradedLoad& determinePriorityLoad(const PrioritySet&, - const HealthyAndDegradedLoad&) { + const HealthyAndDegradedLoad&) override { return priority_load_; } @@ -158,7 +158,7 @@ class MockRetryPriorityFactory : public RetryPriorityFactory { class MockCluster : public Cluster { public: MockCluster(); - ~MockCluster(); + ~MockCluster() override; // Upstream::Cluster MOCK_METHOD0(healthChecker, HealthChecker*()); @@ -182,7 +182,7 @@ class MockCluster : public Cluster { class MockClusterRealPrioritySet : public MockCluster { public: MockClusterRealPrioritySet(); - ~MockClusterRealPrioritySet(); + ~MockClusterRealPrioritySet() override; // Upstream::Cluster PrioritySetImpl& prioritySet() override { return priority_set_; } @@ -195,7 +195,7 @@ class MockClusterRealPrioritySet : public MockCluster { class MockClusterMockPrioritySet : public MockCluster { public: MockClusterMockPrioritySet(); - ~MockClusterMockPrioritySet(); + ~MockClusterMockPrioritySet() override; // Upstream::Cluster MockPrioritySet& prioritySet() override { return priority_set_; } @@ -207,7 +207,7 @@ class MockClusterMockPrioritySet : public MockCluster { class MockLoadBalancer : public LoadBalancer { public: MockLoadBalancer(); - ~MockLoadBalancer(); + ~MockLoadBalancer() override; // Upstream::LoadBalancer MOCK_METHOD1(chooseHost, HostConstSharedPtr(LoadBalancerContext* context)); @@ -218,7 +218,7 @@ class MockLoadBalancer : public LoadBalancer { class MockThreadAwareLoadBalancer : public ThreadAwareLoadBalancer { public: MockThreadAwareLoadBalancer(); - ~MockThreadAwareLoadBalancer(); + ~MockThreadAwareLoadBalancer() override; // Upstream::ThreadAwareLoadBalancer MOCK_METHOD0(factory, LoadBalancerFactorySharedPtr()); @@ -228,7 +228,7 @@ class MockThreadAwareLoadBalancer : public ThreadAwareLoadBalancer { class MockThreadLocalCluster : public ThreadLocalCluster { public: MockThreadLocalCluster(); - ~MockThreadLocalCluster(); + ~MockThreadLocalCluster() override; // Upstream::ThreadLocalCluster MOCK_METHOD0(prioritySet, const PrioritySet&()); @@ -242,7 +242,7 @@ class MockThreadLocalCluster : public ThreadLocalCluster { class MockClusterManagerFactory : public ClusterManagerFactory { public: MockClusterManagerFactory(); - ~MockClusterManagerFactory(); + ~MockClusterManagerFactory() override; Secret::MockSecretManager& secretManager() override { return secret_manager_; }; @@ -275,14 +275,14 @@ class MockClusterManagerFactory : public ClusterManagerFactory { class MockClusterUpdateCallbacksHandle : public ClusterUpdateCallbacksHandle { public: MockClusterUpdateCallbacksHandle(); - ~MockClusterUpdateCallbacksHandle(); + ~MockClusterUpdateCallbacksHandle() override; }; class MockClusterManager : public ClusterManager { public: explicit MockClusterManager(TimeSource& time_source); MockClusterManager(); - ~MockClusterManager(); + ~MockClusterManager() override; ClusterUpdateCallbacksHandlePtr addThreadLocalClusterUpdateCallbacks(ClusterUpdateCallbacks& callbacks) override { @@ -344,7 +344,7 @@ class MockClusterManager : public ClusterManager { class MockHealthChecker : public HealthChecker { public: MockHealthChecker(); - ~MockHealthChecker(); + ~MockHealthChecker() override; MOCK_METHOD1(addHostCheckCompleteCb, void(HostStatusCb callback)); MOCK_METHOD0(start, void()); @@ -377,7 +377,7 @@ class MockHealthCheckEventLogger : public HealthCheckEventLogger { class MockCdsApi : public CdsApi { public: MockCdsApi(); - ~MockCdsApi(); + ~MockCdsApi() override; MOCK_METHOD0(initialize, void()); MOCK_METHOD1(setInitializedCb, void(std::function callback)); @@ -389,7 +389,7 @@ class MockCdsApi : public CdsApi { class MockClusterUpdateCallbacks : public ClusterUpdateCallbacks { public: MockClusterUpdateCallbacks(); - ~MockClusterUpdateCallbacks(); + ~MockClusterUpdateCallbacks() override; MOCK_METHOD1(onClusterAddOrUpdate, void(ThreadLocalCluster& cluster)); MOCK_METHOD1(onClusterRemoval, void(const std::string& cluster_name)); @@ -398,7 +398,7 @@ class MockClusterUpdateCallbacks : public ClusterUpdateCallbacks { class MockClusterInfoFactory : public ClusterInfoFactory, Logger::Loggable { public: MockClusterInfoFactory(); - ~MockClusterInfoFactory(); + ~MockClusterInfoFactory() override; MOCK_METHOD1(createClusterInfo, ClusterInfoConstSharedPtr(const CreateClusterInfoParams&)); }; @@ -406,7 +406,7 @@ class MockClusterInfoFactory : public ClusterInfoFactory, Logger::Loggable port_chains; for (int i = 0; i < input_size; i++) { diff --git a/test/server/guarddog_impl_test.cc b/test/server/guarddog_impl_test.cc index 77b3397ffd59..e4f5d35f8e2c 100644 --- a/test/server/guarddog_impl_test.cc +++ b/test/server/guarddog_impl_test.cc @@ -30,12 +30,12 @@ namespace { class DebugTestInterlock : public GuardDogImpl::TestInterlockHook { public: // GuardDogImpl::TestInterlockHook - virtual void signalFromImpl(MonotonicTime time) { + void signalFromImpl(MonotonicTime time) override { impl_reached_ = time; impl_.notifyAll(); } - virtual void waitFromTest(Thread::MutexBasicLockable& mutex, MonotonicTime time) + void waitFromTest(Thread::MutexBasicLockable& mutex, MonotonicTime time) override EXCLUSIVE_LOCKS_REQUIRED(mutex) { while (impl_reached_ < time) { impl_.wait(mutex); diff --git a/test/server/http/config_tracker_impl_test.cc b/test/server/http/config_tracker_impl_test.cc index d085e2c962af..60d4633f08a7 100644 --- a/test/server/http/config_tracker_impl_test.cc +++ b/test/server/http/config_tracker_impl_test.cc @@ -21,7 +21,7 @@ class ConfigTrackerImplTest : public testing::Test { ProtobufTypes::MessagePtr test_msg() { return std::make_unique(); } - virtual ~ConfigTrackerImplTest() = default; + ~ConfigTrackerImplTest() override = default; ConfigTrackerImpl tracker; const std::map& cbs_map; diff --git a/test/test_common/logging.h b/test/test_common/logging.h index c7e1fed70c9a..62fe9f6d7d53 100644 --- a/test/test_common/logging.h +++ b/test/test_common/logging.h @@ -49,7 +49,7 @@ class LogLevelSetter { class LogRecordingSink : public Logger::SinkDelegate { public: explicit LogRecordingSink(Logger::DelegatingLogSinkPtr log_sink); - virtual ~LogRecordingSink(); + ~LogRecordingSink() override; // Logger::SinkDelegate void log(absl::string_view msg) override; diff --git a/test/test_common/simulated_time_system.cc b/test/test_common/simulated_time_system.cc index 1e700f650832..c4801ae68bda 100644 --- a/test/test_common/simulated_time_system.cc +++ b/test/test_common/simulated_time_system.cc @@ -55,7 +55,7 @@ class SimulatedTimeSystemHelper::Alarm : public Timer { time_system_(time_system), index_(time_system.nextIndex()), armed_(false), pending_(false) { } - virtual ~Alarm(); + ~Alarm() override; // Timer void disableTimer() override; diff --git a/test/test_common/test_time_system.h b/test/test_common/test_time_system.h index bd3c184648ad..4d2ef8196642 100644 --- a/test/test_common/test_time_system.h +++ b/test/test_common/test_time_system.h @@ -15,7 +15,7 @@ class TestTimeSystem; // Adds sleep() and waitFor() interfaces to Event::TimeSystem. class TestTimeSystem : public Event::TimeSystem { public: - virtual ~TestTimeSystem() = default; + ~TestTimeSystem() override = default; /** * Advances time forward by the specified duration, running any timers