| 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 651 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 662 addr2 = IPAddress(kIPv4MappedPublicAddr); | 662 addr2 = IPAddress(kIPv4MappedPublicAddr); |
| 663 addr = addr.AsIPv6Address(); | 663 addr = addr.AsIPv6Address(); |
| 664 EXPECT_EQ(addr, addr2); | 664 EXPECT_EQ(addr, addr2); |
| 665 | 665 |
| 666 addr = IPAddress(kIPv6PublicAddr); | 666 addr = IPAddress(kIPv6PublicAddr); |
| 667 addr2 = IPAddress(kIPv6PublicAddr); | 667 addr2 = IPAddress(kIPv6PublicAddr); |
| 668 addr = addr.AsIPv6Address(); | 668 addr = addr.AsIPv6Address(); |
| 669 EXPECT_EQ(addr, addr2); | 669 EXPECT_EQ(addr, addr2); |
| 670 } | 670 } |
| 671 | 671 |
| 672 TEST(IPAddressTest, TestCountIPMaskBits) { | 672 // Disabled for UBSan: https://bugs.chromium.org/p/webrtc/issues/detail?id=5491 |
| 673 #ifdef UNDEFINED_SANITIZER |
| 674 #define MAYBE_TestCountIPMaskBits DISABLED_TestCountIPMaskBits |
| 675 #else |
| 676 #define MAYBE_TestCountIPMaskBits TestCountIPMaskBits |
| 677 #endif |
| 678 TEST(IPAddressTest, MAYBE_TestCountIPMaskBits) { |
| 673 IPAddress mask; | 679 IPAddress mask; |
| 674 // IPv4 on byte boundaries | 680 // IPv4 on byte boundaries |
| 675 EXPECT_PRED2(CheckMaskCount, "255.255.255.255", 32); | 681 EXPECT_PRED2(CheckMaskCount, "255.255.255.255", 32); |
| 676 EXPECT_PRED2(CheckMaskCount, "255.255.255.0", 24); | 682 EXPECT_PRED2(CheckMaskCount, "255.255.255.0", 24); |
| 677 EXPECT_PRED2(CheckMaskCount, "255.255.0.0", 16); | 683 EXPECT_PRED2(CheckMaskCount, "255.255.0.0", 16); |
| 678 EXPECT_PRED2(CheckMaskCount, "255.0.0.0", 8); | 684 EXPECT_PRED2(CheckMaskCount, "255.0.0.0", 8); |
| 679 EXPECT_PRED2(CheckMaskCount, "0.0.0.0", 0); | 685 EXPECT_PRED2(CheckMaskCount, "0.0.0.0", 0); |
| 680 | 686 |
| 681 // IPv4 not on byte boundaries | 687 // IPv4 not on byte boundaries |
| 682 EXPECT_PRED2(CheckMaskCount, "128.0.0.0", 1); | 688 EXPECT_PRED2(CheckMaskCount, "128.0.0.0", 1); |
| (...skipping 261 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 944 IPAddress *paddr1 = &addr1; | 950 IPAddress *paddr1 = &addr1; |
| 945 IPAddress *paddr4 = &addr4; | 951 IPAddress *paddr4 = &addr4; |
| 946 EXPECT_EQ(*paddr1, *paddr4); | 952 EXPECT_EQ(*paddr1, *paddr4); |
| 947 | 953 |
| 948 InterfaceAddress addr5(kIPv6LinkLocalAddr, | 954 InterfaceAddress addr5(kIPv6LinkLocalAddr, |
| 949 IPV6_ADDRESS_FLAG_TEMPORARY); | 955 IPV6_ADDRESS_FLAG_TEMPORARY); |
| 950 EXPECT_NE(addr1, addr5); | 956 EXPECT_NE(addr1, addr5); |
| 951 } | 957 } |
| 952 | 958 |
| 953 } // namespace rtc | 959 } // namespace rtc |
| OLD | NEW |