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

Unified Diff: net/base/ip_endpoint_unittest.cc

Issue 754433003: Update from https://crrev.com/305340 (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 6 years, 1 month 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 | « net/base/ip_endpoint.cc ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/base/ip_endpoint_unittest.cc
diff --git a/net/base/ip_endpoint_unittest.cc b/net/base/ip_endpoint_unittest.cc
index 5d7091152078789e461b2c4a4db29b4e5f66689f..17b325cddd809255856bab882f2ef0a5235ed609 100644
--- a/net/base/ip_endpoint_unittest.cc
+++ b/net/base/ip_endpoint_unittest.cc
@@ -29,7 +29,7 @@ struct TestData {
{ "::1", "[::1]", true },
{ "2001:db8:0::42", "[2001:db8::42]", true },
};
-int test_count = arraysize(tests);
+uint16 test_count = static_cast<uint16>(arraysize(tests));
class IPEndPointTest : public PlatformTest {
public:
@@ -46,7 +46,7 @@ TEST_F(IPEndPointTest, Constructor) {
IPEndPoint endpoint;
EXPECT_EQ(0, endpoint.port());
- for (int index = 0; index < test_count; ++index) {
+ for (uint16 index = 0; index < test_count; ++index) {
IPEndPoint endpoint(tests[index].ip_address, 80);
EXPECT_EQ(80, endpoint.port());
EXPECT_EQ(tests[index].ip_address, endpoint.address());
@@ -54,7 +54,7 @@ TEST_F(IPEndPointTest, Constructor) {
}
TEST_F(IPEndPointTest, Assignment) {
- for (int index = 0; index < test_count; ++index) {
+ for (uint16 index = 0; index < test_count; ++index) {
IPEndPoint src(tests[index].ip_address, index);
IPEndPoint dest = src;
@@ -64,7 +64,7 @@ TEST_F(IPEndPointTest, Assignment) {
}
TEST_F(IPEndPointTest, Copy) {
- for (int index = 0; index < test_count; ++index) {
+ for (uint16 index = 0; index < test_count; ++index) {
IPEndPoint src(tests[index].ip_address, index);
IPEndPoint dest(src);
@@ -74,7 +74,7 @@ TEST_F(IPEndPointTest, Copy) {
}
TEST_F(IPEndPointTest, ToFromSockAddr) {
- for (int index = 0; index < test_count; ++index) {
+ for (uint16 index = 0; index < test_count; ++index) {
IPEndPoint ip_endpoint(tests[index].ip_address, index);
// Convert to a sockaddr.
@@ -97,7 +97,7 @@ TEST_F(IPEndPointTest, ToFromSockAddr) {
}
TEST_F(IPEndPointTest, ToSockAddrBufTooSmall) {
- for (int index = 0; index < test_count; ++index) {
+ for (uint16 index = 0; index < test_count; ++index) {
IPEndPoint ip_endpoint(tests[index].ip_address, index);
SockaddrStorage storage;
@@ -116,7 +116,7 @@ TEST_F(IPEndPointTest, FromSockAddrBufTooSmall) {
}
TEST_F(IPEndPointTest, Equality) {
- for (int index = 0; index < test_count; ++index) {
+ for (uint16 index = 0; index < test_count; ++index) {
IPEndPoint src(tests[index].ip_address, index);
IPEndPoint dest(src);
EXPECT_TRUE(src == dest);
@@ -159,8 +159,8 @@ TEST_F(IPEndPointTest, ToString) {
IPEndPoint endpoint;
EXPECT_EQ(0, endpoint.port());
- for (int index = 0; index < test_count; ++index) {
- int port = 100 + index;
+ for (uint16 index = 0; index < test_count; ++index) {
+ uint16 port = 100 + index;
IPEndPoint endpoint(tests[index].ip_address, port);
const std::string result = endpoint.ToString();
EXPECT_EQ(tests[index].host_normalized + ":" + base::IntToString(port),
« no previous file with comments | « net/base/ip_endpoint.cc ('k') | net/base/net_log_event_type_list.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698