Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(420)

Unified Diff: webrtc/base/virtualsocket_unittest.cc

Issue 2718663005: Replace NULL with nullptr or null in webrtc/base/. (Closed)
Patch Set: Fixing Windows and formatting issues. Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/base/unixfilesystem.cc ('k') | webrtc/base/virtualsocketserver.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/base/virtualsocket_unittest.cc
diff --git a/webrtc/base/virtualsocket_unittest.cc b/webrtc/base/virtualsocket_unittest.cc
index 4ee2c75617ba49e7b3c625c85c4b5b4e46183add..b8847489a32cb9176980ad030d7879b8f8855760 100644
--- a/webrtc/base/virtualsocket_unittest.cc
+++ b/webrtc/base/virtualsocket_unittest.cc
@@ -137,10 +137,10 @@ struct Receiver : public MessageHandler, public sigslot::has_slots<> {
class VirtualSocketServerTest : public testing::Test {
public:
- VirtualSocketServerTest() : ss_(new VirtualSocketServer(NULL)),
- kIPv4AnyAddress(IPAddress(INADDR_ANY), 0),
- kIPv6AnyAddress(IPAddress(in6addr_any), 0) {
- }
+ VirtualSocketServerTest()
+ : ss_(new VirtualSocketServer(nullptr)),
+ kIPv4AnyAddress(IPAddress(INADDR_ANY), 0),
+ kIPv6AnyAddress(IPAddress(in6addr_any), 0) {}
void CheckPortIncrementalization(const SocketAddress& post,
const SocketAddress& pre) {
@@ -263,7 +263,7 @@ class VirtualSocketServerTest : public testing::Test {
// No pending server connections
EXPECT_FALSE(sink.Check(server, testing::SSE_READ));
- EXPECT_TRUE(NULL == server->Accept(&accept_addr));
+ EXPECT_TRUE(nullptr == server->Accept(&accept_addr));
EXPECT_EQ(AF_UNSPEC, accept_addr.family());
// Attempt connect to listening socket
@@ -287,7 +287,7 @@ class VirtualSocketServerTest : public testing::Test {
// Server has pending connection
EXPECT_TRUE(sink.Check(server, testing::SSE_READ));
Socket* accepted = server->Accept(&accept_addr);
- EXPECT_TRUE(NULL != accepted);
+ EXPECT_TRUE(nullptr != accepted);
EXPECT_NE(accept_addr, kEmptyAddr);
EXPECT_EQ(accepted->GetRemoteAddress(), accept_addr);
@@ -330,7 +330,7 @@ class VirtualSocketServerTest : public testing::Test {
// No pending server connections
EXPECT_FALSE(sink.Check(server, testing::SSE_READ));
- EXPECT_TRUE(NULL == server->Accept(&accept_addr));
+ EXPECT_TRUE(nullptr == server->Accept(&accept_addr));
EXPECT_EQ(accept_addr, nil_addr);
// Connection failed
@@ -409,7 +409,7 @@ class VirtualSocketServerTest : public testing::Test {
// Server accepts connection
EXPECT_TRUE(sink.Check(server.get(), testing::SSE_READ));
std::unique_ptr<AsyncSocket> accepted(server->Accept(&accept_addr));
- ASSERT_TRUE(NULL != accepted.get());
+ ASSERT_TRUE(nullptr != accepted.get());
sink.Monitor(accepted.get());
// Client closes before connection complets
@@ -686,7 +686,7 @@ class VirtualSocketServerTest : public testing::Test {
// incremental port behavior could ensure the 2 Binds result in different
// address.
void DelayTest(const SocketAddress& initial_addr) {
- time_t seed = ::time(NULL);
+ time_t seed = ::time(nullptr);
LOG(LS_VERBOSE) << "seed = " << seed;
srand(static_cast<unsigned int>(seed));
@@ -766,7 +766,7 @@ class VirtualSocketServerTest : public testing::Test {
ss_->ProcessMessagesUntilIdle();
EXPECT_TRUE(sink.Check(server, testing::SSE_READ));
Socket* accepted = server->Accept(&accept_address);
- EXPECT_TRUE(NULL != accepted);
+ EXPECT_TRUE(nullptr != accepted);
EXPECT_NE(kEmptyAddr, accept_address);
ss_->ProcessMessagesUntilIdle();
EXPECT_TRUE(sink.Check(client, testing::SSE_OPEN));
@@ -777,7 +777,7 @@ class VirtualSocketServerTest : public testing::Test {
ss_->ProcessMessagesUntilIdle();
EXPECT_FALSE(sink.Check(server, testing::SSE_READ));
- EXPECT_TRUE(NULL == server->Accept(&accept_address));
+ EXPECT_TRUE(nullptr == server->Accept(&accept_address));
EXPECT_EQ(accept_address, kEmptyAddr);
EXPECT_EQ(client->GetState(), AsyncSocket::CS_CLOSED);
EXPECT_FALSE(sink.Check(client, testing::SSE_OPEN));
@@ -818,9 +818,7 @@ class VirtualSocketServerTest : public testing::Test {
virtual void SetUp() {
Thread::Current()->set_socketserver(ss_);
}
- virtual void TearDown() {
- Thread::Current()->set_socketserver(NULL);
- }
+ virtual void TearDown() { Thread::Current()->set_socketserver(nullptr); }
VirtualSocketServer* ss_;
const SocketAddress kIPv4AnyAddress;
@@ -1096,7 +1094,7 @@ TEST_F(VirtualSocketServerTest, CreatesStandardDistribution) {
VirtualSocketServer::CreateDistribution(kTestMean[midx],
kStdDev,
kTestSamples[sidx]);
- ASSERT_TRUE(NULL != f);
+ ASSERT_TRUE(nullptr != f);
ASSERT_EQ(kTestSamples[sidx], f->size());
double sum = 0;
for (uint32_t i = 0; i < f->size(); ++i) {
« no previous file with comments | « webrtc/base/unixfilesystem.cc ('k') | webrtc/base/virtualsocketserver.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698