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 219 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
230 EXPECT_EQ(5678, addr.port()); | 230 EXPECT_EQ(5678, addr.port()); |
231 EXPECT_EQ("", addr.hostname()); | 231 EXPECT_EQ("", addr.hostname()); |
232 EXPECT_EQ(kTestV6AddrFullString, addr.ToString()); | 232 EXPECT_EQ(kTestV6AddrFullString, addr.ToString()); |
233 EXPECT_EQ(6, addr.scope_id()); | 233 EXPECT_EQ(6, addr.scope_id()); |
234 | 234 |
235 addr = from; | 235 addr = from; |
236 addr_storage.ss_family = AF_UNSPEC; | 236 addr_storage.ss_family = AF_UNSPEC; |
237 EXPECT_FALSE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); | 237 EXPECT_FALSE(SocketAddressFromSockAddrStorage(addr_storage, &addr)); |
238 EXPECT_EQ(from, addr); | 238 EXPECT_EQ(from, addr); |
239 | 239 |
240 EXPECT_FALSE(SocketAddressFromSockAddrStorage(addr_storage, NULL)); | 240 EXPECT_FALSE(SocketAddressFromSockAddrStorage(addr_storage, nullptr)); |
241 } | 241 } |
242 | 242 |
243 bool AreEqual(const SocketAddress& addr1, | 243 bool AreEqual(const SocketAddress& addr1, |
244 const SocketAddress& addr2) { | 244 const SocketAddress& addr2) { |
245 return addr1 == addr2 && addr2 == addr1 && | 245 return addr1 == addr2 && addr2 == addr1 && |
246 !(addr1 != addr2) && !(addr2 != addr1); | 246 !(addr1 != addr2) && !(addr2 != addr1); |
247 } | 247 } |
248 | 248 |
249 bool AreUnequal(const SocketAddress& addr1, | 249 bool AreUnequal(const SocketAddress& addr1, |
250 const SocketAddress& addr2) { | 250 const SocketAddress& addr2) { |
(...skipping 91 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
342 EXPECT_EQ("[" + kTestV6AddrAnonymizedString + "]", | 342 EXPECT_EQ("[" + kTestV6AddrAnonymizedString + "]", |
343 addr_v6.HostAsSensitiveURIString()); | 343 addr_v6.HostAsSensitiveURIString()); |
344 EXPECT_EQ(kTestV6AddrFullAnonymizedString, addr_v6.ToSensitiveString()); | 344 EXPECT_EQ(kTestV6AddrFullAnonymizedString, addr_v6.ToSensitiveString()); |
345 #else | 345 #else |
346 EXPECT_EQ("[" + kTestV6AddrString + "]", addr_v6.HostAsSensitiveURIString()); | 346 EXPECT_EQ("[" + kTestV6AddrString + "]", addr_v6.HostAsSensitiveURIString()); |
347 EXPECT_EQ(kTestV6AddrFullString, addr_v6.ToSensitiveString()); | 347 EXPECT_EQ(kTestV6AddrFullString, addr_v6.ToSensitiveString()); |
348 #endif // defined(NDEBUG) | 348 #endif // defined(NDEBUG) |
349 } | 349 } |
350 | 350 |
351 } // namespace rtc | 351 } // namespace rtc |
OLD | NEW |