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

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

Issue 895853003: Update from https://crrev.com/314320 (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 | « net/base/net_util_linux.cc ('k') | net/base/network_change_notifier.h » ('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/net_util.h" 5 #include "net/base/net_util.h"
6 6
7 #include <string.h> 7 #include <string.h>
8 8
9 #include <ostream> 9 #include <ostream>
10 10
(...skipping 895 matching lines...) Expand 10 before | Expand all | Expand 10 after
906 #endif // OS_MACOSX 906 #endif // OS_MACOSX
907 907
908 #if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_NACL) 908 #if !defined(OS_MACOSX) && !defined(OS_WIN) && !defined(OS_NACL)
909 909
910 char* CopyInterfaceName(const char* ifname, int ifname_size, char* output) { 910 char* CopyInterfaceName(const char* ifname, int ifname_size, char* output) {
911 EXPECT_LT(ifname_size, IF_NAMESIZE); 911 EXPECT_LT(ifname_size, IF_NAMESIZE);
912 memcpy(output, ifname, ifname_size); 912 memcpy(output, ifname, ifname_size);
913 return output; 913 return output;
914 } 914 }
915 915
916 char* GetInterfaceName(unsigned int interface_index, char* ifname) { 916 char* GetInterfaceName(int interface_index, char* ifname) {
917 return CopyInterfaceName(ifname_em1, arraysize(ifname_em1), ifname); 917 return CopyInterfaceName(ifname_em1, arraysize(ifname_em1), ifname);
918 } 918 }
919 919
920 char* GetInterfaceNameVM(unsigned int interface_index, char* ifname) { 920 char* GetInterfaceNameVM(int interface_index, char* ifname) {
921 return CopyInterfaceName(ifname_vm, arraysize(ifname_vm), ifname); 921 return CopyInterfaceName(ifname_vm, arraysize(ifname_vm), ifname);
922 } 922 }
923 923
924 TEST(NetUtilTest, GetNetworkListTrimming) { 924 TEST(NetUtilTest, GetNetworkListTrimming) {
925 IPAddressNumber ipv6_local_address( 925 IPAddressNumber ipv6_local_address(
926 kIPv6LocalAddr, kIPv6LocalAddr + arraysize(kIPv6LocalAddr)); 926 kIPv6LocalAddr, kIPv6LocalAddr + arraysize(kIPv6LocalAddr));
927 IPAddressNumber ipv6_address(kIPv6Addr, kIPv6Addr + arraysize(kIPv6Addr)); 927 IPAddressNumber ipv6_address(kIPv6Addr, kIPv6Addr + arraysize(kIPv6Addr));
928 928
929 NetworkInterfaceList results; 929 NetworkInterfaceList results;
930 ::base::hash_set<int> online_links; 930 ::base::hash_set<int> online_links;
(...skipping 558 matching lines...) Expand 10 before | Expand all | Expand 10 after
1489 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) { 1489 TEST_P(NetUtilNonUniqueNameTest, IsHostnameNonUnique) {
1490 const NonUniqueNameTestData& test_data = GetParam(); 1490 const NonUniqueNameTestData& test_data = GetParam();
1491 1491
1492 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname)); 1492 EXPECT_EQ(test_data.is_unique, IsUnique(test_data.hostname));
1493 } 1493 }
1494 1494
1495 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest, 1495 INSTANTIATE_TEST_CASE_P(, NetUtilNonUniqueNameTest,
1496 testing::ValuesIn(kNonUniqueNameTestData)); 1496 testing::ValuesIn(kNonUniqueNameTestData));
1497 1497
1498 } // namespace net 1498 } // namespace net
OLDNEW
« no previous file with comments | « net/base/net_util_linux.cc ('k') | net/base/network_change_notifier.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698