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

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

Issue 662553002: Convert ARRAYSIZE_UNSAFE -> arraysize in net/. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 2 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 unified diff | Download patch
« no previous file with comments | « no previous file | net/base/escape.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/address_list.h" 5 #include "net/base/address_list.h"
6 6
7 #include "base/strings/string_util.h" 7 #include "base/strings/string_util.h"
8 #include "base/sys_byteorder.h" 8 #include "base/sys_byteorder.h"
9 #include "net/base/net_util.h" 9 #include "net/base/net_util.h"
10 #include "net/base/sys_addrinfo.h" 10 #include "net/base/sys_addrinfo.h"
(...skipping 103 matching lines...) Expand 10 before | Expand all | Expand 10 after
114 AF_INET, 114 AF_INET,
115 sizeof(struct sockaddr_in), 115 sizeof(struct sockaddr_in),
116 offsetof(struct sockaddr_in, sin_addr), 116 offsetof(struct sockaddr_in, sin_addr),
117 sizeof(struct in_addr), 117 sizeof(struct in_addr),
118 }, 118 },
119 }; 119 };
120 const std::string kCanonicalName = "canonical.example.com"; 120 const std::string kCanonicalName = "canonical.example.com";
121 121
122 // Construct a list of ip addresses. 122 // Construct a list of ip addresses.
123 IPAddressList ip_list; 123 IPAddressList ip_list;
124 for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) { 124 for (size_t i = 0; i < arraysize(tests); ++i) {
125 IPAddressNumber ip_number; 125 IPAddressNumber ip_number;
126 ASSERT_TRUE(ParseIPLiteralToNumber(tests[i].ip_address, &ip_number)); 126 ASSERT_TRUE(ParseIPLiteralToNumber(tests[i].ip_address, &ip_number));
127 ip_list.push_back(ip_number); 127 ip_list.push_back(ip_number);
128 } 128 }
129 129
130 AddressList test_list = AddressList::CreateFromIPAddressList(ip_list, 130 AddressList test_list = AddressList::CreateFromIPAddressList(ip_list,
131 kCanonicalName); 131 kCanonicalName);
132 std::string canonical_name; 132 std::string canonical_name;
133 EXPECT_EQ(kCanonicalName, test_list.canonical_name()); 133 EXPECT_EQ(kCanonicalName, test_list.canonical_name());
134 EXPECT_EQ(ARRAYSIZE_UNSAFE(tests), test_list.size()); 134 EXPECT_EQ(arraysize(tests), test_list.size());
135 } 135 }
136 136
137 } // namespace 137 } // namespace
138 } // namespace net 138 } // namespace net
OLDNEW
« no previous file with comments | « no previous file | net/base/escape.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698