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

Side by Side Diff: net/base/ip_endpoint_unittest.cc

Issue 669813003: Update from chromium https://crrev.com/301725/ (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 unified diff | Download patch
« no previous file with comments | « net/base/file_stream_unittest.cc ('k') | net/base/keygen_handler_unittest.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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/ip_endpoint.h" 5 #include "net/base/ip_endpoint.h"
6 6
7 #include "base/strings/string_number_conversions.h" 7 #include "base/strings/string_number_conversions.h"
8 #include "net/base/net_util.h" 8 #include "net/base/net_util.h"
9 #include "testing/gtest/include/gtest/gtest.h" 9 #include "testing/gtest/include/gtest/gtest.h"
10 #include "testing/platform_test.h" 10 #include "testing/platform_test.h"
(...skipping 15 matching lines...) Expand all
26 } tests[] = { 26 } tests[] = {
27 { "127.0.00.1", "127.0.0.1", false}, 27 { "127.0.00.1", "127.0.0.1", false},
28 { "192.168.1.1", "192.168.1.1", false }, 28 { "192.168.1.1", "192.168.1.1", false },
29 { "::1", "[::1]", true }, 29 { "::1", "[::1]", true },
30 { "2001:db8:0::42", "[2001:db8::42]", true }, 30 { "2001:db8:0::42", "[2001:db8::42]", true },
31 }; 31 };
32 int test_count = arraysize(tests); 32 int test_count = arraysize(tests);
33 33
34 class IPEndPointTest : public PlatformTest { 34 class IPEndPointTest : public PlatformTest {
35 public: 35 public:
36 virtual void SetUp() { 36 void SetUp() override {
37 // This is where we populate the TestData. 37 // This is where we populate the TestData.
38 for (int index = 0; index < test_count; ++index) { 38 for (int index = 0; index < test_count; ++index) {
39 EXPECT_TRUE(ParseIPLiteralToNumber(tests[index].host, 39 EXPECT_TRUE(ParseIPLiteralToNumber(tests[index].host,
40 &tests[index].ip_address)); 40 &tests[index].ip_address));
41 } 41 }
42 } 42 }
43 }; 43 };
44 44
45 TEST_F(IPEndPointTest, Constructor) { 45 TEST_F(IPEndPointTest, Constructor) {
46 IPEndPoint endpoint; 46 IPEndPoint endpoint;
(...skipping 117 matching lines...) Expand 10 before | Expand all | Expand 10 after
164 IPEndPoint endpoint(tests[index].ip_address, port); 164 IPEndPoint endpoint(tests[index].ip_address, port);
165 const std::string result = endpoint.ToString(); 165 const std::string result = endpoint.ToString();
166 EXPECT_EQ(tests[index].host_normalized + ":" + base::IntToString(port), 166 EXPECT_EQ(tests[index].host_normalized + ":" + base::IntToString(port),
167 result); 167 result);
168 } 168 }
169 } 169 }
170 170
171 } // namespace 171 } // namespace
172 172
173 } // namespace net 173 } // namespace net
OLDNEW
« no previous file with comments | « net/base/file_stream_unittest.cc ('k') | net/base/keygen_handler_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698