| OLD | NEW |
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include "net/base/host_port_pair.h" | 5 #include "net/base/host_port_pair.h" |
| 6 | 6 |
| 7 #include "base/logging.h" | 7 #include "base/logging.h" |
| 8 #include "net/test/gtest_util.h" | 8 #include "net/test/gtest_util.h" |
| 9 #include "testing/gtest/include/gtest/gtest.h" | 9 #include "testing/gtest/include/gtest/gtest.h" |
| 10 | 10 |
| 11 using std::string; | 11 using std::string; |
| 12 | 12 |
| 13 namespace net { | 13 namespace net { |
| 14 | 14 |
| 15 namespace { | 15 namespace { |
| 16 | 16 |
| 17 struct TestData { | 17 struct TestData { |
| 18 string host; | 18 string host; |
| 19 uint16 port; | 19 uint16_t port; |
| 20 string to_string; | 20 string to_string; |
| 21 string host_for_url; | 21 string host_for_url; |
| 22 } tests[] = { | 22 } tests[] = { |
| 23 { "www.google.com", 80, "www.google.com:80", "www.google.com" }, | 23 { "www.google.com", 80, "www.google.com:80", "www.google.com" }, |
| 24 { "www.google.com", 443, "www.google.com:443", "www.google.com" }, | 24 { "www.google.com", 443, "www.google.com:443", "www.google.com" }, |
| 25 { "127.0.0.1", 80, "127.0.0.1:80", "127.0.0.1" }, | 25 { "127.0.0.1", 80, "127.0.0.1:80", "127.0.0.1" }, |
| 26 { "192.168.1.1", 80, "192.168.1.1:80", "192.168.1.1" }, | 26 { "192.168.1.1", 80, "192.168.1.1:80", "192.168.1.1" }, |
| 27 { "::1", 80, "[::1]:80", "[::1]" }, | 27 { "::1", 80, "[::1]:80", "[::1]" }, |
| 28 { "2001:db8::42", 80, "[2001:db8::42]:80", "[2001:db8::42]" }, | 28 { "2001:db8::42", 80, "[2001:db8::42]:80", "[2001:db8::42]" }, |
| 29 }; | 29 }; |
| (...skipping 82 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 112 | 112 |
| 113 EXPECT_TRUE(new_a_10.Equals(a_10)); | 113 EXPECT_TRUE(new_a_10.Equals(a_10)); |
| 114 EXPECT_FALSE(new_a_10.Equals(a_11)); | 114 EXPECT_FALSE(new_a_10.Equals(a_11)); |
| 115 EXPECT_FALSE(new_a_10.Equals(b_10)); | 115 EXPECT_FALSE(new_a_10.Equals(b_10)); |
| 116 EXPECT_FALSE(new_a_10.Equals(b_11)); | 116 EXPECT_FALSE(new_a_10.Equals(b_11)); |
| 117 } | 117 } |
| 118 | 118 |
| 119 } // namespace | 119 } // namespace |
| 120 | 120 |
| 121 } // namespace net | 121 } // namespace net |
| OLD | NEW |