Chromium Code Reviews| 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)); |
|
mmenke
2014/11/13 16:00:42
This seems a little weird - think it makes more se
Peter Kasting
2014/11/14 20:42:53
You mean, add casts to every TEST_F below where th
mmenke
2014/11/14 21:05:53
Sorry - I misread the code. Had been thinking it
|
| 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), |