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

Unified Diff: net/http/http_util_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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/proxy/proxy_bypass_rules_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/http/http_util_unittest.cc
diff --git a/net/http/http_util_unittest.cc b/net/http/http_util_unittest.cc
index 54acf68d3c3d52c3bc28aa4b0f9ee3603ac098cd..acb26930a0bee227ba111a760fe0e4c6c48dc31b 100644
--- a/net/http/http_util_unittest.cc
+++ b/net/http/http_util_unittest.cc
@@ -114,7 +114,7 @@ TEST(HttpUtilTest, HasHeader) {
{ "fOO: 1\r\nbar: 2", "foo", true },
{ "g: 0\r\nfoo: 1\r\nbar: 2", "foo", true },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
bool result = HttpUtil::HasHeader(tests[i].headers, tests[i].name);
EXPECT_EQ(tests[i].expected_result, result);
}
@@ -272,7 +272,7 @@ TEST(HttpUtilTest, LocateEndOfHeaders) {
{ "foo\nbar\n\r\njunk", 10 },
{ "foo\nbar\r\n\njunk", 10 },
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
int input_len = static_cast<int>(strlen(tests[i].input));
int eoh = HttpUtil::LocateEndOfHeaders(tests[i].input, input_len);
EXPECT_EQ(tests[i].expected_result, eoh);
@@ -582,7 +582,7 @@ TEST(HttpUtilTest, AssembleRawHeaders) {
"HTTP/1.0 200 OK|Foo: 1Foo2: 3|Bar: 2||"
},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string input = tests[i].input;
std::replace(input.begin(), input.end(), '|', '\0');
std::string raw = HttpUtil::AssembleRawHeaders(input.data(), input.size());
@@ -629,7 +629,7 @@ TEST(HttpUtilTest, RequestUrlSanitize) {
"/foobar?query=1"
}
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
GURL url(GURL(tests[i].url));
std::string expected_spec(tests[i].expected_spec);
std::string expected_path(tests[i].expected_path);
@@ -725,7 +725,7 @@ TEST(HttpUtilTest, ParseContentType) {
},
// TODO(abarth): Add more interesting test cases.
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::string mime_type;
std::string charset;
bool had_charset = false;
@@ -853,7 +853,7 @@ TEST(HttpUtilTest, ParseRanges) {
},
};
- for (size_t i = 0; i < ARRAYSIZE_UNSAFE(tests); ++i) {
+ for (size_t i = 0; i < arraysize(tests); ++i) {
std::vector<net::HttpByteRange> ranges;
bool return_value = HttpUtil::ParseRanges(std::string(tests[i].headers),
&ranges);
« no previous file with comments | « net/http/http_network_transaction_unittest.cc ('k') | net/proxy/proxy_bypass_rules_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698