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

Unified Diff: net/dns/dns_config_service_posix_unittest.cc

Issue 9716020: Add base::HostToNetXX() & NetToHostXX(), and use them to replace htonX() & ntohX() in Chrome. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Rebase. Created 8 years, 9 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/base/net_util_unittest.cc ('k') | net/dns/dns_query.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: net/dns/dns_config_service_posix_unittest.cc
diff --git a/net/dns/dns_config_service_posix_unittest.cc b/net/dns/dns_config_service_posix_unittest.cc
index e4ae0d8506cdf9473270c1de668e9553d9e61eb4..a0408d3cfcfa53c56b4b9c98efd8b2cb333b4c17 100644
--- a/net/dns/dns_config_service_posix_unittest.cc
+++ b/net/dns/dns_config_service_posix_unittest.cc
@@ -73,7 +73,7 @@ void InitializeResState(res_state res, unsigned generation) {
for (int i = 0; i < 3; ++i) {
struct sockaddr_in sa;
sa.sin_family = AF_INET;
- sa.sin_port = htons(NS_DEFAULTPORT + i - generation);
+ sa.sin_port = base::HostToNet16(NS_DEFAULTPORT + i - generation);
inet_pton(AF_INET, ip4addr[i], &sa.sin_addr);
res->nsaddr_list[i] = sa;
}
@@ -90,7 +90,7 @@ void InitializeResState(res_state res, unsigned generation) {
struct sockaddr_in6 *sa6;
sa6 = (struct sockaddr_in6 *)malloc(sizeof(*sa6));
sa6->sin6_family = AF_INET6;
- sa6->sin6_port = htons(NS_DEFAULTPORT - i);
+ sa6->sin6_port = base::HostToNet16(NS_DEFAULTPORT - i);
inet_pton(AF_INET6, ip6addr[i], &sa6->sin6_addr);
res->_u._ext.nsaddrs[i] = sa6;
}
@@ -127,5 +127,3 @@ TEST(DnsConfigServicePosixTest, ConvertResStateToDnsConfig) {
} // namespace
} // namespace net
-
-
« no previous file with comments | « net/base/net_util_unittest.cc ('k') | net/dns/dns_query.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698