Fix 28 ClangTidy - Readability findings in modules/rtp_rtcp/

These fixes are automatically created by various analysis tools, but have been manually triggered to be applied.
 * the 'empty' method should be used to check for emptiness instead of 'size' (3 times)
 * using decl 'Return' is unused (4 times)
 * using decl '_' is unused (3 times)
 * using decl 'DoAll' is unused (2 times)
 * using decl 'SetArgPointee' is unused
 * using decl 'Dlrr' is unused
 * using decl 'IsEmpty' is unused
 * redundant get() call on smart pointer
 * using decl 'Invoke' is unused (2 times)
 * using decl 'SizeIs' is unused (3 times)
 * using decl 'make_tuple' is unused
 * using decl 'NiceMock' is unused
 * using decl 'SaveArg' is unused (2 times)
 * using decl 'AtLeast' is unused
 * using decl 'ElementsAre' is unused
 * using decl 'Gt' is unused

Bug: None
Change-Id: I97658fb0e94620b8319d7c3da29b15e27ec23188
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/151133
Reviewed-by: Niels Moller <nisse@webrtc.org>
Commit-Queue: Danil Chapovalov <danilchap@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29056}
This commit is contained in:
Danil Chapovalov 2019-09-03 12:41:41 +02:00 committed by Commit Bot
parent 38350b1ef2
commit 59e1464fcd
15 changed files with 4 additions and 29 deletions

View File

@ -33,12 +33,12 @@ bool IsTokenChar(char ch) {
} // namespace
bool IsLegalMidName(absl::string_view name) {
return (name.size() <= kMidRsidMaxSize && name.size() > 0 &&
return (name.size() <= kMidRsidMaxSize && !name.empty() &&
absl::c_all_of(name, IsTokenChar));
}
bool IsLegalRsidName(absl::string_view name) {
return (name.size() <= kMidRsidMaxSize && name.size() > 0 &&
return (name.size() <= kMidRsidMaxSize && !name.empty() &&
absl::c_all_of(name, isalnum));
}

View File

@ -27,7 +27,6 @@ namespace {
using ::testing::_;
using ::testing::Args;
using ::testing::ElementsAreArray;
using ::testing::Return;
using test::fec::FlexfecPacketGenerator;
using Packet = ForwardErrorCorrection::Packet;

View File

@ -14,11 +14,6 @@
#include "test/gmock.h"
#include "test/gtest.h"
using ::testing::_;
using ::testing::DoAll;
using ::testing::Return;
using ::testing::SetArgPointee;
namespace webrtc {
static const int64_t kTestRtt = 10;

View File

@ -19,7 +19,6 @@ using ::testing::ElementsAre;
using ::testing::ElementsAreArray;
using ::testing::make_tuple;
using ::testing::SizeIs;
using webrtc::rtcp::Dlrr;
using webrtc::rtcp::ExtendedReports;
using webrtc::rtcp::ReceiveTimeInfo;
using webrtc::rtcp::Rrtr;

View File

@ -15,7 +15,6 @@
#include "test/rtcp_packet_parser.h"
using ::testing::ElementsAreArray;
using ::testing::IsEmpty;
using ::testing::make_tuple;
using webrtc::rtcp::TmmbItem;
using webrtc::rtcp::Tmmbr;

View File

@ -743,7 +743,7 @@ int32_t RTCPSender::SendCompoundRTCP(
BuilderFunc func = builder_it->second;
std::unique_ptr<rtcp::RtcpPacket> packet = (this->*func)(context);
if (packet.get() == nullptr)
if (packet == nullptr)
return -1;
// If there is a BYE, don't append now - save it and append it
// at the end later.

View File

@ -32,7 +32,6 @@ namespace {
using ::testing::_;
using ::testing::ElementsAre;
using ::testing::Invoke;
using ::testing::Return;
using ::testing::SizeIs;
using ::testing::StrictMock;

View File

@ -30,7 +30,6 @@ using ::testing::Contains;
using ::testing::Each;
using ::testing::ElementsAreArray;
using ::testing::Le;
using ::testing::SizeIs;
constexpr RtpPacketizer::PayloadSizeLimits kNoSizeLimits;

View File

@ -23,7 +23,6 @@ using ::testing::Each;
using ::testing::ElementsAre;
using ::testing::ElementsAreArray;
using ::testing::IsEmpty;
using ::testing::make_tuple;
constexpr int8_t kPayloadType = 100;
constexpr uint32_t kSsrc = 0x12345678;

View File

@ -694,7 +694,7 @@ void ModuleRtpRtcpImpl::OnReceivedNack(
if (!rtp_sender_)
return;
if (!rtp_sender_->StorePackets() || nack_sequence_numbers.size() == 0) {
if (!rtp_sender_->StorePackets() || nack_sequence_numbers.empty()) {
return;
}
// Use RTT from RtcpRttStats class if provided.

View File

@ -29,11 +29,7 @@
#include "test/rtcp_packet_parser.h"
#include "test/rtp_header_parser.h"
using ::testing::_;
using ::testing::ElementsAre;
using ::testing::NiceMock;
using ::testing::Return;
using ::testing::SaveArg;
namespace webrtc {
namespace {

View File

@ -33,7 +33,6 @@ const uint32_t kSsrc = 725242;
const uint8_t kAudioLevel = 0x5a;
const uint64_t kStartTime = 123456789;
using ::testing::_;
using ::testing::ElementsAreArray;
class LoopbackTransportTest : public webrtc::Transport {

View File

@ -74,19 +74,12 @@ const char kNoMid[] = "";
using ::testing::_;
using ::testing::AllOf;
using ::testing::AtLeast;
using ::testing::DoAll;
using ::testing::ElementsAre;
using ::testing::ElementsAreArray;
using ::testing::Field;
using ::testing::Gt;
using ::testing::Invoke;
using ::testing::NiceMock;
using ::testing::Pointee;
using ::testing::Property;
using ::testing::Return;
using ::testing::SaveArg;
using ::testing::SizeIs;
using ::testing::StrictMock;
uint64_t ConvertMsToAbsSendTime(int64_t time_ms) {

View File

@ -31,7 +31,6 @@ using ::testing::Combine;
using ::testing::ElementsAre;
using ::testing::ElementsAreArray;
using ::testing::IsEmpty;
using ::testing::SizeIs;
using ::testing::TestWithParam;
using ::testing::Values;

View File

@ -30,7 +30,6 @@ namespace {
using ::testing::_;
using ::testing::Args;
using ::testing::ElementsAreArray;
using ::testing::Return;
using test::fec::AugmentedPacket;
using Packet = ForwardErrorCorrection::Packet;