OLD | NEW |
---|---|
1 /* | 1 /* |
2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. | 2 * Copyright 2004 The WebRTC Project Authors. All rights reserved. |
3 * | 3 * |
4 * Use of this source code is governed by a BSD-style license | 4 * Use of this source code is governed by a BSD-style license |
5 * that can be found in the LICENSE file in the root of the source | 5 * that can be found in the LICENSE file in the root of the source |
6 * tree. An additional intellectual property rights grant can be found | 6 * tree. An additional intellectual property rights grant can be found |
7 * in the file PATENTS. All contributing project authors may | 7 * in the file PATENTS. All contributing project authors may |
8 * be found in the AUTHORS file in the root of the source tree. | 8 * be found in the AUTHORS file in the root of the source tree. |
9 */ | 9 */ |
10 | 10 |
(...skipping 86 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
97 for (const auto& kv : network_manager.networks_map_) { | 97 for (const auto& kv : network_manager.networks_map_) { |
98 delete kv.second; | 98 delete kv.second; |
99 } | 99 } |
100 network_manager.networks_.clear(); | 100 network_manager.networks_.clear(); |
101 network_manager.networks_map_.clear(); | 101 network_manager.networks_map_.clear(); |
102 } | 102 } |
103 | 103 |
104 AdapterType GetAdapterType(BasicNetworkManager& network_manager) { | 104 AdapterType GetAdapterType(BasicNetworkManager& network_manager) { |
105 BasicNetworkManager::NetworkList list; | 105 BasicNetworkManager::NetworkList list; |
106 network_manager.GetNetworks(&list); | 106 network_manager.GetNetworks(&list); |
107 RTC_CHECK(list.size() == 1u); | 107 RTC_CHECK_EQ(list.size(), 1u); |
kwiberg-webrtc
2017/02/07 09:39:49
Nit: Prefer to put the reference value first. Also
nisse-webrtc
2017/02/07 10:48:15
Done.
| |
108 return list[0]->type(); | 108 return list[0]->type(); |
109 } | 109 } |
110 | 110 |
111 #if defined(WEBRTC_POSIX) | 111 #if defined(WEBRTC_POSIX) |
112 // Separated from CreateNetworks for tests. | 112 // Separated from CreateNetworks for tests. |
113 static void CallConvertIfAddrs(const BasicNetworkManager& network_manager, | 113 static void CallConvertIfAddrs(const BasicNetworkManager& network_manager, |
114 struct ifaddrs* interfaces, | 114 struct ifaddrs* interfaces, |
115 bool include_ignored, | 115 bool include_ignored, |
116 NetworkManager::NetworkList* networks) { | 116 NetworkManager::NetworkList* networks) { |
117 // Use the base IfAddrsConverter for test cases. | 117 // Use the base IfAddrsConverter for test cases. |
(...skipping 1027 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1145 // If the set default address is in a network, GetDefaultLocalAddress will | 1145 // If the set default address is in a network, GetDefaultLocalAddress will |
1146 // return the best IP in that network. | 1146 // return the best IP in that network. |
1147 manager.set_default_local_addresses(GetLoopbackIP(AF_INET), ip2); | 1147 manager.set_default_local_addresses(GetLoopbackIP(AF_INET), ip2); |
1148 EXPECT_TRUE(manager.GetDefaultLocalAddress(AF_INET6, &ip)); | 1148 EXPECT_TRUE(manager.GetDefaultLocalAddress(AF_INET6, &ip)); |
1149 EXPECT_EQ(static_cast<IPAddress>(ip1), ip); | 1149 EXPECT_EQ(static_cast<IPAddress>(ip1), ip); |
1150 | 1150 |
1151 manager.StopUpdating(); | 1151 manager.StopUpdating(); |
1152 } | 1152 } |
1153 | 1153 |
1154 } // namespace rtc | 1154 } // namespace rtc |
OLD | NEW |