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

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

Issue 10857: Add OPT=1 flag to build optimized on Linux. (Closed)
Patch Set: alles ist gut Created 12 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 | « chrome/test/unit/unit_tests.scons ('k') | net/net_perftests.scons » ('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) 2006-2008 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2006-2008 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_resolver.h" 5 #include "net/base/host_resolver.h"
6 6
7 #if defined(OS_WIN) 7 #if defined(OS_WIN)
8 #include <ws2tcpip.h> 8 #include <ws2tcpip.h>
9 #include <wspiapi.h> 9 #include <wspiapi.h>
10 #elif defined(OS_POSIX) 10 #elif defined(OS_POSIX)
(...skipping 13 matching lines...) Expand all
24 const int kPortnum = 5555; 24 const int kPortnum = 5555;
25 int err = host_resolver.Resolve("127.0.0.1", kPortnum, &adrlist, NULL); 25 int err = host_resolver.Resolve("127.0.0.1", kPortnum, &adrlist, NULL);
26 EXPECT_EQ(0, err); 26 EXPECT_EQ(0, err);
27 27
28 const struct addrinfo* ainfo = adrlist.head(); 28 const struct addrinfo* ainfo = adrlist.head();
29 EXPECT_EQ(static_cast<addrinfo*>(NULL), ainfo->ai_next); 29 EXPECT_EQ(static_cast<addrinfo*>(NULL), ainfo->ai_next);
30 EXPECT_EQ(sizeof(struct sockaddr_in), ainfo->ai_addrlen); 30 EXPECT_EQ(sizeof(struct sockaddr_in), ainfo->ai_addrlen);
31 31
32 const struct sockaddr* sa = ainfo->ai_addr; 32 const struct sockaddr* sa = ainfo->ai_addr;
33 const struct sockaddr_in* sa_in = (const struct sockaddr_in*) sa; 33 const struct sockaddr_in* sa_in = (const struct sockaddr_in*) sa;
34 EXPECT_EQ(htons(kPortnum), sa_in->sin_port); 34 EXPECT_TRUE(htons(kPortnum) == sa_in->sin_port);
35 EXPECT_EQ(htonl(0x7f000001), sa_in->sin_addr.s_addr); 35 EXPECT_TRUE(htonl(0x7f000001) == sa_in->sin_addr.s_addr);
36 } 36 }
37 37
38 } // namespace 38 } // namespace
OLDNEW
« no previous file with comments | « chrome/test/unit/unit_tests.scons ('k') | net/net_perftests.scons » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698